Skip to content

Commit 50b9b2c

Browse files
authored
Merge pull request #329 from ansible-lockdown/Feb25
Feb25
2 parents 1cee54d + e792e99 commit 50b9b2c

File tree

1 file changed

+8
-26
lines changed

1 file changed

+8
-26
lines changed

tasks/fix-cat2.yml

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,7 +2723,7 @@
27232723
- name: "MEDIUM | RHEL-08-010830 | PATCH | RHEL 8 must not allow users to override SSH environment variables."
27242724
ansible.builtin.lineinfile:
27252725
path: /etc/ssh/sshd_config
2726-
regexp: '(?i)^#?PermitUserEnvironment'
2726+
regexp: (?i)^\s*PermitUserEnvironment
27272727
line: 'PermitUserEnvironment no'
27282728
validate: '/usr/sbin/sshd -T -f %s'
27292729
notify: restart sshd
@@ -3286,7 +3286,7 @@
32863286
line: "{{ item.line }}"
32873287
loop:
32883288
- { regexp: '^(?#)\s*StopIdleSessionSec\s*=', line: "StopIdleSessionSec={{ rhel_08_020035_idlesessiontimeout }}" }
3289-
- { regexp: '^(?#)\s*KillUserProccesses\s*=', line: "KillUserProccesses=no" }
3289+
- { regexp: '^(?#)\s*KillUserProcesses\s*=', line: "KillUserProcesses=no" }
32903290
notify: Restart_systemdlogin
32913291
when:
32923292
- rhel_08_020035
@@ -6161,30 +6161,12 @@
61616161
"MEDIUM | RHEL-08-040120 | PATCH | RHEL 8 must mount /dev/shm with the nodev option."
61626162
"MEDIUM | RHEL-08-040121 | PATCH | RHEL 8 must mount /dev/shm with the nosuid option."
61636163
"MEDIUM | RHEL-08-040122 | PATCH | RHEL 8 must mount /dev/shm with the noexec option."
6164-
block:
6165-
- name: |
6166-
"MEDIUM | RHEL-08-040120 | AUDIT | RHEL 8 must mount /dev/shm with the nodev option."
6167-
"MEDIUM | RHEL-08-040121 | AUDIT | RHEL 8 must mount /dev/shm with the nosuid option."
6168-
"MEDIUM | RHEL-08-040122 | AUDIT | RHEL 8 must mount /dev/shm with the noexec option."
6169-
ansible.builtin.shell: mount | grep /dev/shm
6170-
changed_when: false
6171-
failed_when: false
6172-
register: rhel8stig_040120_dev_shm_status
6173-
6174-
- name: |
6175-
"MEDIUM | RHEL-08-040120 | PATCH | RHEL 8 must mount /dev/shm with the nodev option."
6176-
"MEDIUM | RHEL-08-040121 | PATCH | RHEL 8 must mount /dev/shm with the nosuid option."
6177-
"MEDIUM | RHEL-08-040122 | PATCH | RHEL 8 must mount /dev/shm with the noexec option."
6178-
ansible.posix.mount:
6179-
path: "{{ item.mount }}"
6180-
state: mounted
6181-
src: "{{ item.device }}"
6182-
fstype: "{{ item.fstype }}"
6183-
opts: "defaults{{ rhel_08_040120 | ternary (',nodev', '') }}{{ rhel_08_040121 | ternary (',nosuid', '') }}{{ rhel_08_040122 | ternary (',noexec', '') }}"
6184-
loop: "{{ ansible_facts.mounts }}"
6185-
when:
6186-
- item.mount == '/dev/shm'
6187-
- rhel8stig_040120_dev_shm_status.stdout | length > 0
6164+
ansible.posix.mount:
6165+
path: /dev/shm
6166+
state: mounted
6167+
src: tmpfs
6168+
fstype: tmpfs
6169+
opts: "defaults{{ rhel_08_040120 | ternary (',nodev', '') }}{{ rhel_08_040121 | ternary (',nosuid', '') }}{{ rhel_08_040122 | ternary (',noexec', '') }}"
61886170
when:
61896171
- rhel_08_040120 or
61906172
rhel_08_040121 or

0 commit comments

Comments
 (0)