-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: Correct test cases and audit commands for rh-1.8, cis-1.11, gke-1.8.0, and eks-1.7.0 benchmarks #1988
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
base: main
Are you sure you want to change the base?
Conversation
|
Hi @afdesk @mozillazg , Could you please review this PR when you get a chance? |
| - id: 4.1.7 | ||
| text: "Cluster Access Manager API to streamline and enhance the management of access controls within EKS clusters (Manual)" | ||
| text: "Cluster Access Manager API to streamline and enhance the management of access controls within EKS clusters (Automated)" | ||
| type: "manual" |
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.
is this type still manual?
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.
@afdesk Yes, it means we can't audit it by running a script.
| oc exec -n openshift-multus "$POD_NAME" -- /bin/bash -c "stat -c '$i %n %U:%G' /host/etc/cni/net.d/*.conf" 2>/dev/null | ||
| oc exec -n openshift-multus $i -- /bin/bash -c "stat -c '$i %n %U:%G' /host/var/run/multus/cni/net.d/*.conf" 2>/dev/null | ||
| # Execute the stat command | ||
| oc exec -n openshift-multus "$POD_NAME" -- /bin/bash -c "stat -c '$i %n %U:%G' /host/etc/cni/net.d/*.conf" 2>/dev/null |
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 misunderstood here: what is the$i variable? could you pls clarify it?
| compare: | ||
| op: eq | ||
| value: true | ||
| - flag: "true" |
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.
flag: "true" is a loose substring check, isnt it?
| oc get clusterrolebindings -o=customcolumns=NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].kind | | ||
| grep cluster-admin | ||
| oc get clusterrolebindings -o=custom-columns="NAME:.metadata.name,ROLE:.roleRef.name,SUBJECT:.subjects[*].kind" | grep cluster-admin | ||
| #To verity that kbueadmin is removed, no results should be returned |
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.
kbueadmin -> kubeadmin
could you pls fix this typo too?
|
@amitk1sharma thanks a lot for your efforts! |
|
@mozillazg @LaibaBareera Could you pls take a look at this great job too? |
mozillazg
left a comment
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.
@amitk1sharma Thanks for your contribution! I don't have more comments. Please check the comments from @afdesk when you get a chance. Thanks!
| scored: true | ||
|
|
||
| - id: 2.2 | ||
| text: "Ensure that the --cert-file and --key-file arguments are set as appropriate (Automated)" |
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.
Good catch! Thanks!
| - id: 3.1.1 | ||
| text: "Ensure that the kubeconfig file permissions are set to 644 or more restrictive (Automated)" | ||
| audit: '/bin/sh -c ''if test -e $proxykubeconfig; then stat -c permissions=%a $proxykubeconfig; fi'' ' | ||
| audit: '/bin/sh -c ''if test -e $kubeletkubeconfig; then stat -c permissions=%a $kubeletkubeconfig; fi'' ' |
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.
Good catch!
| - id: 4.1.7 | ||
| text: "Cluster Access Manager API to streamline and enhance the management of access controls within EKS clusters (Manual)" | ||
| text: "Cluster Access Manager API to streamline and enhance the management of access controls within EKS clusters (Automated)" | ||
| type: "manual" |
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.
@afdesk Yes, it means we can't audit it by running a script.
This PR fixes several test case inconsistencies and incorrect audit commands in the benchmark YAML files for:
rh-1.8
cis-1.11
gke-1.8.0
eks-1.7.0
Changes made:
Fixed incorrect test case names and descriptions
Updated audit commands
Adjusted scored values to align with CIS standards
Improved remediation steps for clarity
Verified validation paths for OCP, GKE, and EKS consistency
Associated Issue: Fixes #1993