2022-03-30 11:02:30 +01:00
---
# Skips if mount is absent
- name : "1.1.4.1 | AUDIT | Ensure separate partition exists for /var/tmp"
block :
- name : "1.1.4.1 | AUDIT | Ensure separate partition exists for /var/tmp | 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
2023-01-19 10:07:14 +00:00
- name : "1.1.4.1 | AUDIT | Ensure separate partition exists for /var/tmp | 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
2022-03-30 11:02:30 +01:00
vars :
2023-01-13 11:05:25 +00:00
warn_control_id : '1.1.4.1'
2022-03-30 11:02:30 +01:00
required_mount : '/var/tmp'
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_4_1
2022-03-30 11:02:30 +01:00
tags :
- level2-server
- level2-workstation
- audit
- mounts
- rule_1.1.4.1
# skips if mount is absent
- name : |
"1.1.4.2 | PATCH | Ensure noexec option set on /var/tmp partition"
"1.1.4.3 | PATCH | Ensure nosuid option set on /var/tmp partition"
"1.1.4.4 | PATCH | Ensure nodev option set on /var/tmp partition"
2023-01-09 16:29:47 +00:00
ansible.builtin.mount :
2022-03-30 11:02:30 +01:00
name : /var/tmp
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_4_2) %},noexec{% endif %}{% if ('nosuid' not in item.options and rhel9cis_rule_1_1_4_3) %},nosuid{% endif %}{% if ('nodev' not in item.options and rhel9cis_rule_1_1_4_4) %},nodev{% 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/tmp"
2022-03-30 11:22:30 +01:00
- rhel9cis_rule_1_1_4_2 or
rhel9cis_rule_1_1_4_3 or
rhel9cis_rule_1_1_4_4
2022-03-30 11:02:30 +01:00
tags :
- level1-server
- level1-workstation
- patch
- mounts
- skip_ansible_lint
- rule_1.1.4.2
- rule_1.1.4.3
2022-09-16 11:10:31 +01:00
- rule_1.1.4.4