How to Scan Malware in AWS EC2 Instances

This tutorial is supposed to run on Amazon Linux 2

Install EPEL

sudo amazon-linux-extras install epel

Install ClamAV

sudo yum install clamav clamd -y

Remove Example configurations

 sudo sed -i -e "s/^Example/#Example/" /etc/clamd.d/scan.conf
sudo sed -i -e "s/^Example/#Example/" /etc/freshclam.conf

Update the Virus Definition Database

sudo freshclam

Open scan.cnf file for editing

sudo vi /etc/clamd.d/scan.conf

Un-comment the following line by removing #

#LocalSocket /var/run/clamd.scan/clamd.sock

Then run a VirusScan using following command

clamscan  --quiet dirname/

Leave a Comment

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