1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 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
|
# platform = multi_platform_all
# reboot = false
# complexity = low
# disruption = low
# strategy = configure
{{% if "ol" in families or 'rhel' in product or 'ubuntu' in product or 'debian' in product or 'almalinux' in product %}}
{{% set auid_filters = "-F auid>=" ~ auid ~ " -F auid!=unset" %}}
{{% else %}}
{{% set auid_filters = "" %}}
{{% endif %}}
# What architecture are we on?
- name: {{{ rule_title }}} - Set architecture for audit {{{ NAME }}} tasks
ansible.builtin.set_fact:
audit_arch: "b64"
when:
- ansible_architecture == "aarch64" or
ansible_architecture == "ppc64" or
ansible_architecture == "ppc64le" or
ansible_architecture == "s390x" or
ansible_architecture == "x86_64"
- name: {{{ rule_title }}} - Perform remediation of Audit rules for {{{ NAME }}} for 32bit platform
block:
{{{ ansible_audit_augenrules_add_syscall_rule(
action_arch_filters="-a always,exit -F arch=b32",
other_filters="",
auid_filters=auid_filters,
syscalls=NAME,
key="modules",
syscall_grouping=SYSCALL_GROUPING,
)|indent(4) }}}
{{{ ansible_audit_auditctl_add_syscall_rule(
action_arch_filters="-a always,exit -F arch=b32",
other_filters="",
auid_filters=auid_filters,
syscalls=NAME,
key="modules",
syscall_grouping=SYSCALL_GROUPING,
)|indent(4) }}}
- name: {{{ rule_title }}} - Perform remediation of Audit rules for {{{ NAME }}} for 64bit platform
block:
{{{ ansible_audit_augenrules_add_syscall_rule(
action_arch_filters="-a always,exit -F arch=b64",
other_filters="",
auid_filters=auid_filters,
syscalls=NAME,
key="modules",
syscall_grouping=SYSCALL_GROUPING,
)|indent(4) }}}
{{{ ansible_audit_auditctl_add_syscall_rule(
action_arch_filters="-a always,exit -F arch=b64",
other_filters="",
auid_filters=auid_filters,
syscalls=NAME,
key="modules",
syscall_grouping=SYSCALL_GROUPING,
)|indent(4) }}}
when: audit_arch == "b64"
|