File: ansible.template

package info (click to toggle)
scap-security-guide 0.1.65-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 71,936 kB
  • sloc: xml: 179,374; sh: 69,771; python: 23,819; makefile: 23
file content (59 lines) | stat: -rw-r--r-- 2,109 bytes parent folder | download
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
# platform = multi_platform_rhel,multi_platform_fedora,multi_platform_ol,multi_platform_rhv,multi_platform_sle,multi_platform_ubuntu
# reboot = true
# strategy = restrict
# complexity = low
# disruption = low

#
# What architecture are we on?
#
- name: Set architecture for audit {{{ NAME | join(", ") }}} tasks
  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"

{{% for EXIT_CODE in ["EACCES","EPERM"] %}}
- name: Perform remediation of Audit rules for {{{ NAME | join(", ") }}} {{{ EXIT_CODE}}} for 32bit platform
  block:
    {{{ ansible_audit_augenrules_add_syscall_rule(
      action_arch_filters="-a always,exit -F arch=b32",
      other_filters="-F exit=-"~EXIT_CODE,
      auid_filters="-F auid>="~auid~" -F auid!=unset",
      syscalls=NAME,
      key="access",
      syscall_grouping=SYSCALL_GROUPING,
      )|indent(4) }}}
    {{{ ansible_audit_auditctl_add_syscall_rule(
      action_arch_filters="-a always,exit -F arch=b32",
      other_filters="-F exit=-"~EXIT_CODE,
      auid_filters="-F auid>="~auid~" -F auid!=unset",
      syscalls=NAME,
      key="access",
      syscall_grouping=SYSCALL_GROUPING,
      )|indent(4) }}}

- name: Perform remediation of Audit rules for {{{ NAME | join(", ") }}} {{{ EXIT_CODE }}} for 64bit platform
  block:
    {{{ ansible_audit_augenrules_add_syscall_rule(
      action_arch_filters="-a always,exit -F arch=b64",
      other_filters="-F exit=-"~EXIT_CODE,
      auid_filters="-F auid>="~auid~" -F auid!=unset",
      syscalls=NAME,
      key="access",
      syscall_grouping=SYSCALL_GROUPING,
      )|indent(4) }}}
    {{{ ansible_audit_auditctl_add_syscall_rule(
      action_arch_filters="-a always,exit -F arch=b64",
      other_filters="-F exit=-"~EXIT_CODE,
      auid_filters="-F auid>="~auid~" -F auid!=unset",
      syscalls=NAME,
      key="access",
      syscall_grouping=SYSCALL_GROUPING,
      )|indent(4) }}}
  when: audit_arch == "b64"
{{% endfor %}}