mirror of
https://github.com/ansible-lockdown/RHEL9-CIS.git
synced 2025-12-24 14:23:05 +00:00
Merge pull request #361 from siemens/siemens/feat/rhel9_v2_fix_control_5.4.2.5
Fixing issue for Control 5.4.2.5
This commit is contained in:
commit
38916aeade
1 changed files with 16 additions and 0 deletions
|
|
@ -135,6 +135,22 @@
|
|||
ansible.builtin.set_fact:
|
||||
root_paths: "{{ discovered_root_paths.stdout }}"
|
||||
|
||||
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Check for presence of non-dirs"
|
||||
ansible.builtin.stat:
|
||||
path: "{{ item }}"
|
||||
loop: "{{ discovered_root_paths_split.stdout_lines }}"
|
||||
register: paths_stat
|
||||
|
||||
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Create dirs for some paths that are not dirs"
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.item }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 'go-w'
|
||||
loop: "{{ paths_stat.results }}"
|
||||
when: not item.stat.exists
|
||||
|
||||
- name: "5.4.2.5 | AUDIT | Ensure root PATH Integrity | Check for empty dirs"
|
||||
when: discovered_root_paths is defined
|
||||
ansible.builtin.shell: 'echo {{ root_paths }} | grep -q "::" && echo "roots path contains a empty directory (::)"'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue