Antivirus

Antivirus scanning functionality is included in Continuum CMS. This allows scanning of files using a third-party Antivirus program. Continuum CMS can use a range of third-party Antivirus programs, depending on platform and server config.

Available adapters

The following adapters are available by default. In order to use either default adapters, clamd should be installed on the server. Instructions for installation of clamd are given in the appendices.

clamd is an antivirus daemon that listens to local connections (e.g., Unix sockets) and an antivirus server that listens to network connections (e.g., TCP). The clamdscan client sends data to clamd for scanning.

ClamAV

ClamAV is the default antivirus adapter. Using this adapter, Continuum CMS will communicate with the ClamAV daemon directly on 127.0.0.1.

Constants required Description Value
ANTIVIRUS_SCANNER_ENABLED Whether to use antivirus scanning true
ANTIVIRUS_SCANNER_NAME The antivirus program to be used for scanning ClamAV
ANTIVIRUS_CLAMAV_PORT Port used for communication with ClamAV daemon. 3310

Clamdscan

When using the Clamdscan adapter, Continuum CMS will call clamdscan via PHP’s exec function. It is necessary to remove exec from the list of disabled functions in PHP on LAMP systems by editing the CMS PHP wrapper, bin/php-wrapper.

Constants required Description Value
ANTIVIRUS_CLAMDSCAN_LOCATION The location of clamdscan defined as an absolute path
ANTIVIRUS_SCANNER_NAME The antivirus program to be used for scanning Clamdscan
ANTIVIRUS_SCANNER_ENABLED Whether to use antivirus scanning true

Using antivirus in custom developments

Once Antivirus has been configured correctly, it can be used as follows:

$avScanner =  new Jadu_AntiVirus_Scanner();
$isfileClean = $avScanner->scan(‘/path/to/my/file.txt’);

Where /path/to/my/file.txt is the file to be scanned and $isFileClean is true if no virus was found. If $isFileClean is false, more information can be gained from calling:

$avScanner->getError();

results matching ""

    No results matching ""