# platform = multi_platform_all
# reboot = false
# strategy = restrict
# complexity = low
# disruption = low

- name: "Put contents into /etc/audit/rules.d/30-ospp-v42-3-access-success.rules according to policy"
  ansible.builtin.copy:
    dest: "/etc/audit/rules.d/30-ospp-v42-3-access-success.rules"
    content: |+
        ## Successful file access (any other opens) This has to go last.
        ## These next two are likely to result in a whole lot of events
        -a always,exit -F arch=b32 -S open,openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
        -a always,exit -F arch=b64 -S openat,openat2,open_by_handle_at -F success=1 -F auid>=1000 -F auid!=unset -F key=successful-access
    force: yes

- name: Configure auditing of successful file accesses (AArch64) - Remove any permissions from group and other
  ansible.builtin.file:
    path: /etc/audit/rules.d/30-ospp-v42-3-access-success.rules
    mode: g-rwx,o-rwx
    state: touch