Check the release, traffic and rollback plan

  1. Confirm the three plugins before changing traffic. Use a supported OPNsense release and open System → Firmware → Plugins. Check that its configured package repository supplies Squid, ClamAV and C-ICAP. The current proxy manual[1] puts the proxy in os-squid; it has not been part of the default installation since OPNsense 24.1. The checked 26.7 plugin sources also contain os-clamav and C-ICAP. Search by the C-ICAP label: its 26.7 package definition[2] produces os-c-icap, although the older walkthrough calls it os-cicap. If the needed plugin is absent from your appliance's catalog, stop and resolve the release or repository mismatch. Do not substitute an unrelated package or follow menus from another firewall.

  2. Name the requests you intend to scan. Treat this as a forward-proxy and ICAP path, not antivirus for everything behind the firewall. Use OPNsense's antivirus walkthrough[3] to identify the proxied HTTP requests; count HTTPS content only if you deliberately configure interception. Keep endpoint protection for files already on a client and email, USB or other traffic outside this path. Write down the test client, proxy address and browser settings before touching transparent redirects.

  3. Reserve resources and a way back. Save the current firewall configuration and record any proxy, NAT and firewall settings you will change. Allow a maintenance window in which you can remove the test client's proxy setting or undo the redirect without disabling ordinary routing. Check memory during initial signature loading and later updates: the ClamAV project's memory guidance[4] explains that concurrent database reloads can temporarily retain old and new engines, and that freshclam also needs memory for database checks. Do not size a busy firewall from an old small-RAM minimum alone. You are done when the required packages are available, the traffic boundary is written down, and the saved configuration gives you a practical rollback.

Install and connect the scanning services

  1. Establish the plain proxy first. Install os-squid, open Services → Squid Web Proxy → Administration, and follow the basic forward-proxy setup[5]. Select the intended interface, listening port and authentication policy. Configure one browser explicitly and confirm that an ordinary permitted HTTP page loads through it. Leave the rest of the clients alone while you establish that baseline; a broken proxy is not a scanner diagnosis.

  2. Enable the actual ClamAV connection. Install ClamAV and C-ICAP from the checked catalog. In ClamAV's Services page, enable clamd, enable freshclam updates and obtain current signatures. Keep Enable TCP Port enabled for this integration: the checked C-ICAP module connects to clamd at 127.0.0.1:3310, and the ClamAV controls[6] enable that local TCP endpoint. Do not expose it to clients. Enable C-ICAP and its ClamAV antivirus module using the C-ICAP controls[7]. Confirm that both services are running; a downloaded signature database alone does not establish the proxy-to-scanner connection.

  3. Attach ICAP to the forward proxy. Open the ICAP section of the proxy’s Administration page, enable ICAP, then enter both Request Modify and Response Modify URLs. The documented default is icap://[::1]:1344/avscan. Match the address to the installed C-ICAP configuration if you changed it, and verify its actual listening and access restrictions rather than assuming a copied loopback URL makes the service private. Apply the settings and check the proxy and C-ICAP logs for connection or scanner errors. You are done when the ordinary HTTP baseline still works and the configured proxy can use the local ICAP/ClamAV chain without errors.

Prove one client's path before adding another

  1. Keep routing visible. Start with that browser's explicit proxy setting. If you later need transparent HTTP proxying, follow the transparent-proxy guide[8] and inspect the NAT redirect, associated firewall rule and intended interface. Check an unselected client too. Enabling a service does not prove that every interface, browser or application uses it.

  2. Correlate the EICAR result with server logs. From the proxied browser, request the walkthrough's HTTP test file[9]. Use the official EICAR description[10] to distinguish its antivirus test artifact from a real infection. Confirm that the request used HTTP and that the proxy or C-ICAP/ClamAV logs identify the matching detection. An endpoint antivirus alert alone is not proof that this proxy scanned it. If the file passes without the expected proxy-side result, check the browser route, ICAP URLs, service health and signatures. Load an ordinary permitted page afterward to distinguish selective blocking from a broken proxy. Do not treat one small test file as proof that every file type, archive or download size is covered.

  3. Make HTTPS an explicit, separate choice. Leave content interception off unless you manage the affected clients and accept its certificate and privacy implications. Read OPNsense's HTTPS interception procedure and warnings[8] before configuring a trusted proxy CA: interception decrypts and re-encrypts traffic, can weaken security when misconfigured, and can break certificate-pinned services. Define exceptions instead of trying to force every destination through it. If you choose it, run the walkthrough's HTTPS EICAR check separately and inspect the certificate and server-side result. You are done when you can identify the selected client's HTTP scan, distinguish endpoint blocking from proxy blocking, and state exactly which HTTPS destinations are intercepted or bypassed.

Keep the result true after updates

  1. Review limits and failure behavior. Check the enabled file types, maximum object size and archive limits in the installed scanner and ICAP configuration. Treat encrypted archives as a limit to address deliberately: ClamAV cannot inspect their encrypted contents without the key. Review C-ICAP's Pass on error setting and the proxy's own behavior when ICAP is unavailable; the C-ICAP manual[7] calls passing a failed scan less secure. Record whether the chosen path blocks or passes traffic on failure, then verify that behavior during the maintenance window. Do not assume the default that worked on a small EICAR file is your complete policy.

  2. Retest the same boundary. Confirm that freshclam updates signatures and that the proxy, C-ICAP and clamd remain healthy after a restart or plugin update. Repeat the HTTP test and, if enabled, the separate HTTPS test. Retain the firewall rules and endpoint protection for risks outside this proxy path. You are done when client routing, the selected scan policy, ordinary page access and correlated detection logs still agree after the change.