Add option to exclude file types from daily scan
Migrated from: https://tracker.clearos.com/view.php?id=19401
Reported by: Nick Howitt
urrently the file scanner app scans all files and folders within the selected locations. Many file types are considered harmless such as jpg's and could be excluded from daily scans. As an example my IP security camera produces some 3800 jpg's yesterday and I keep a few days of history. A full scan including these takes over 2h.
It would be trivial to read in parameters exclude= and exclude-dir= from /etc/clearos/file_scan.conf by adding these lines to /use/sbin/file_scan:
elseif ($param == 'exclude')
$clam_scan_options .= " --$param=$value";
elseif ($param == 'exclude-dir')
$clam_scan_options .= " --$param=$value";
after the lines:
elseif ($param == 'max-scansize')
$clam_scan_options .= " --$param=$value";
This can be documented in the help text as the max-scansize and max-filesize are at the moment.
Longer term this could be the precursor to adding the parameters to the Webconfig.
Note that clamscan allows these parameters to be repeated multiple times, but we don't necessarily need to to start with as a regex such as --exclude=".(jpg|jpeg|png|gif|mkv)$" can cover multiple file types.