2022-03-30 11:02:30 +01:00
---
- name : "1.1.7.1 | AUDIT | Ensure separate partition exists for /home"
block :
- name : "1.1.7.1 | AUDIT | Ensure separate partition exists for /home | 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.7.1 | AUDIT | Ensure separate partition exists for /home | 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-19 10:07:14 +00:00
2022-03-30 11:02:30 +01:00
vars :
2023-01-19 10:07:14 +00:00
warn_control_id : '1.1.7.1'
2022-03-30 11:02:30 +01:00
required_mount : '/home'
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_7_1
2022-03-30 11:02:30 +01:00
tags :
- level2-server
- level2-workstation
- audit
- mounts
- rule_1.1.7.1
- skip_ansible_lint
- name : |
"1.1.7.2 | PATCH | Ensure nodev option set on /home partition
2023-01-09 16:29:47 +00:00
1.1 .7 .3 | PATCH | Ensure nosuid option set on /home partition"
ansible.builtin.mount :
2022-03-30 11:02:30 +01:00
name : /home
src : "{{ item.device }}"
fstype : "{{ item.fstype }}"
state : present
2024-11-04 16:57:27 +00:00
opts : "{{ item.options }}{% if ('nodev' not in item.options and rhel9cis_rule_1_1_7_2) %},nodev{% endif %}{% if ('nosuid' not in item.options and rhel9cis_rule_1_1_7_3) %},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 == "/home"
2022-03-30 11:22:30 +01:00
- rhel9cis_rule_1_1_7_2 or
2023-01-09 16:29:47 +00:00
rhel9cis_rule_1_1_7_3
2022-03-30 11:02:30 +01:00
tags :
- level1-server
- level1-workstation
- patch
- mounts
- rule_1.1.7.2
- rule_1.1.7.3
- skip_ansible_lint