Skip to content

Commit c40f91e

Browse files
authored
Merge pull request #112 from siemens/siemens/feat/control_7.1.12
Fix for Control 7.1.12 issue
2 parents 585ea88 + da6b244 commit c40f91e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1310,7 +1310,7 @@ ubtu24cis_dotperm_ansiblemanaged: true
13101310
## Section 7
13111311

13121312
# 7.1.12 Ensure no files or directories without an owner and a group exist
1313-
ubtu24cis_exclude_unowned_search_path: (! -path "/run/user/*" -a ! -path "/proc/*" -a ! -path "*/containerd/*" -a ! -path "*/kubelet/pods/*" -a ! -path "*/kubelet/plugins/*" -a ! -path "/sys/fs/cgroup/memory/*" -a ! -path "/var/*/private/*")
1313+
ubtu24cis_exclude_unowned_search_path: \( ! -path "/run/user/*" -a ! -path "/proc/*" -a ! -path "*/containerd/*" -a ! -path "*/kubelet/pods/*" -a ! -path "*/kubelet/plugins/*" -a ! -path "/sys/fs/cgroup/memory/*" -a ! -path "/var/*/private/*" -a ! -path "/snap/*" \)
13141314

13151315
# Control 7.1.12
13161316
# The value of this variable specifies the owner that will be set for unowned files and directories.

tasks/section_7/cis_7.1.x.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
warn_control_id: '7.1.12'
221221
block:
222222
- name: "7.1.12 | AUDIT | Ensure no files or directories without an owner and a group exist | Get list files or directories"
223-
ansible.builtin.command: find {{ ubtu24cis_exclude_unowned_search_path }} {{ item.mount }} -xdev \( -nouser -o -nogroup \) -not -fstype nfs
223+
ansible.builtin.command: find {{ item.mount }} -xdev {{ ubtu24cis_exclude_unowned_search_path }} \( -nouser -o -nogroup \) -not -fstype nfs
224224
changed_when: false
225225
failed_when: false
226226
check_mode: false
@@ -251,9 +251,9 @@
251251
ansible.builtin.file:
252252
path: "{{ item }}"
253253
owner: "{{ ubtu24cis_unowned_owner }}"
254-
group: "{{ ubtu24cis_unowned_group }}"
254+
group: "{{ ubtu24cis_ungrouped_group }}"
255255
with_items:
256-
- "{{ udiscovered_unowned_files_flatten }}"
256+
- "{{ discovered_unowned_files_flatten }}"
257257

258258
- name: "7.1.12 | AUDIT | Ensure no files or directories without an owner and a group exist | Warn Count"
259259
when:

0 commit comments

Comments
 (0)