I'd certainly be vaguely concerned about it.
Installing clamav-daemon, clamav-freshclam, python-pyclamd etc. should
be a straightforward "aptitude install" operation on debian at least.
I'm presently using clamav via pyclamd to scan uploaded docs in django
via a forms.FileField subclass, something along the lines of the example
below:
from django.forms import fields
import pyclamd
from pyclamd import ScanError
# really this should be a setting, and of course allow network_socket
pyclamd.init_unix_socket(filename='/var/run/clamav/clamd.ctl')
class VirusScannedFileField(forms.FileField):
default_error_messages = {
'virus_found': u"Warning! Warning! Uploaded File may contain a
VIRUS! %(virus_detail)s",
'virus_commerr': u"Failed to contact virus scanner. Please try
again later.",
}
def clean(self, data, initial=None):
"""
Uses pyclamd to virus check an uploaded file
"""
f = super(VirusScannedFileField, self).clean(data, initial)
if f is None:
return None
elif not data and initial:
return initial
# We might have a path or we might
# have to read the data into memory
# FIXME: use scan_file and scan_stream as appropriate
if hasattr(data, 'temporary_file_path'):
buf = file(data.temporary_file_path(),'rb').read()
else:
if hasattr(data, 'read'):
buf = data.read()
else:
buf = data['content']
try:
ret = pyclamd.scan_stream(buf)
if ret:
raise
fields.ValidationError(self.error_messages['virus_found'] %
{'virus_detail': ', '.join([i for i in ret.itervalues()])})
except ScanError, e:
raise
fields.ValidationError(self.error_messages['virus_commerr'])
if hasattr(f, 'seek') and callable(f.seek):
f.seek(0)
return f