forked from ansible-lockdown/RHEL9-CIS
section1 v2 initial
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
parent
cf4376f1f7
commit
8b58d71e4b
47 changed files with 2181 additions and 1707 deletions
54
tasks/section_1/cis_1.1.2.2.x.yml
Normal file
54
tasks/section_1/cis_1.1.2.2.x.yml
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
---
|
||||
|
||||
# Skips if mount is absent
|
||||
- name: "1.1.2.2.1 | AUDIT | Ensure /dev/shm is a separate partition"
|
||||
when:
|
||||
- rhel9cis_rule_1_1_2_2_1
|
||||
tags:
|
||||
- level1-server
|
||||
- level1-workstation
|
||||
- audit
|
||||
- mounts
|
||||
- rule_1.1.2.2.1
|
||||
vars:
|
||||
warn_control_id: '1.1.2.2.1'
|
||||
block:
|
||||
- name: "1.1.2.2.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.2.2.1 | AUDIT | Ensure /dev/shm is a separate partition"
|
||||
when: rhel9cis_1_8_1_1_mount_check.rc == 1
|
||||
block:
|
||||
- name: "1.1.2.2.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.2.2.1 | AUDIT | Ensure separate partition exists for /home | Present"
|
||||
ansible.builtin.import_tasks:
|
||||
file: warning_facts.yml
|
||||
|
||||
- name: |
|
||||
"1.1.2.2.2 | PATCH | Ensure nodev option set on /dev/shm partition
|
||||
1.1.2.2.3 | PATCH | Ensure nosuid option set on /dev/shm partition
|
||||
1.1.2.2.4 | PATCH | Ensure noexec option set on /dev/shm partition"
|
||||
when:
|
||||
- rhel9cis_rule_1_1_2_2_2 or
|
||||
rhel9cis_rule_1_1_2_2_3 or
|
||||
rhel9cis_rule_1_1_2_2_4
|
||||
tags:
|
||||
- level1-server
|
||||
- level1-workstation
|
||||
- patch
|
||||
- mounts
|
||||
- rule_1.1.2.2.2
|
||||
- rule_1.1.2.2.3
|
||||
- rule_1.1.2.2.4
|
||||
ansible.posix.mount:
|
||||
name: /dev/shm
|
||||
src: tmpfs
|
||||
fstype: tmpfs
|
||||
state: mounted
|
||||
opts: defaults,{% if rhel9cis_rule_1_1_2_2_2 %}nodev,{% endif %}{% if rhel9cis_rule_1_1_2_2_3 %}nosuid,{% endif %}{% if rhel9cis_rule_1_1_2_2_4 %}noexec{% endif %}
|
||||
notify: Change_requires_reboot
|
||||
Loading…
Add table
Add a link
Reference in a new issue