clamd
daemon for virus scanning. The attachment is
only saved if the virus scan does not detect any threats.
From the description of ClamAV at http://www.clamav.net
ClamAV is an open source (GPL) antivirus engine designed for detecting Trojans, viruses, malware and other malicious threats. It is the de facto standard for mail gateway scanning. It provides a high performance mutli-threaded scanning daemon, command line utilities for on demand file scanning, and an intelligent tool for automatic signature updates. The core ClamAV library provides numerous file format detection mechanisms, file unpacking support, archive support, and multiple signature languages for detecting threats.
%CLAMAVSTATUS%
clamd
daemon. Or reports any
failure messages if unable to connect to the clamd socket. This information
is only displayed for administrators.
%CLAMAVSTATUS{}%
,v
files of an existing topic can be scanned using a rest handler. Each attachment and corresponding rcs file if it exists is passed to clamd for scanning. Results of the scan are reported back in the rest results.
There is no facility to request scan of an individual attachment. The scan is done by reading the contents of the directory. The attachment API is not used.
The rest handler takes two parameters:
Parameter | Usage | Default |
---|---|---|
topic |
The Web.Topic used as the BASEWEB.BASETOPIC. |
System default topic |
scan |
The Web.Topic name that will be subject of the attachment scan. |
topic |
PlainFileStore
, then attachment history will not be scanned.cd [Foswiki/bin] directory ./rest /ClamAVScanPlugin/scan -scan System.PatternSkin
configure
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Note: This plugin depends upon a properly configured and operational version of the clamd
daemon. Actual scans are executed by the clamd daemon. ClamAV must be local to the Foswiki system.
$Foswiki::cfg{Plugins}{ClamAVScanPlugin}{clamdPort}
clamd
daemon. Defaults to /tmp/clamd
$Foswiki::cfg{Plugins}{ClamAVScanPlugin}{mandatoryScan}
clamd
is unavailable.
$Foswiki::cfg{Plugins}{ClamAVScanPlugin}{scanTopics}
StructuredDataDetection
is enabled in clamd.conf, it will detect certain data such as social security numbers and credit card numbers in content. Default is disabled. Enable this option to perform scanning of topic data for structured data and embedded HTML threats. If a threat is detected, ClamAV will block the topic save.
$Foswiki::cfg{Plugins}{ClamAVScanPlugin}{forceFilename}
clamd.conf
setting StreamMaxLength
needs to be large enough to accommodate the largest Foswiki setting for ATTACHFILESIZELIMIT. Currently 100000 in this web, this value can be set per web.
Name | Version | Description |
---|---|---|
File::Find | >=0 | required for lib/Foswiki/Plugins/ClamAVScanPlugin/ClamAV.pm |
IO::Socket | >=0 | required for lib/Foswiki/Plugins/ClamAVScanPlugin/ClamAV.pm |
Socket::PassAccessRights | >=0 | optional passes file descriptors to clamd for access rights |
Socket::PassAccessRights
is "optional" however on most systems this module will be required for correct operation. The clamd
daemon must have full access to each scanned file. This module allows a file descriptor to be passed to clamd ensuring full access. If this module is not installed, the file name will be passed to the clamd daemon. If insufficient rights are available, the scan will fail.
(On Foswiki 1.1, scans during attachment upload will still work, as the stream is passed to clamd. On Foswiki 1.0, the temporary file name will be passed resulting in possible access rights issues.)
TRACE
constant can be enabled in lib/Foswiki/Plugins/ClamAVScanPlugin.pm
and lib/Foswiki/Plugins/ClamAVScanPlugin/ClamAV.pm
for detailed debug logging.
If ClamAV is reporting that it is unable to read the files, check several things: Socket::PassAccessRights
is installed. If not availabe,
/etc/apparmor.d/local/usr.sbin.clamd
should have a line to pemit read of attachments, such as: /var/www/foswiki/pub/** r
Change History: | |
1.2 (31 Aug 2016) | Foswikitask:Item14149 Update for Foswiki 2.0+: - Add configuration to set forceFilename scanning. - Change REST calls to require POST and validation - Support utf-8 / Unicode web, topic and attachment names. |
1.1.0 (13 June 2011) | Foswikitask:Item10835 Add backwards compatibility with Foswiki 1.0 |
1.0.1 (11 May 2011) | Foswikitask:Item10700 Initial version |
Author | GeorgeClark |
Version | 1.2 |
Release | 31 Aug 2016 |
Description | Scans attachments for viruses, malware and other threats during upload |
Copyright | © 2011-2016, George Clark, Foswiki Contributors Module Foswiki::Plugins::ClamAVScanPlugin::ClamAV is based upon the CPAN module File::Scan::ClamAV Copyright Colin Faber All Rights Reserved. Originally based on the Clamd module authored by Matt Sergeant. |
License | GPL (GNU General Public License). Foswiki::Plugins::ClamAVScanPlugin::ClamAV is licensed under the terms of Perl itself. |
Home | http://foswiki.org/Extensions/ClamAVScanPlugin |
Support | http://foswiki.org/Support/ClamAVScanPlugin |
Repository | https://github.com/foswiki/ClamAVScanPlugin |
ExtensionClassification | Admin, Data and Files, Security |
ExtensionType | PluginPackage |
Compatibility | Foswiki 1.0, 1.1 and 2.x Not tested on Windows. |
IncompatibleWith | |
ImageUrl | |
DemoUrl | http:// |
SupportUrl | ClamAVScanPlugin |
ModificationPolicy | CoordinateWithAuthor |
I | Attachment | Action | Size | Date | Who | Comment |
---|---|---|---|---|---|---|
md5 | ClamAVScanPlugin.md5 | manage | 171 bytes | 07 Sep 2016 - 00:21 | GeorgeClark | |
sha1 | ClamAVScanPlugin.sha1 | manage | 195 bytes | 07 Sep 2016 - 00:21 | GeorgeClark | |
tgz | ClamAVScanPlugin.tgz | manage | 66 K | 07 Sep 2016 - 00:20 | GeorgeClark | |
zip | ClamAVScanPlugin.zip | manage | 74 K | 07 Sep 2016 - 00:20 | GeorgeClark | |
EXT | ClamAVScanPlugin_installer | manage | 5 K | 07 Sep 2016 - 00:20 | GeorgeClark |