diff --git a/doc/puppet_classes/clamav_cd_3A_3Amain_3A_3Aconfig.html b/doc/puppet_classes/clamav_cd_3A_3Amain_3A_3Aconfig.html index 8be44a4..fbb6680 100644 --- a/doc/puppet_classes/clamav_cd_3A_3Amain_3A_3Aconfig.html +++ b/doc/puppet_classes/clamav_cd_3A_3Amain_3A_3Aconfig.html @@ -113,7 +113,15 @@ clamav_cd. 15 16 17 -18 +18 +19 +20 +21 +22 +23 +24 +25 +26
# File 'manifests/main/config.pp', line 7
@@ -129,6 +137,14 @@ class clamav_cd::main::config (
unless => '/usr/sbin/getsebool antivirus_can_scan_system | grep --quiet "on"',
path => ['/usr/sbin', '/bin'],
}
+
+ # create a cron job to run a daily scan
+ cron { 'clamscan':
+ command => $cv_shell_script,
+ user => $cv_cron_user,
+ hour => $cv_cron_hour,
+ minute => $cv_cron_minute,
+ }
}
# File 'manifests/main/files.pp', line 6
@@ -194,6 +207,19 @@ class clamav_cd::main::files (
seluser => system_u,
content => template($cv_freshclam_svc_erb),
}
+
+ # shell script for scanning and alerting
+ file { $cv_shell_script :
+ ensure => file,
+ owner => 'root',
+ group => 'root',
+ mode => '0750',
+ selrange => s0,
+ selrole => object_r,
+ seltype => etc_t,
+ seluser => system_u,
+ content => template($cv_shell_script_erb),
+ }
}
ip address to listen on
+email address to send alerts
+which hour the scan should start
+which minute the scan should start
+which user should run the cron job
+which directory should be scanned
+location and name of the alert file
-31 -32 -33 -34 -35 -36 37 38 39 @@ -428,15 +530,30 @@ inherited by all classes except defines. 68 69 70 -71+71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86
# File 'manifests/params.pp', line 31
+ # File 'manifests/params.pp', line 37
class clamav_cd::params (
# installation
- Array $reqpackages = ['clamav','clamd'],
+ Array $reqpackages = ['clamav','clamd','s-nail'],
String $pkg_ensure = 'present',
# clamd
@@ -453,6 +570,13 @@ class clamav_cd::params (
String $cv_preludeanalyzername = 'ClamAV',
String $cv_tcpsocket = '3310',
String $cv_tcpaddress = 'localhost',
+ String $cv_alert_email = 'you@example.com',
+ String $cv_cron_hour = '2',
+ String $cv_cron_minute = '0',
+ String $cv_cron_user = 'root',
+ String $cv_scan_dir = '/',
+ String $cv_alert_file = 'tmp/clamav-alert.txt',
+
) {
# service
@@ -469,6 +593,8 @@ class clamav_cd::params (
$cv_freshclam_erb = 'clamav_cd/freshclam_conf.erb'
$cv_freshclam_svc = '/usr/lib/systemd/system/freshclam.service'
$cv_freshclam_svc_erb = 'clamav_cd/freshclam_svc.erb'
+ $cv_shell_script = "${cv_config_d_dir}/scan.sh"
+ $cv_shell_script_erb = 'clamav_cd/scan.sh.erb'
# includes must be last