mirror of
https://github.com/ansible-lockdown/RHEL9-CIS.git
synced 2025-12-24 22:23:06 +00:00
52 lines
1.8 KiB
YAML
52 lines
1.8 KiB
YAML
---
|
|
|
|
- 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"
|
|
ansible.builtin.debug:
|
|
msg: "Warning!! {{ required_mount }} doesn't exist. This is a manual task"
|
|
|
|
- name: "1.1.6.1 | AUDIT | Ensure separate partition exists for /var/log/audit | Present"
|
|
ansible.builtin.import_tasks:
|
|
file: warning_facts.yml
|
|
|
|
vars:
|
|
warn_control_id: '1.1.6.1'
|
|
required_mount: '/var/log/audit'
|
|
when:
|
|
- required_mount not in mount_names
|
|
- rhel9cis_rule_1_1_6_1
|
|
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"
|
|
ansible.posix.mount:
|
|
name: /var/log/audit
|
|
src: "{{ item.device }}"
|
|
fstype: "{{ item.fstype }}"
|
|
state: present
|
|
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 %}"
|
|
loop: "{{ ansible_facts.mounts }}"
|
|
loop_control:
|
|
label: "{{ item.device }}"
|
|
notify: Change_requires_reboot
|
|
when:
|
|
- item.mount == "/var/log/audit"
|
|
- rhel9cis_rule_1_1_6_2 or
|
|
rhel9cis_rule_1_1_6_3 or
|
|
rhel9cis_rule_1_1_6_4
|
|
tags:
|
|
- level1-server
|
|
- level1-workstation
|
|
- patch
|
|
- mounts
|
|
- rule_1.1.6.2
|
|
- rule_1.1.6.3
|
|
- rule_1.1.6.4
|