Table of Contents

Clamav

General Information

ClamAV is “an open source antivirus engine for detecting trojans, viruses, malware and other malicious threats.”

Checklist


Installation

Installing ClamAV.


Configuration

Configuring ClamAV.


freshclam

Virus definition updater for ClamAV.

/etc/freshclam.conf - Ensure Database Mirrors are correct

DatabaseMirror db.us.clamav.net
DatabaseMirror db.local.clamav.net

If you have a Squid proxy

HTTPProxyServer myserverhostname
HTTPProxyPort 3128

Run manual virus updates

freshclam -v

Operation

Using ClamAV.


Application Users

ClamAV software runs as non-privileged user(s).

EL 6

EL 7


Service

Freshclam is NOT a service. It is run via a daily cron script.


Clamd (the scanning daemon) is run as a service. It does not scan anything by itself unless “on access scanning” is enabled.

Enable On Boot

Service is enabled on boot

Service Status

Service Start

Service Stop


Log Files

Log files are located:

Other Files


clamscan

Clamscan is the utility that scans files and directories for viruses.

Scan a single file

clamscan myfile

Scan the current working directory

clamscan

Scan a directory recursively

clamscan -r /home/rjones

Scan a stream

cat myfile | clamscan -

Clamscan return codes


clamdscan

The clamd service allows for faster scanning of directories and files.

One off system scan of /home using clamdscan

/usr/bin/time nice clamdscan --fdpass --log=/root/clamdscan-report-$(date +%Y%m%d) /home

Scan Regularly with clamdscan

To scan systems regularly, use clamdscan and either

Example: Enable on access scanning

Example: Create a cron to launch clamdscan


Whitelist Files/Signatures

Whitelisting files/signatures allows for ClamAV to ignore them during scans.


Whitelist a File

To whitelist a file:


Whitelist a Signature

Whitelisting a signature should be performed with caution, as it has the potential to ignore legitimate virus's.

To whitelist a signature and add the signature name: