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
|
{{%- if product in ["almalinux9", "fedora", "ol7", "ol8", "ol9", "ol10", "rhel8", "rhel9", "rhel10", "sle12", "sle15", "slmicro5", "ubuntu2004", "ubuntu2204", "ubuntu2404"] %}}
{{%- set perm_x=" -F perm=x" %}}
{{%- endif %}}
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle,multi_platform_slmicro,multi_platform_ubuntu,multi_platform_almalinux
# reboot = false
# strategy = restrict
# complexity = low
# disruption = low
- name: Perform remediation of Audit rules for {{{ PATH }}}
block:
{{{ ansible_audit_augenrules_add_syscall_rule(
action_arch_filters="-a always,exit",
other_filters="-F path="~PATH~perm_x,
auid_filters="-F auid>="~auid~" -F auid!=unset",
syscalls=SYSCALL,
key="privileged",
syscall_grouping=SYSCALL_GROUPING,
)|indent(4) }}}
{{{ ansible_audit_auditctl_add_syscall_rule(
action_arch_filters="-a always,exit",
other_filters="-F path="~PATH~perm_x,
auid_filters="-F auid>="~auid~" -F auid!=unset",
syscalls=SYSCALL,
key="privileged",
syscall_grouping=SYSCALL_GROUPING,
)|indent(4) }}}
|