109 lines
5.2 KiB
ObjectPascal
109 lines
5.2 KiB
ObjectPascal
## confdroid_clamav::params.pp
|
|
# Module name: confdroid_clamav
|
|
# Author: 12ww1160 (12ww1160@confdroid.com)
|
|
# @summary Class holds all parameters for the confdroid_clamav module and is
|
|
# inherited by all classes except defines.
|
|
# @param [Array] cv_reqpackages List of packages to install.
|
|
# @param [String] cv_pkg_ensure
|
|
# which [package type](https://confdroid.com/2017/05/puppet-type-package/)
|
|
# to choose, i.e. `latest` or `present`.
|
|
# @param [String] cv_logfile where to log messages for the clamd service.
|
|
# @param [String] cv_logfileunlock whether log file should be locked for
|
|
# writing -the lock protects against running clamd multiple times
|
|
# @param [String] cv_logfilemaxsize the max size for the logfile. This also
|
|
# enables logrotation.
|
|
# @param [String] cv_logtime Whether to log the time with each message.
|
|
# @param [String] cv_logclean whether to log clean files. Useful in debugging
|
|
# but drastically increases the log size.
|
|
# @param [String] cv_logsyslog Use system logger (can work together with
|
|
# LogFile).
|
|
# @param [String] cv_logfacility type of syslog messages - please refer to
|
|
# 'man syslog'for facility names
|
|
# @param [String] cv_logverbose Whether to log verbose.
|
|
# @param [String] cv_logrotate whether to enable log rotation. Always enabled
|
|
# when LogFileMaxSize is enabled.
|
|
# @param [String] cv_preludeenable whether to enable prelude output.
|
|
# @param [String] cv_preludeanalyzername name of the analyzer used by
|
|
# prelude-admin.
|
|
# @param [String] cv_tcpsocket socket port
|
|
# @param [String] cv_tcpaddress ip address to listen on
|
|
# @param [String] cv_alert_email email address to send alerts
|
|
# @param [String] cv_cron_hour which hour the scan should start
|
|
# @param [String] cv_cron_minute which minute the scan should start
|
|
# @param [String] cv_cron_user which user should run the cron job
|
|
# @param [String] cv_scan_dir which directory should be scanned
|
|
# @param [String] cv_alert_file location and name of the alert file
|
|
# @param [Boolean] cv_enable_freshclam whether to enable the freshclam service
|
|
# @param [Boolean] cv_enable_clamd whether to enable the clamd service
|
|
# @param [Boolean] cv_use_excludepaths whether to use advanced exclude paths
|
|
# @param [String] cv_concurrentdatabasereload whether to enable concurrent
|
|
# database reloads. This is useful when you have multiple clamd instances
|
|
# running on the same machine. If you have only one clamd instance, this
|
|
# should be set to 'no'.
|
|
# @param [String] cv_clamd_max_mem maximum memory usage for clamd.
|
|
# @param [String] cv_clamd_cpu_quota maximum CPU usage for clamd.
|
|
# @param [String] cv_nice_value nice value for clamd. This is a number between
|
|
# -20 and 19. The lower the number, the higher the priority. The default is
|
|
# 19, which is the lowest priority.
|
|
# @param [String] cv_timeout_start_sec timeout for starting the clamd service.
|
|
##############################################################################
|
|
class confdroid_clamav::params (
|
|
|
|
# installation
|
|
Array $cv_reqpackages = ['clamav','clamd','s-nail'],
|
|
String $cv_pkg_ensure = 'present',
|
|
|
|
# clamd
|
|
String $cv_logfile = '/var/log/clamd.scan',
|
|
String $cv_logfileunlock = 'no',
|
|
String $cv_logfilemaxsize = '2M',
|
|
String $cv_logtime = 'yes',
|
|
String $cv_logclean = 'no',
|
|
String $cv_logsyslog = 'yes',
|
|
String $cv_logfacility = 'LOG_MAIL',
|
|
String $cv_logverbose = 'no',
|
|
String $cv_logrotate = 'yes',
|
|
String $cv_preludeenable = 'no',
|
|
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',
|
|
Boolean $cv_enable_freshclam = true,
|
|
Boolean $cv_enable_clamd = true,
|
|
Boolean $cv_use_excludepaths = true,
|
|
String $cv_concurrentdatabasereload = 'no',
|
|
String $cv_clamd_max_mem = '512M',
|
|
String $cv_clamd_cpu_quota = '30%',
|
|
String $cv_nice_value = '19',
|
|
String $cv_timeout_start_sec = '420'
|
|
|
|
) {
|
|
# service
|
|
$cv_service = 'clamd@scan'
|
|
$cv_freshclam = 'freshclam'
|
|
|
|
# dirs
|
|
$cv_config_d_dir = '/etc/clamd.d'
|
|
|
|
# files
|
|
$cv_clamd_config_file = "${cv_config_d_dir}/scan.conf"
|
|
$cv_clamd_config_erb = 'confdroid_clamav/scan_conf.erb'
|
|
$cv_freshclam_file = '/etc/freshclam.conf'
|
|
$cv_freshclam_erb = 'confdroid_clamav/freshclam_conf.erb'
|
|
$cv_freshclam_svc = '/usr/lib/systemd/system/freshclam.service'
|
|
$cv_freshclam_svc_erb = 'confdroid_clamav/freshclam_svc.erb'
|
|
$cv_clamd_svc = '/usr/lib/systemd/system/clamd@.service'
|
|
$cv_clamd_svc_erb = 'confdroid_clamav/clamd_svc.erb'
|
|
$cv_shell_script = "${cv_config_d_dir}/scan.sh"
|
|
$cv_shell_script_erb = 'confdroid_clamav/scan.sh.erb'
|
|
|
|
# includes must be last
|
|
|
|
include confdroid_clamav::main::config
|
|
}
|