can be used with ClamAV antivirus software to scan attached files in a knowledgebase. This topic describes how to set up antivirus detection in , using the ClamAV open source antivirus toolkit. When implemented, the antivirus protection only scans attached files and has no effect on the rest of the operating system. For more information, see www.clamav.net.
 
There are two possible ways to implement ClamAV with :

 

If you have any other antivirus software installed, add its installation directory to the ClamAV exception list.

Installing ClamAV

  1. Download ClamAV during initial  installation, or from the following location: https://www.clamav.net/downloads
  2. Install it to a directory in your instance of , for instance at D:/Agiloft/ClamAV.
  3. Create a new directory to install updates, for instance at D:/Agiloft/ClamAV/database.
  4. Copy the example config files from the conf_examples directory to install the root directory.
  5. Make the following changes to the clamd.conf.example file:
    1. Rename the file from clamd.conf.example to clamd.conf.
    2. Comment out or delete the Example instruction.
    3. The PidFile should be at D:/Agiloft/ClamAV/clamd.pid.
    4. The LogFile should be at D:/Agiloft/ClamAV/clamd.log.
    5. The database directory should be at D:/Agiloft/ClamAV/database.
    6. The TCPSocket should be 3310.
    7. The TCPAddr should be 127.0.0.1.
  6. In the freshclam.conf.sample file, make the following changes:
    1. Rename the file from freshclam.conf.sample to freshclam.conf.
    2. Comment out or delete the Example instruction.
  7. Run freshclam.exe and update the virus database.

Setting up Virus Detection with CommandLineVirusDetector

CommandLineVirusDetector has two parameters: command line and path to temp directory where files uploaded to the  knowledgebase are stored. To add additional parameters, change the file located at D:\Agiloft\jboss\bin\ewjbossrun.bat

  1. Run JBoss AS with the following parameters:
    1. DAntiVirusUtils.virus-detector-class=com.supportwizard.utils.av.clam.CommandLineVirusDetector
    2. DCommandLineVirusDetector.command-line="D:/Agiloft/ClamAV/clamscan.exe"
    3. DCommandLineVirusDetector.temp-dir="D:/Agiloft/tmp/av"

Setting up Virus Detection with SocketVirusDetector

SocketVirusDetector has three parameters: hostport and socket timeout. To add additional parameters, change the file located at D:\Agiloft\jboss\bin\ewjbossrun.bat

  1. Run ClamAV as a service, typically D:\Agiloft\ClamAV\clamd.exe.
  2. Run JBoss AS with the following parameters:
    1. -DAntiVirusUtils.virus-detector-class=com.supportwizard.utils.av.clam.SocketVirusDetector
    2. -DSocketVirusDetector.host=127.0.0.1
    3. -DSocketVirusDetector.port=3310
    4. -DSocketVirusDetector.timeout=500

Related articles