Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

cskarby
Copy link

@cskarby cskarby commented Aug 20, 2024

No description provided.

@CLAassistant
Copy link

CLAassistant commented Aug 20, 2024

CLA assistant check
All committers have signed the CLA.

@mozillazg
Copy link
Collaborator

Thanks for your contribution! How about #1649 ?

@winkrs
Copy link
Contributor

winkrs commented Sep 3, 2024

@cskarby FYI, this is still not working when run inside a pod using job.yaml.

@@ -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

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

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@andypitcher
Copy link
Contributor

andypitcher commented Sep 26, 2024

IMO This PR can be close, since #1649 has been merged.

@mozillazg mozillazg closed this Sep 28, 2024
@mozillazg
Copy link
Collaborator

@cskarby Thanks for your contribution! This issue was fixed via #1649 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants