Automatically scan newly uploaded or modified files with ClamAV, quarantining any detected threats in a user-specific directory—ideal for shared hosting environments.
You can configure which file extensions to scan and specify folders to monitor for changes.
This script was initially developed for use with OpenPanel, but it can be used with any control panel as long as you provide a list of paths to monitor (Docker and inotify will be installed).
- clone this repo:
git clone https://github.com/stefanpejcic/clamav-uploads-scanner /usr/local/clamav-uploads-scanner/
- install the service by running:
bash /usr/local/clamav-uploads-scanner/install.sh
The installation script will check if OpenPanel is in use. If it is, no additional configuration is necessary, as the document root for the domains will be automatically collected. However, if OpenPanel is not being used, you will need to specify the paths to monitor in the domains.list
file and set the extensions to scan in the extensions.txt
file.
cd /usr/local/clamav-uploads-scanner/ && git pull
bash /usr/local/clamav-uploads-scanner/uninstall.sh