Skip to content

Commit 0bd41ce

Browse files
andypitcherafdesk
authored andcommitted
Fix audit and remediation for CIS-1.9 master 1.1.13/1.1.14 (aquasecurity#1649)
* Fix audit and remediation for CIS-1.9 master 1.1.13/1.1.14 * Fix loop syntax for file paths --------- Co-authored-by: afdesk <[email protected]>
1 parent 5eed101 commit 0bd41ce

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: cfg/cis-1.9/master.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ groups:
189189
- id: 1.1.13
190190
text: "Ensure that the default administrative credential file permissions are set to 600 (Automated)"
191191
audit: |
192-
for adminconf in /etc/kubernetes/{admin.conf,super-admin.conf}; do if test -e $adminconf; then stat -c \"permissions=%a %n\" $adminconf; fi; done
192+
for adminconf in /etc/kubernetes/admin.conf /etc/kubernetes/super-admin.conf; do if test -e $adminconf; then stat -c "permissions=%a %n" $adminconf; fi; done
193193
use_multiple_values: true
194194
tests:
195195
test_items:
@@ -207,7 +207,7 @@ groups:
207207
- id: 1.1.14
208208
text: "Ensure that the default administrative credential file ownership is set to root:root (Automated)"
209209
audit: |
210-
for adminconf in /tmp/{admin.conf,super-admin.conf}; do if test -e $adminconf; then stat -c "ownership=%U:%G %n" $adminconf; fi; done
210+
for adminconf in /etc/kubernetes/admin.conf /etc/kubernetes/super-admin.conf; do if test -e $adminconf; then stat -c "ownership=%U:%G %n" $adminconf; fi; done
211211
use_multiple_values: true
212212
tests:
213213
test_items:
@@ -219,7 +219,7 @@ groups:
219219
Run the below command (based on the file location on your system) on the control plane node.
220220
For example, chown root:root /etc/kubernetes/admin.conf
221221
On Kubernetes 1.29+ the super-admin.conf file should also be modified, if present.
222-
For example, chmod 600 /etc/kubernetes/super-admin.conf
222+
For example, chown root:root /etc/kubernetes/super-admin.conf
223223
scored: true
224224

225225
- id: 1.1.15

0 commit comments

Comments
 (0)