All Linux HowTo's Security HowTo's

ClamAV on CentOS7/Redhat7 – Periodic disk scans

This article explains how to install and configure periodic scans with ClamAV on CentOS7 or Redhat (RHEL) 7 servers. Much of this came from “https://ismailyenigul.wordpress.com/2015/01/05/install-clamav-on-centos-7/”.

I’ve updated this article with a work-around for the (seemingly common) cron issue. Clamscan doesn’t seem to run from “/etc/cron.d/whatever” but does from “crontab -e”.

Install the required packages. Note that you need the EPEL repo’s available first. Do that here “https://fedoraproject.org/wiki/EPEL”.

yum install clamav-server clamav-data clamav-update clamav-filesystem clamav clamav-scanner-systemd clamav-devel clamav-lib clamav-server-systemd

Hash out the “Example” commands in “/etc/clamd.d/scan.conf” and “/etc/freshclam.conf”.

Update the AV. This wont work unless you’ve done the step above:

freshclam

Have the AV scan run daily 9at 3:am) and email the results to the sysadmin:

crontab -e"

Add the following entry:

0 3 * * * /bin/freshclam ; /bin/clamscan / --recursive=yes -i > /tmp/clamav.log ; mail -s clamav_log_`hostname` helpdesk@agix.local < /tmp/clamav.log

Enable and start the AV:

systemctl enable clamd@scan
systemctl start clamd@scan

Now you’re done.

Similar Posts:

Leave a Reply

Your email address will not be published. Required fields are marked *