ClamScan Moodle Data Directories via Webmin PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Ken Task   
Friday, 29 April 2011 18:02
AddThis Social Bookmark Button
Take away: use Webmin to scan Moodledata directories.

Even in this day and age it's possible for a student or teacher to manage to acquire a virus and upload that file to Moodle.

Moodle does have the ability to use calmscan and quarantine suspect files, however, if parameters for scanning are entered in-correctly, ALL uploaded files are quarantined.

Obviously, server admin should 'get it right'.

What if one runs multiple Moodle instances … mega server admin?

Answer: Webmin

How:
In webmin create a new custom command with the following parameters.

Description:
Title: ClamScan a MoodleData Directory
Comments box: ?=1-9 ??=10-99 ???=100-999 or 3?? will scan all 300 #'d
Command: clamscan -ri /var/www/moodledata/$dir
Run as User: root check the box for "Use user's environment?"
In Parameter Name: dir
Description: Directory to scan (? ?? ??? ##?(
Bullet "Yes" under Required.

setup.png
setup


The webmin Custom Command looks like:

finished

finshed.png

And the output looks like (this example shows some viruses):

clamscan -ri /var/www/moodledata/3??

386/moddata/assignment/575/3408/What_to_do_statements.doc: W97M.Marker.KM FOUND
386/moddata/assignment/575/2680/What_to_do_statements.doc: W97M.Marker.KM FOUND
386/moddata/assignment/575/3407/What_to_do_statements-1.doc: W97M.Marker.KM FOUND
386/moddata/assignment/545/3408/Active_teachers.doc: W97M.Marker.KM FOUND
386/moddata/assignment/545/2680/take_control_of_learning.doc: W97M.Marker.KM FOUND
386/moddata/assignment/545/3407/take_control_of_learning-1.doc: W97M.Marker.KM FOUND

----------- SCAN SUMMARY -----------
Known viruses: 951401
Engine version: 0.97
Scanned directories: 2854
Scanned files: 8944
Infected files: 6
Data scanned: 1681.96 MB
Data read: 3101.36 MB (ratio 0.54:1)
Time: 243.095 sec (4 m 3 s)

If site has oodles of Moodles, adjust the command to scan:

Command used: clamscan -ri /var/www/*data/??

would scan all directories in /var/www/ ending in data and course ID numbers of 10-99.
Such a scan will be slower so one will have to wait a little longer:

----------- SCAN SUMMARY -----------
Known viruses: 951198
Engine version: 0.97
Scanned directories: 1826
Scanned files: 5599
Infected files: 0
Data scanned: 1965.62 MB
Data read: 9236.78 MB (ratio 0.21:1)
Time: 384.504 sec (6 m 24 s)

Here's a oodles of Moodles site (34 Moodle instances with 34 moodledata directories - courses 1-9).
Command used: clamscan -ri /var/www/moodlesitesdata/*/?

----------- SCAN SUMMARY -----------
Known viruses: 951197
Engine version: 0.97
Scanned directories: 825
Scanned files: 2166
Infected files: 0
Data scanned: 2224.30 MB
Data read: 13772.46 MB (ratio 0.16:1)
Time: 550.578 sec (9 m 10 s)

Your success in finding and quarantine is only as good as your last virus definitions update AND your scanner.
 
 
Total Views: 352