mirror of
https://github.com/ansible-lockdown/RHEL9-CIS.git
synced 2025-12-24 22:23:06 +00:00
55 lines
1.9 KiB
YAML
55 lines
1.9 KiB
YAML
---
|
|
|
|
# Skips if mount is absent
|
|
- name: "1.1.8.1 | AUDIT | Ensure /dev/shm is a separate partition"
|
|
block:
|
|
- name: "1.1.8.1 | AUDIT | Ensure /dev/shm is a separate partition | check exists"
|
|
ansible.builtin.shell: mount -l | grep -w /dev/shm
|
|
changed_when: false
|
|
register: rhel9cis_1_8_1_1_mount_check
|
|
|
|
- name: "1.1.8.1 | AUDIT | Ensure /dev/shm is a separate partition"
|
|
block:
|
|
- name: "1.1.8.1 | AUDIT | Ensure /dev/shm is a separate partition | Absent"
|
|
ansible.builtin.debug:
|
|
msg: "Warning!! {{ required_mount }} doesn't exist. This is a manual task"
|
|
|
|
- name: "1.1.8.1 | AUDIT | Ensure separate partition exists for /home | Present"
|
|
ansible.builtin.import_tasks:
|
|
file: warning_facts.yml
|
|
when: rhel9cis_1_8_1_1_mount_check.rc == 1
|
|
|
|
vars:
|
|
warn_control_id: '1.1.8.1'
|
|
when:
|
|
- rhel9cis_rule_1_1_8_1
|
|
tags:
|
|
- level1-server
|
|
- level1-workstation
|
|
- audit
|
|
- mounts
|
|
- rule_1.1.8.1
|
|
|
|
- name: |
|
|
"1.1.8.2 | PATCH | Ensure nodev option set on /dev/shm partition | Set nodev option
|
|
1.1.8.3 | PATCH | Ensure noexec option set on /dev/shm partition | Set nosuid option
|
|
1.1.8.4 | PATCH | Ensure nosuid option set on /dev/shm partition | Set noexec option"
|
|
ansible.posix.mount:
|
|
name: /dev/shm
|
|
src: tmpfs
|
|
fstype: tmpfs
|
|
state: mounted
|
|
opts: defaults,{% if rhel9cis_rule_1_1_8_2 %}nodev,{% endif %}{% if rhel9cis_rule_1_1_8_3 %}noexec,{% endif %}{% if rhel9cis_rule_1_1_8_4 %}nosuid{% endif %}
|
|
notify: Change_requires_reboot
|
|
when:
|
|
- rhel9cis_rule_1_1_8_2 or
|
|
rhel9cis_rule_1_1_8_3 or
|
|
rhel9cis_rule_1_1_8_4
|
|
tags:
|
|
- level1-server
|
|
- level1-workstation
|
|
- patch
|
|
- mounts
|
|
- rule_1.1.8.2
|
|
- rule_1.1.8.3
|
|
- rule_1.1.8.4
|