-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CIS 1.9 - Fix incorrectly failing tests 1.1.13 and 1.1.14 #1668
Conversation
Thanks for your contribution! How about #1649 ? |
@cskarby FYI, this is still not working when run inside a pod using |
@@ -189,7 +189,7 @@ groups: | |||
- id: 1.1.13 | |||
text: "Ensure that the default administrative credential file permissions are set to 600 (Automated)" | |||
audit: | | |||
for adminconf in /etc/kubernetes/{admin.conf,super-admin.conf}; do if test -e $adminconf; then stat -c \"permissions=%a %n\" $adminconf; fi; done | |||
for adminconf in /etc/kubernetes/{admin.conf,super-admin.conf}; do if test -e $adminconf; then stat -c "permissions=%a %n" $adminconf; fi; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i do not think this will work because curly brace expansion is a feature of bash and this is run with sh
Line 299 in f8b6f2f
cmd := exec.Command("/bin/sh") |
for example
ethan@ethanm-kurl-1:~$ echo 'for adminconf in /etc/kubernetes/{admin.conf,super-admin.conf}; do if test -e $adminconf; then stat -c "ownership=%U:%G %n" $adminconf; fi; done' | sh
ethan@ethanm-kurl-1:~$ echo 'for adminconf in /etc/kubernetes/{admin.conf,super-admin.conf}; do if test -e $adminconf; then stat -c "ownership=%U:%G %n" $adminconf; fi; done' | bash
ownership=root:root /etc/kubernetes/admin.conf
ownership=root:root /etc/kubernetes/super-admin.conf
@@ -207,7 +207,7 @@ groups: | |||
- id: 1.1.14 | |||
text: "Ensure that the default administrative credential file ownership is set to root:root (Automated)" | |||
audit: | | |||
for adminconf in /tmp/{admin.conf,super-admin.conf}; do if test -e $adminconf; then stat -c "ownership=%U:%G %n" $adminconf; fi; done | |||
for adminconf in /etc/kubernetes/{admin.conf,super-admin.conf}; do if test -e $adminconf; then stat -c "ownership=%U:%G %n" $adminconf; fi; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
IMO This PR can be close, since #1649 has been merged. |
No description provided.