Puppet Class: cis_security_hardening::rules::aide_audit_integrity

Defined in:
manifests/rules/aide_audit_integrity.pp

Summary

Ensure cryptographic mechanisms are used to protect the integrity of audit tools (Automated)

Overview

Audit tools include, but are not limited to, vendor-provided and open source audit tools needed to successfully view and manipulate audit information system activity and records. Audit tools include custom queries and report generators.

Rationale: Protecting the integrity of the tools used for auditing purposes is a critical step toward ensuring the integrity of audit information. Audit information includes all information (e.g., audit records, audit settings, and audit reports) needed to successfully audit information system activity.

Attackers may replace the audit tools or inject code into the existing tools with the purpose of providing the capability to hide or erase system activity from the audit logs.

Audit tools should be cryptographically signed in order to provide the capability to identify when the audit tools have been modified, manipulated, or replaced. An example is a checksum hash of the file or files.

Examples:

class { 'cis_security_hardening::rules::aide_audit_integrity':
    enforce => true,
    tools => {
     'sbin/auditctl' => 'p+i+n+u+g+s+b+acl+xattrs+sha512'
  }
}

Parameters:

  • enforce (Boolean) (defaults to: false)

    Enforce the rule

  • tools (Hash) (defaults to: {})

    Hash with auditd tools to secure with aide



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/rules/aide_audit_integrity.pp', line 34

class cis_security_hardening::rules::aide_audit_integrity (
  Boolean $enforce = false,
  Hash $tools      = {},
) {
  if $enforce {
    require 'cis_security_hardening::rules::auditd_package'

    case $facts[ 'os']['name'].downcase() {
      'rocky': {
        $conffile = '/etc/aide.conf'
      }
      'ubuntu': {
        if $facts['os']['release']['major'] >= '20' {
          $conffile = '/etc/aide/aide.conf'
        } else {
          $conffile = '/etc/aide.conf'
        }
      }
      default: {
        $conffile = '/etc/aide.conf'
      }
    }

    $tools.each |$tool, $data| {
      file_line { "aide tool ${tool}":
        ensure             => present,
        append_on_no_match => true,
        path               => $conffile,
        line               => "${tool} ${data}",
        match              => "^${tool}",
      }
    }
  }
}