Misc scribbles

Installing clamav on OSX

2016-06-20

It is a common trope that OSX doesn't need anti-virus because everyone targets windows. That is maybe comforting to some but I think it's pretty naive. It would be better to have a system on your machine to tell you about viruses, trojan horses, malware, or spying. I have decided to employ a free open source scanner called clamAV https://www.clamav.net/. I don't really know if it has any good features for Mac scanning but thought it could be fun to install

ClamAV is the top choice for linux based OSs being free and open source (GPL) virus scanner.

To install we can use homebrew

    $ brew install clamav

Then there is s config file to setup. This is located in /usr/local/etc/clamav/freshclam.conf

To setup, edit this file and delete the line that says "Example" and then uncheck the desired settings. I would chose to enable logging to /var/log/clamav.log and also database directories in /var/lib/clamav

Then run the "freshclam" program

    $ freshclam

This will download the virus scanner database (main) and daily scanning updates

Then you can run clamscan on a given directory (recursively, only print infected files)

    $ clamscan -ri ~/

Or add this to a cronjob

    $ crontab -
 
    @hourly clamscan -ri ~/ | mail -v -s "clamscan results" your.email@gmail.com  >/dev/null 2>&1