Puppet Class: cis_security_hardening::auditd_cron
- Defined in:
- manifests/auditd_cron.pp
Summary
Create a cron job to search privileged commands for auditdOverview
Auditd rules can monitor privileged command use. As filesystems cn be huge and searching the relevant commands can be time consuming this cron job will create a custom fact to provide the auditd rule with appriate imput.
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'manifests/auditd_cron.pp', line 25
class cis_security_hardening::auditd_cron (
Enum['present', 'absent'] $ensure = 'present',
Array $dirs_to_include = ['/usr'],
Integer $start_time_minute = 37,
Integer $start_time_hour = 3,
Enum['0','2','4','6','8'] $cron_repeat = '0',
Stdlib::Absolutepath $output_file = '/usr/share/cis_security_hardening/data/auditd_priv_cmds.txt',
Stdlib::Absolutepath $script = '/usr/share/cis_security_hardening/bin/auditd_priv_cmds.sh',
) {
if ! empty($dirs_to_include) {
file { '/etc/cron.d/auditd_priv_commands.cron':
ensure => absent,
}
file { '/etc/cron.d/auditd_priv_commands':
ensure => stdlib::ensure($ensure, file),
content => epp("${module_name}/auditd_priv_cmds.cron.epp",
{
minute => $start_time_minute,
hour => $start_time_hour,
cron_repeat => $cron_repeat,
script => $script,
},
),
owner => 'root',
group => 'root',
mode => '0644',
}
file { $script:
ensure => stdlib::ensure($ensure, file),
content => epp("${module_name}/auditd_priv_cmds.epp",
{
output_file => $output_file,
dirs_to_include => $dirs_to_include,
},
),
owner => 'root',
group => 'root',
mode => '0700',
}
}
}
|