Skip to content

user76587658789/EasyClamAV

Repository files navigation

EasyClamAV

An easy-to-use scripts for ClamAV.
EasyClamAV can scan easily based on scan presets.
It was basically tested on Fedora Workstation(which distro I use), 
but it will probably work with other distros with some modifications.

I'm just an end-users who are interested in security and privacy, not a professional programmer.
Maybe someone can make something better than this, but I made it to make ClamAV easier to use for myself.
I'm not a native English speaker. Please understand some broken english.

-Features

Configure scan presets.
Easy scan based on scan presets.
Create scheduled scan scripts.
Manage log files.
Manage quarantined files.
Upadate signature.

-Required packages

Basically you need ClamAV and Crontab(option for schedule scan).
Install with the following command based on Fedora.

sudo dnf install clamav clamav-update cronie

After installation, update the signature of ClamAV and enable automatic update through the following command.

sudo systemctl stop clamav-freshclam
sudo freshclam
sudo systemctl start clamav-freshclam
sudo systemctl enable clamav-freshclam

If you are using Fedora, EasyClamAV can do this automatically.

-Setup

For security, it is recommended to run your own text editor and copy and paste the scripts rather than directly downloading the scripts.

1.Open a terminal in the directory where EasyClamAV is located.
2.chmod +x ./Setup.sh
3.sh ./Setup.sh → Create Start.sh
4.sh ./Start.sh

To add it to the GNOME AppGrid, do the following:

1.sudo dnf install menulibre(work for Fedora)
2.Run Menulibre.
3.Click the + icon at the top.
4.Configure the launcher as follows:

Command :/bin/bash <Location where EasyClamAV placed>/Start.sh
Check Run as terminal.

5.Click the ↓ icon at the top.

-How to use

1.Configure Scan Presets

 (1) : Configure Preset
 You can configure scan presets here. For custom options, see the official documentation of ClamAV.
 If you put --remove=yes in your custom options, infected files will be deleted immediately. 
 However, it is not recommended to prevent deletion of important files due to false postives.
 https://docs.clamav.net/manual/Usage/Scanning.html#clamscan
 
 (2) : View Preset
 You can check the configured presets.
 
2.Scan Home Folder

 When a preset is selected, clamscan scans user's home folder according to the options specified in the preset.

3.Custom Scan

 Select a preset and enter the path you want to scan, and clamscan will scan the path according to the options specified in the preset.

4.Scheduled Scan

 (1) Create Scan Script
 Create scan scripts based on configured presets.
 You can select options such as GUI notifications.
 
 (2) View Scan Scripts
 You can see the generated scan scripts.
 
 (3) Generate Cron Schedule
 Create a daily schedule for crontab. Just type crontab -e command and insert the created schedule. 
 After that, the script is executed according to the set schedule.
 
 (4) Clear Scan Scripts
 Delete all scripts.
 
 (5) Remove Specific Scan Script
 You can delete one script you want.
 
 (6) Set Automatic Scheduler
 Generate automatic script that execute determined scripts every hour.
 When the configuration is complete, type the command crontab -e and put timebot.sh.
 
 (7) View Automatic Scheduler
 You can see the timebot.sh created by the above function.

5.Log Viewer

 (1) View Logs
 You can check the logs.
 
 (2) Clear Logs
 Delete all logs.
 
 (3) Remove Specific Logs
 You can delete one log you want.

6.Quarantine

 (1) View Quarantined Files
 You can check the quarantined files.
 
 (2) Clear Quarantined Files
 Delete all quarantined files.
 
 (3/4) Clear Quarantined Files with Clamscan
 Delete all quarantined files with clamscan option '--remove=yes'.
 
 (5) Terminate Specific Quarantined File
 You can delete one quarantined file you want.
  
 (6) Restore Quarantined File
 You can restore one quarantined file you want.
 
7. Update Local Signatures
 
 (1) Update Signatures
 Update local signatures.
 
 (2) Generate Cron Schedule
 Create a daily schedule for crontab. Just type crontab -e command and insert the created schedule. 
 After that, the script is executed according to the set schedule.
 
 (3) Create Script for Automatic Scheduler
 Create an executable script for timebot.sh.
 
 (4) Create Local Update Config
 Create a basic configuration file.
  
 (5) Copy System Update Config
 Copy the system configuration file.
 (/etc/freshclam.conf)
 
 (6)Edit the configuration file using Nano.
 See the official ClamAV documentation.
 https://docs.clamav.net/manual/Usage/Configuration.html#freshclamconf
 
8. Update System Signatures

 (1/2)Enable/Disable Auto Update
 You can configure the signatures in /var/lib/clamav to be updated automatically.
 It's simpler and easier way than auto-updating local signatures using crontab, but runs with higher permission.
 Consider your threat model when deciding how to update.
 
 (3)Update Signatures.
 Update signatures in /var/lib/clamav.

9.Install Essential Packages

 Find and install ClamAV and Crontab from the packages.


-Clamd is not supported

Clamd supports multi-threading and on-access scanning, and it's nice that users don't have to pay anything for it.
But i don't use clamd for the following reasons :


1.Some distributions like Fedora having risk to need change selinux policies that I don't understand.
I think distribution's default selinux policy is ideal and should not be changed by end-users.

2.Clamd always takes up 1gb of ram in the background.

3.Some features of clamd are unstable.
(Especially on-access scan.)

4.Clamd is always running in the background, it increases the attack surface and can be a security vulnerability.

If AV affects the stability of a system, it's a reversal of priorities to protect.
Nevertheless, the possibilities are always open. So if some of the above problems are solved, I'll use clamd.
And I'm going to write a script to use it easily.