Using ClamAV with OPNsense provides an additional layer of security by enabling antivirus scanning at the network level. This setup is particularly useful for intercepting malicious traffic before it reaches client devices, which is beneficial in environments where not all devices have up-to-date antivirus protection.
Installation and Configuration
Install ClamAV Plugin: Begin by installing the ClamAV plugin (os-clamav) from the OPNsense plugins view. This will add a new menu entry under services for ClamAV.
Configure C-ICAP and ClamAV:
- Navigate to
Services > C-ICAP > Configuration
and enable the c-icap service. - Under the Antivirus tab, enable ClamAV.
- Go to
Services > ClamAV > Configuration
to download signatures and enable the clamd and freshclam services.
- Navigate to
Enable Proxy and ICAP: Set up a basic caching proxy server in OPNsense and enable transparent HTTP and SSL mode. Configure ICAP to work with ClamAV for scanning traffic.
Considerations
- Resource Requirements: ClamAV requires at least 1.5 GB of RAM to function properly, with 2 GB recommended to prevent crashes.
- TLS Traffic: Scanning encrypted TLS traffic requires decrypting it, which can complicate the setup and is often not recommended for small environments due to potential issues with certificate handling.
- Signature Updates: Regularly update ClamAV signatures using the freshclam service to maintain effective virus detection.
By incorporating ClamAV into OPNsense, administrators can enhance network security through proactive virus scanning, although careful consideration of resource requirements and encrypted traffic handling is necessary.