2022-03-30 11:02:30 +01:00
---
- name : "1.1.6.1 | AUDIT | Ensure separate partition exists for /var/log/audit"
block :
- name : "1.1.6.1 | AUDIT | Ensure separate partition exists for /var/log/audit | Absent"
2023-01-09 16:29:47 +00:00
ansible.builtin.debug :
2022-07-20 17:13:33 +01:00
msg : "Warning!! {{ required_mount }} doesn't exist. This is a manual task"
2022-03-30 11:02:30 +01:00
- name : "1.1.6.1 | AUDIT | Ensure separate partition exists for /var/log/audit | Present"
2023-09-21 15:07:52 +01:00
ansible.builtin.import_tasks :
2023-09-21 15:35:35 +01:00
file : warning_facts.yml
2023-01-13 11:05:25 +00:00
2022-03-30 11:02:30 +01:00
vars :
2023-01-13 12:10:18 +00:00
warn_control_id : '1.1.6.1'
required_mount : '/var/log/audit'
2022-03-30 11:02:30 +01:00
when :
2023-01-13 11:05:25 +00:00
- required_mount not in mount_names
2022-03-30 11:22:30 +01:00
- rhel9cis_rule_1_1_6_1
2022-03-30 11:02:30 +01:00
tags :
- level2-server
- level2-workstation
- audit
- mounts
- rule_1.1.6.1
- name : |
"1.1.6.2 | PATCH | Ensure noexec option set on /var/log/audit partition"
"1.1.6.3 | PATCH | Ensure nodev option set on /var/log/audit partition"
"1.1.6.4 | PATCH | Ensure nosuid option set on /var/log/audit partition"
2023-01-09 16:29:47 +00:00
ansible.builtin.mount :
2022-03-30 11:02:30 +01:00
name : /var/log/audit
src : "{{ item.device }}"
fstype : "{{ item.fstype }}"
state : present
2024-11-11 15:43:44 +00:00
opts : "{{ item.options }}{% if ('noexec' not in item.options and rhel9cis_rule_1_1_6_2) %},noexec{% endif %}{% if ('nodev' not in item.options and rhel9cis_rule_1_1_6_3) %},nodev{% endif %}{% if ('nosuid' not in item.options and rhel9cis_rule_1_1_6_4) %},nosuid{% endif %}"
2023-09-06 08:44:23 +01:00
loop : "{{ ansible_facts.mounts }}"
2022-03-30 11:02:30 +01:00
loop_control :
label : "{{ item.device }}"
2023-01-13 12:10:18 +00:00
notify : Change_requires_reboot
2022-03-30 11:02:30 +01:00
when :
- item.mount == "/var/log/audit"
2022-03-30 11:22:30 +01:00
- rhel9cis_rule_1_1_6_2 or
rhel9cis_rule_1_1_6_3 or
rhel9cis_rule_1_1_6_4
2022-03-30 11:02:30 +01:00
tags :
- level1-server
- level1-workstation
- patch
- mounts
- rule_1.1.6.2
- rule_1.1.6.3
2022-09-16 11:10:31 +01:00
- rule_1.1.6.4