clamav
Drupal integration with the ClamAV virus scanner.
This module will verify that files uploaded to a site are not infected with a virus, and prevent infected files from being saved.
NB: The module integrates with ClamAV, it does not provide an anti-virus scanner engine.
Drupal 11+
For Drupal 11, the ClamAV module is likely to become a plugin for the Antivirus module.
- ClamAV (based on Antivirus) 4.0.x
- ClamAV standalone 2.1.x
- ClamAV legacy 2.0.x
Please try the Drupal 11 dev branches in non-production environments and share your feedback.
Installation
Comprehensive documentation can be found on the Installing ClamAV page. In general, the Drupal module doesn't have any specific requirements for how ClamAV is installed.
- First install the clamscan program:
- Then enable and configure the ClamAV Drupal module
- Done!
Post-installation
Once the ClamAV module is installed and configured, it's good practice to verify that it's detecting viruses properly. You can do this safely by trying to add content to your site, attaching the Eicar test virus to the content. The file upload should be blocked, and you should find a message recording this in the Watchdog logs.
Configuration
The Drupal configuration page is at /admin/config/media/clamav.
"Daemon mode" is recommended. "Executable mode" is significantly slower, and in some configurations, the ClamAV service may need to run under the same group as the webserver process.
In performance-testing, the mean scan-time for each configuration was as follows:
- Executable: 10.3 seconds
- Daemon-mode (unix socket): 0.0009 seconds
- Daemon-mode (TCP/IP): 0.0010 seconds
Daemon-mode came out 10,000 times faster than executable mode.
Documentation
The best resource is the ClamAV documentation.
For issues that are Drupal-specific or will affect most users of the Drupal ClamAV module, please raise and discuss them in the ClamAV module issue queue.
Related modules
- ClamAV Queue provides asynchronous queued scanning of uploaded files (for a specific use-case).
Acknowledgements
- File Framework project from which this project was grown.
- Original work is sponsored by FreshNetworks.
More acknowledgements below.