attachments2Add my vote for this tag automation1Add my vote for this tag security1Add my vote for this tag create new tag
, view all tags


ClamAVPlugin uses the clamav daemon to scan attachments for viruses before they are attached. This can be helpful, in case twiki is used as a catalog of software or if it is likely that users upload executables/scripts and other possible malicious data.


The following variables can be set in lib/LocalSite.cfg:

Variable value example remarks
$TWiki::cfg{Plugins}{ClamAVPlugin}{Socket} Socket of clamd /var/run/clamav/clamd.sock When nothing set, will default to /var/run/clamav/clamd.sock
$TWiki::cfg{Plugins}{ClamAVPlugin}{Host} Host of clamd clamd.example.com Should be set with Port
$TWiki::cfg{Plugins}{ClamAVPlugin}{Port} Port number of clamd 3310 Should be set with Host

If nothing set, ClamAVPlugin will default to /var/run/clamav/clamd.sock, which should be fine for most installations.

Note: $TWiki::cfg{Plugins}{ClamAVPlugin}{Port} and $TWiki::cfg{Plugins}{ClamAVPlugin}{Host} take precedence over $TWiki::cfg{Plugins}{ClamAVPlugin}{Socket}.


Example config in lib/LocalSite.cfg:

$TWiki::cfg{Plugins}{ClamAVPlugin}{Host} = 'localhost';
# Non standard port. Standard clamd port is 3310
$TWiki::cfg{Plugins}{ClamAVPlugin}{Port} = '4456';

#$TWiki::cfg{Plugins}{ClamAVPlugin}{Socket} = '/var/run/clamav/clamd.cli';

Plugin Installation Instructions

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

  • Download the ZIP file from the Plugin web (see below)
  • Unzip ClamAVPlugin.zip in your twiki installation directory. Content:
    File: Description:
    data/TWiki/ClamAVPlugin.txt Plugin topic
    data/TWiki/ClamAVPlugin.txt,v Plugin topic repository
    lib/TWiki/Plugins/ClamAVPlugin.pm Plugin Perl module
  • Configure the Plugin:
    • TWiki 4.0 and up: Run the configure script to enable the Plugin
    • Change the Plugin settings as needed
  • Test if the installation was successful:
    • Download eicar.com provided on this site and try to upload it to your site. If ClamAVPlugin is correctly installed, it will not be possible.


  • Let user decide what to do if virus is found (delete, contain, what template to show etcetera)
  • Log attempts of uploading a virus (maybe just in warndate.txt or on a seperated page).


Plugin Info

  • Set SHORTDESCRIPTION = Scan files on virusses with ClamAV before attaching them to a page.

Plugin Author: TWiki:Main.EdgarKlerks
Copyright: © 2007, TWiki:Main.EdgarKlerks
License: GPL (GNU General Public License)
Plugin Version: 11 May 2007 (V1.000)
Change History:  
11 May 2007: Fixed minor bug in configuration, made build script
11 May 2007: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: ClamAV::Client
Other Dependencies: ClamAV antivirus: see http://www.clamav.net
Perl Version: 5.8.8
Benchmarks: GoodStyle 97%, FormattedSearch 100%, ClamAVPlugin 100%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/ClamAVPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/ClamAVPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/ClamAVPluginAppraisal

Related Topics: TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

-- TWiki:Main.EdgarKlerks - 11 May 2007

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatmd5 ClamAVPlugin.md5 r3 r2 r1 manage 0.2 K 2007-05-12 - 18:26 EdgarKlerks  
Compressed Zip archivetgz ClamAVPlugin.tgz r3 r2 r1 manage 12.5 K 2007-05-12 - 18:26 EdgarKlerks  
Compressed Zip archivezip ClamAVPlugin.zip r6 r5 r4 r3 r2 manage 22.8 K 2007-05-12 - 18:26 EdgarKlerks  
Unknown file formatEXT ClamAVPlugin_installer r2 r1 manage 29.6 K 2007-05-12 - 18:26 EdgarKlerks  
Texttxt ClamAVPlugin_installer.pl.txt r3 r2 r1 manage 30.5 K 2007-05-12 - 18:27 EdgarKlerks  
Unknown file formatcom eicar.com r1 manage 0.1 K 2007-05-10 - 02:36 EdgarKlerks  
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2007-05-16 - EdgarKlerks
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2016 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.