Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Clamd / ClamScan setup and configuration

Discussion in 'Security' started by PeteS, Mar 25, 2019.

  1. PeteS

    PeteS Well-Known Member

    Joined:
    Jun 8, 2017
    Messages:
    167
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    Oregon
    cPanel Access Level:
    Root Administrator
    Re: Configure ClamAV Scanner - Version 78 Documentation - cPanel Documentation

    Please tell me if I have a correct and complete understanding of ClamAV.

    Once plugin is installed in WHM (w/o cron job):
    • clamd daemon is active and used for the following
    • incoming mail is scanned
    • outgoing mail is scanned, if configured in Exim settings
    • uploads in file manager are scanned
    • users can scan manually (using clamd or clamscan?)
    After adding a cron job:
    • clamscan is used for the following
    • all home directories (if using the code supplied) are scanned per the cron entry
    Additionally...
    • Is there an advantage of one over the other in the cron:
      • while read domain user; do /usr/local/cpanel/3rdparty/bin/clamscan -i -r /home/"$user" 2>&1; done </etc/trueuserdomains >>/root/infections.txt
      • for i in `awk '!/nobody/{print $2 | "sort | uniq" }' /etc/userdomains | sort | uniq`; do /usr/local/cpanel/3rdparty/bin/clamscan -i -r /home/$i 2>>/dev/null; done >> /root/infections&
    • I have read discussions about clamd vs clamscan regarding the impact on RAM and CPU usage (about signatures being loaded, I believe). Can you provide details on this?
    • What is the default behavior regarding infected files, and notification of found threats found, during cron scans? I have seen variations of cron jobs but would like docs on that.
    -Pete
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,476
    Likes Received:
    506
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @PeteS

    This is the recommended one:
    Code:
    while read domain user; do /usr/local/cpanel/3rdparty/bin/clamscan -i -r /home/"$user" 2>&1; done </etc/trueuserdomains >>/root/infections.txt
    
    As far as the other one goes it just looks like it's doing a similar action one outputs to /root/infections the other to /dev/null

    The clamd signature db is pretty large and when it needs to be loaded or updated during that time it can cause relatively high CPU/RAM usage - this isn't a constant though and shouldn't last an excessive amount of time nor should it continue to be resource intensive due to that reason while it's scanning, I should note though that all virus/malware scanners are going to use resources when scanning.


    I don't really think there is any it's dependent on the configuration you might want to look at ClamAV's site though ClamavNet
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. PeteS

    PeteS Well-Known Member

    Joined:
    Jun 8, 2017
    Messages:
    167
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    Oregon
    cPanel Access Level:
    Root Administrator
    Thanks, @cPanelLauren

    But, just to be clean, is my understanding on the first part of my post complete and correct? (Regarding the plugin installing the daemon, and making clamscan available to users, and the necessity and use of the cron job to automate scanning of the user folders.)
     
  4. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    6,476
    Likes Received:
    506
    Trophy Points:
    263
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    The first part is correct though the user can initiate the scan through cPanel so shell isn't needed.

    You can configure users to have specific scan settings by managing the settings at WHM>>Plugins>>Configure ClamAV Scanner

    If you want automated scans you'd need to enable a cron job otherwise it'd be necessary to manually scan.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice