ClamAVPlugin
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.
Configuration
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
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.
Todo
- 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).
Demo
Plugin Info
- Set SHORTDESCRIPTION = Scan files on virusses with ClamAV before attaching them to a page.
Related Topics: TWikiPlugins,
DeveloperDocumentationCategory,
AdminDocumentationCategory,
TWikiPreferences
--
TWiki:Main.EdgarKlerks
- 11 May 2007