Changes

From SME Server
Jump to navigationJump to search
Line 1: Line 1:  +
{{Level|Medium}}
 +
{{Note box|Please note that there now is a contrib for adding additional signatures. Please see [[Clamav_unofficial_sigs]].}}
 +
 
==Anti Virus - Additional Signatures==
 
==Anti Virus - Additional Signatures==
 
===Introduction===
 
===Introduction===
Line 10: Line 13:     
In order to use these additional databases with your ClamAV installation you need to download them and add them to ClamAV. There is a script package from Sane Security which can be used to download and install the databases, and their addition provide 1,000's of new signatures for ClamAV to work with.
 
In order to use these additional databases with your ClamAV installation you need to download them and add them to ClamAV. There is a script package from Sane Security which can be used to download and install the databases, and their addition provide 1,000's of new signatures for ClamAV to work with.
 +
 +
{{Note box|Please be aware that these additional signatures can in rare cases contain false positives causing good emails to be caught. This has only been noticed once in 18 months for some hours though.}}
    
===Installation===
 
===Installation===
Line 21: Line 26:  
  # Copyright (C) 2009 Eric Shubert <ejs@shubes.net>
 
  # Copyright (C) 2009 Eric Shubert <ejs@shubes.net>
 
  ########################################################################
 
  ########################################################################
 +
#  8/23/12 Changed WEB_LOC to sourceforge host
 
  #  4/30/10 Amendments to install on SME Server - commented with SME
 
  #  4/30/10 Amendments to install on SME Server - commented with SME
 
  #  9/25/09 Totally refactored by Eric Shubert <ejs@shubes.net>
 
  #  9/25/09 Totally refactored by Eric Shubert <ejs@shubes.net>
 
  #  3/22/09 Originally Written by Jake Vickers <jake@qmailtoaster.com>
 
  #  3/22/09 Originally Written by Jake Vickers <jake@qmailtoaster.com>
 
  #
 
  #
  WEB_LOC=http://www.inetmsg.com/pub
+
  WEB_LOC=http://sourceforge.net/projects/unofficial-sigs/files/latest/download?source=files
 
  PKG_NAME=clamav-unofficial-sigs
 
  PKG_NAME=clamav-unofficial-sigs
 
  PKG_TGZ=$PKG_NAME.tar.gz
 
  PKG_TGZ=$PKG_NAME.tar.gz
Line 44: Line 50:  
  # remove files from previous version
 
  # remove files from previous version
 
  # SME - changed cron job from .sh to .cron, added removal of .sh script and redundant dbs
 
  # SME - changed cron job from .sh to .cron, added removal of .sh script and redundant dbs
  rm -rf       /etc/unofficial-clamav-sigs.conf \
+
  rm -rf /etc/unofficial-clamav-sigs.conf \
 
   /etc/cron.hourly/unofficial-clamav-sigs.cron \
 
   /etc/cron.hourly/unofficial-clamav-sigs.cron \
 
   /usr/unofficial-dbs \
 
   /usr/unofficial-dbs \
Line 69: Line 75:  
  echo "$me $myver - getting latest version of $PKG_NAME ..."
 
  echo "$me $myver - getting latest version of $PKG_NAME ..."
 
   
 
   
  wget -O $TEMP_DIR/$PKG_TGZ $WEB_LOC/$PKG_TGZ
+
  wget -O $TEMP_DIR/$PKG_TGZ $WEB_LOC
 
   
 
   
 
  if [ "$?" != "0" ]; then
 
  if [ "$?" != "0" ]; then
Line 119: Line 125:  
     > /etc/cron.d/$PKG_NAME-cron
 
     > /etc/cron.d/$PKG_NAME-cron
 
  # SME - added redirect stdout to null device and stderr to stdout so we only get error output from cron job
 
  # SME - added redirect stdout to null device and stderr to stdout so we only get error output from cron job
  echo -e "\n25 * * * * root /usr/sbin/$PKG_NAME.sh -c /etc/$PKG_NAME.conf >/dev/null 2>&1" \
+
  echo -e "\n25 * * * * root /usr/sbin/$PKG_NAME.sh >/dev/null 2>&1" \
 
     >>/etc/cron.d/$PKG_NAME-cron
 
     >>/etc/cron.d/$PKG_NAME-cron
 
   
 
   
Line 161: Line 167:     
  ./sanesecurity-install.sh
 
  ./sanesecurity-install.sh
 +
 +
{{Note box|The script above uses TCP 873 as its destination port when downloading signature, please ensure that this port is open when your SME server is behind the firewall.}}
    
Run the Sane Security script for the first time to download the databases and check it works
 
Run the Sane Security script for the first time to download the databases and check it works
Line 173: Line 181:  
Having installed the Sane Security package as above, it will operate as follows.
 
Having installed the Sane Security package as above, it will operate as follows.
   −
* A cron job will run every hour and instigate the ''clamav-unofficial-sigs.sh'' script
+
* A cron job (''/etc/cron.d/clamav-unofficial-sigs-cron'') will run once every hour and instigate the ''/use/sbin/clamav-unofficial-sigs.sh'' script
* The script will download the additional databases and add them to the ''/var/clamav'' directory
+
* The script will read the configuration settings in ''/etc/clamav-unofficial-sigs.conf''
 +
* The additional databases will be downloaded to ''/usr/unofficial_dbs'' and then added to the ''/var/clamav'' directory
 
* ClamAV will reload all its databases from ''/var/clamav'' every 30 minutes by default
 
* ClamAV will reload all its databases from ''/var/clamav'' every 30 minutes by default
 +
 +
All the files (apart from the cron job and downloaded databases) are in ''/opt/sanesecurity'' and soft linked to the main directories.
 +
 +
The ''sanesecurity-install.sh'' script used above can be run again if the Sane Security package of scripts etc is updated. Current version is 3.7 (April 2010). This assumes that nothing significant changes with regard to how the package needs to be installed.
 +
{{Note box|Running ''sanesecurity-install.sh'' again will download the latest Sane Security .tar.gz package and unpack/install it. This will overwrite the existing files, including ''/etc/clamav-unofficial-sigs.conf'' and any manual adjustments you may have made to the list of databases you want to be downloaded}}
 +
 +
===Documentation===
 +
Documentation including a Change Log can be found in ''/opt/sanesecurity/doc'' as well as
 +
 +
man clamav-unofficial-sigs
    
===Signature Databases===
 
===Signature Databases===
Line 185: Line 204:  
{{Note box|If removing databases from the download lists, don't forget to also delete them from ''/var/clamav'' and ''/usr/unofficial_dbs'' if they have been downloaded previously and exist}}
 
{{Note box|If removing databases from the download lists, don't forget to also delete them from ''/var/clamav'' and ''/usr/unofficial_dbs'' if they have been downloaded previously and exist}}
 
{{Note box | Adding unofficial signatures increases memory usage. To increase the ''clamd'' memory limit try setting ''MemLimit'' to a value greater than 300000000 (see [http://wiki.contribs.org/DB_Variables_Configuration#Clam_AntiVirus_.28clamav.29 here] for reference). Since clamav-0.96 and smeserver-clamav-2.0.0-8 the default ''MemLimit'' for ''clamd'' has been 600000000 and should be sufficient. }}
 
{{Note box | Adding unofficial signatures increases memory usage. To increase the ''clamd'' memory limit try setting ''MemLimit'' to a value greater than 300000000 (see [http://wiki.contribs.org/DB_Variables_Configuration#Clam_AntiVirus_.28clamav.29 here] for reference). Since clamav-0.96 and smeserver-clamav-2.0.0-8 the default ''MemLimit'' for ''clamd'' has been 600000000 and should be sufficient. }}
 +
 +
===Uninstall===
 +
Log in to a console shell as ''root''
 +
 +
Create and edit a new file. Add the following
 +
 +
rm -f /etc/cron.d/clamav-unoffical-sigs-cron
 +
rm -fr /opt/sanesecurity \
 +
  /usr/unofficial-dbs
 +
rm -f /var/log/clamav/unofficial-sigs* \
 +
  /var/clamav/*.ndb \
 +
  /var/clamav/*.ldb \
 +
  /var/clamav/*.ftm \
 +
  /var/clamav/*.hdb
 +
signal-event clamav-update
 +
 +
Save the file as ''sanesecurity-uninstall.sh''
 +
 +
chmod 755 sanesecurity-uninstall.sh
 +
 +
Now run the script. This will delete all the Sane Security package files, downloaded databases and directories
 +
 +
./sanesecurity-uninstall.sh
    
===Old Installation Notes===
 
===Old Installation Notes===
A previous installation of the Sane Security scripts was provided for SME by swerts-knudsen.dk, and the installation notes for this are reproduced below for completion. This is for version 2.4 of the scripts however, whereas the current version installed as above is 3.7 (April 2010)
+
A previous installation of the Sane Security scripts was provided for SME by [[User:Knuddi|Jesper Knudsen]] from [http://smeoptimizer.swerts-knudsen.dk/  SME Optimizer], and the installation notes for this are reproduced below for completeness. This is for version 2.4 of the scripts however, whereas the current version installed as above is 3.7 (April 2010)
    
''Installation''
 
''Installation''
Line 213: Line 255:     
See also http://forums.contribs.org/index.php/topic,45872.0.html
 
See also http://forums.contribs.org/index.php/topic,45872.0.html
 +
 +
See forum announcement of this Howto for further comments at http://forums.contribs.org/index.php/topic,45915.0.html
    
Installation script originally produced by QmailToaster Plus - see http://qtp.qmailtoaster.com
 
Installation script originally produced by QmailToaster Plus - see http://qtp.qmailtoaster.com
   −
[[Category:Howto]]
+
----
 +
[[Category:Howto]][[Category:Mail]][[Category:Administration:Content Spam Virus Blocking]][[Category:Security]]
Super Admin, Wiki & Docs Team, Bureaucrats, Interface administrators, Administrators
3,228

edits

Navigation menu