60 lines
1.8 KiB
YAML
60 lines
1.8 KiB
YAML
---
|
|
|
|
# Skips if mount is absent
|
|
- name: "1.1.2.5.1 | AUDIT | Ensure separate partition exists for /var/tmp"
|
|
when:
|
|
- ubtu24cis_rule_1_1_2_5_1
|
|
- "'/var/tmp' not in mount_names"
|
|
tags:
|
|
- level2-server
|
|
- level2-workstation
|
|
- audit
|
|
- mounts
|
|
- rule_1.1.2.5.1
|
|
- NIST800-53R5_CM-7
|
|
vars:
|
|
warn_control_id: '1.1.2.5.1'
|
|
required_mount: '/var/tmp'
|
|
block:
|
|
- name: "1.1.2.5.1 | AUDIT | Ensure separate partition exists for /var/tmp | Warn if partition is absent"
|
|
ansible.builtin.debug:
|
|
msg: "Warning!! {{ required_mount }} doesn't exist. This is a manual task"
|
|
register: var_tmp_mount_absent
|
|
changed_when: var_tmp_mount_absent.skipped is undefined
|
|
|
|
- name: "1.1.2.5.1 | AUDIT | Ensure separate partition exists for /var/tmp | Present"
|
|
ansible.builtin.import_tasks:
|
|
file: warning_facts.yml
|
|
|
|
# skips if mount is absent
|
|
- name: |
|
|
"1.1.2.5.2 | PATCH | Ensure nodev option set on /var/tmp partition"
|
|
"1.1.2.5.3 | PATCH | Ensure nosuid option set on /var/tmp partition"
|
|
"1.1.2.5.4 | PATCH | Ensure noexec option set on /var/tmp partition"
|
|
when:
|
|
- "'/var/tmp' in mount_names"
|
|
- item.mount == "/var/tmp"
|
|
- ubtu24cis_rule_1_1_2_5_2 or
|
|
ubtu24cis_rule_1_1_2_5_3 or
|
|
ubtu24cis_rule_1_1_2_5_4
|
|
tags:
|
|
- level1-server
|
|
- level1-workstation
|
|
- patch
|
|
- mounts
|
|
- rule_1.1.2.5.2
|
|
- rule_1.1.2.5.3
|
|
- rule_1.1.2.5.4
|
|
- NIST800-53R5_AC-3
|
|
- NIST800-53R5_MP-2
|
|
notify: Set_reboot_required
|
|
ansible.posix.mount:
|
|
name: /var/tmp
|
|
src: "{{ item.device }}"
|
|
fstype: "{{ item.fstype }}"
|
|
state: present
|
|
opts: defaults,{% if ubtu24cis_rule_1_1_2_5_2 %}nodev,{% endif %}{% if ubtu24cis_rule_1_1_2_5_3 %}nosuid,{% endif %}{% if ubtu24cis_rule_1_1_2_5_4 %}noexec{% endif %}
|
|
loop: "{{ ansible_facts.mounts }}"
|
|
loop_control:
|
|
label: "{{ item.device }}"
|