Skip to content

Commit

Permalink
fix: required fixes for rke-cis 1.7 / 1.28 / 1.29 (#1792)
Browse files Browse the repository at this point in the history
  • Loading branch information
ttousai authored Feb 4, 2025
1 parent c04b700 commit 26aaeec
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
10 changes: 1 addition & 9 deletions cfg/rke-cis-1.23/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ groups:

- id: 1.1.11
text: "Ensure that the etcd data directory permissions are set to 700 or more restrictive (Automated)"
audit: stat -c %a /node/var/lib/etcd
audit: stat -c %a /var/lib/etcd
tests:
test_items:
- flag: "700"
Expand Down Expand Up @@ -959,15 +959,11 @@ groups:
text: "Ensure that the --bind-address argument is set to 127.0.0.1 (Automated)"
audit: "/bin/ps -ef | grep $controllermanagerbin | grep -v grep"
tests:
bin_op: or
test_items:
- flag: "--bind-address"
compare:
op: eq
value: "127.0.0.1"
set: true
- flag: "--bind-address"
set: false
remediation: |
Edit the Controller Manager pod specification file $controllermanagerconf
on the control plane node and ensure the correct value for the --bind-address parameter
Expand Down Expand Up @@ -996,15 +992,11 @@ groups:
text: "Ensure that the --bind-address argument is set to 127.0.0.1 (Automated)"
audit: "/bin/ps -ef | grep $schedulerbin | grep -v grep"
tests:
bin_op: or
test_items:
- flag: "--bind-address"
compare:
op: eq
value: "127.0.0.1"
set: true
- flag: "--bind-address"
set: false
remediation: |
Edit the Scheduler pod specification file $schedulerconf
on the control plane node and ensure the correct value for the --bind-address parameter
Expand Down
8 changes: 1 addition & 7 deletions cfg/rke-cis-1.24/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ groups:

- id: 1.1.11
text: "Ensure that the etcd data directory permissions are set to 700 or more restrictive (Automated)"
audit: stat -c %a /node/var/lib/etcd
audit: stat -c %a /var/lib/etcd
tests:
test_items:
- flag: "700"
Expand Down Expand Up @@ -962,15 +962,12 @@ groups:
text: "Ensure that the --bind-address argument is set to 127.0.0.1 (Automated)"
audit: "/bin/ps -ef | grep $controllermanagerbin | grep -v grep"
tests:
bin_op: or
test_items:
- flag: "--bind-address"
compare:
op: eq
value: "127.0.0.1"
set: true
- flag: "--bind-address"
set: false
remediation: |
Edit the Controller Manager pod specification file $controllermanagerconf
on the control plane node and ensure the correct value for the --bind-address parameter
Expand Down Expand Up @@ -999,15 +996,12 @@ groups:
text: "Ensure that the --bind-address argument is set to 127.0.0.1 (Automated)"
audit: "/bin/ps -ef | grep $schedulerbin | grep -v grep"
tests:
bin_op: or
test_items:
- flag: "--bind-address"
compare:
op: eq
value: "127.0.0.1"
set: true
- flag: "--bind-address"
set: false
remediation: |
Edit the Scheduler pod specification file $schedulerconf
on the control plane node and ensure the correct value for the --bind-address parameter
Expand Down
4 changes: 2 additions & 2 deletions cfg/rke-cis-1.24/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ groups:
# This is one of those properties that can only be set as a command line argument.
# To check if the property is set as expected, we need to parse the kubelet command
# instead reading the Kubelet Configuration file.
type: "manual"
type: "skip"
audit: "/bin/ps -fC $kubeletbin "
tests:
test_items:
Expand Down Expand Up @@ -410,7 +410,7 @@ groups:

- id: 4.2.12
text: "Verify that the RotateKubeletServerCertificate argument is set to true (Manual)"
type: "manual"
type: "skip"
audit: "/bin/ps -fC $kubeletbin"
audit_config: "/bin/sh -c 'if test -e $kubeletconf; then /bin/cat $kubeletconf; fi' "
tests:
Expand Down
10 changes: 3 additions & 7 deletions cfg/rke-cis-1.7/master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ groups:

- id: 1.1.11
text: "Ensure that the etcd data directory permissions are set to 700 or more restrictive (Automated)"
audit: stat -c %a /node/var/lib/etcd
audit: stat -c %a /var/lib/etcd
tests:
test_items:
- flag: "700"
Expand Down Expand Up @@ -949,14 +949,12 @@ groups:
text: "Ensure that the --bind-address argument is set to 127.0.0.1 (Automated)"
audit: "/bin/ps -ef | grep $controllermanagerbin | grep -v grep"
tests:
bin_op: or
test_items:
- flag: "--bind-address"
compare:
op: eq
value: "127.0.0.1"
- flag: "--bind-address"
set: false
set: true
remediation: |
Edit the Controller Manager pod specification file $controllermanagerconf
on the control plane node and ensure the correct value for the --bind-address parameter
Expand Down Expand Up @@ -984,14 +982,12 @@ groups:
text: "Ensure that the --bind-address argument is set to 127.0.0.1 (Automated)"
audit: "/bin/ps -ef | grep $schedulerbin | grep -v grep"
tests:
bin_op: or
test_items:
- flag: "--bind-address"
compare:
op: eq
value: "127.0.0.1"
- flag: "--bind-address"
set: false
set: true
remediation: |
Edit the Scheduler pod specification file $schedulerconf
on the control plane node and ensure the correct value for the --bind-address parameter
Expand Down
2 changes: 2 additions & 0 deletions cfg/rke-cis-1.7/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ groups:

- id: 4.2.8
text: "Ensure that the eventRecordQPS argument is set to a level which ensures appropriate event capture (Manual)"
type: "skip"
audit: "/bin/ps -fC $kubeletbin"
audit_config: "/bin/sh -c 'if test -e $kubeletconf; then /bin/cat $kubeletconf; fi' "
tests:
Expand Down Expand Up @@ -426,6 +427,7 @@ groups:

- id: 4.2.12
text: "Ensure that the Kubelet only makes use of Strong Cryptographic Ciphers (Automated)"
type: "skip"
audit: "/bin/ps -fC $kubeletbin"
audit_config: "/bin/sh -c 'if test -e $kubeletconf; then /bin/cat $kubeletconf; fi' "
tests:
Expand Down

0 comments on commit 26aaeec

Please sign in to comment.