|
2723 | 2723 | - name: "MEDIUM | RHEL-08-010830 | PATCH | RHEL 8 must not allow users to override SSH environment variables." |
2724 | 2724 | ansible.builtin.lineinfile: |
2725 | 2725 | path: /etc/ssh/sshd_config |
2726 | | - regexp: '(?i)^#?PermitUserEnvironment' |
| 2726 | + regexp: (?i)^\s*PermitUserEnvironment |
2727 | 2727 | line: 'PermitUserEnvironment no' |
2728 | 2728 | validate: '/usr/sbin/sshd -T -f %s' |
2729 | 2729 | notify: restart sshd |
|
3286 | 3286 | line: "{{ item.line }}" |
3287 | 3287 | loop: |
3288 | 3288 | - { 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" } |
3290 | 3290 | notify: Restart_systemdlogin |
3291 | 3291 | when: |
3292 | 3292 | - rhel_08_020035 |
|
6161 | 6161 | "MEDIUM | RHEL-08-040120 | PATCH | RHEL 8 must mount /dev/shm with the nodev option." |
6162 | 6162 | "MEDIUM | RHEL-08-040121 | PATCH | RHEL 8 must mount /dev/shm with the nosuid option." |
6163 | 6163 | "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', '') }}" |
6188 | 6170 | when: |
6189 | 6171 | - rhel_08_040120 or |
6190 | 6172 | rhel_08_040121 or |
|
0 commit comments