-
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
rke-cis-1.7 | Folder is wrong - should be changed to /etc/kubernetes/ssl #1746
Comments
cc @andypitcher |
Just to add context to the use of |
Hi @andypitcher , can you provide an example? |
while testing the change, the helper script check_files_owner_in_dir.sh is not founded under /go/bin, therefore this test was never worked. this is due to 3 issues:
@ttousai - can you assist with fixing it? |
Hey @guyjerby, as I mentioned this is only particular to the CIS Benchmark App inside Rancher, a dedicated pod is created to run the scans, and mounts the node's The best way would be to remove the /node as you proposed, and to use the kube-bench variables instead which would get populated by config.yaml. |
If I may add some info here, we proposed some changes for K3s/RKE2 not to use these helper_scripts anymore, see this related PR. |
Thank you very much @andypitcher , now it is clear from where the /node prefix was collected and yes - in kube-bench we have different conifguration and the host is not mounted under /node so it is not relevant. |
Thanks @andypitcher , to have a quick fix for this bug I suggest to fix the existing script while in parallel to check for the next update the use without the scrips , but I will let @ttousai to decide what works better to close this issue. looking at this check from rancher repo - it is implemented like that in a k3s check:
|
folder name on the rke master should be chanegd from: /node/etc/kubernetes/ssl to: /etc/kubernetes/ssl on the following checks:
1.1.19 =>
kube-bench/cfg/rke-cis-1.7/master.yaml
Line 303 in 6aa242e
4.1.7 =>
kube-bench/cfg/rke-cis-1.7/node.yaml
Line 101 in 6aa242e
4.1.8 =>
kube-bench/cfg/rke-cis-1.7/node.yaml
Line 115 in 6aa242e
as we can see , the files under /etc/kubernetes/ssl has root owner and this is being checked by 1.1.19:
root@ip-10-0-5-79:/etc/kubernetes/ssl# ls -l
total 108
-rwxr-xr-x 1 root root 838 Dec 5 21:26 check_files_owner_in_dir.sh
-rw------- 1 root root 1679 Dec 5 09:29 kube-apiserver-key.pem
-rw------- 1 root root 1675 Dec 5 09:29 kube-apiserver-proxy-client-key.pem
-rw------- 1 root root 1151 Dec 5 09:29 kube-apiserver-proxy-client.pem
-rw------- 1 root root 1679 Dec 5 09:29 kube-apiserver-requestheader-ca-key.pem
-rw------- 1 root root 1123 Dec 5 09:29 kube-apiserver-requestheader-ca.pem
-rw------- 1 root root 1306 Dec 5 09:29 kube-apiserver.pem
-rw------- 1 root root 1679 Dec 5 09:29 kube-ca-key.pem
-rw------- 1 root root 1058 Dec 5 09:29 kube-ca.pem
-rw------- 1 root root 1675 Dec 5 09:29 kube-controller-manager-key.pem
-rw------- 1 root root 1107 Dec 5 09:29 kube-controller-manager.pem
-rw------- 1 root root 1675 Dec 5 09:29 kube-etcd-10-0-5-79-key.pem
-rw------- 1 root root 1302 Dec 5 09:29 kube-etcd-10-0-5-79.pem
-rw------- 1 root root 1679 Dec 5 09:29 kube-node-key.pem
-rw------- 1 root root 1115 Dec 5 09:29 kube-node.pem
-rw------- 1 root root 1679 Dec 5 09:29 kube-proxy-key.pem
-rw------- 1 root root 1090 Dec 5 09:29 kube-proxy.pem
-rw------- 1 root root 1675 Dec 5 09:29 kube-scheduler-key.pem
-rw------- 1 root root 1094 Dec 5 09:29 kube-scheduler.pem
-rw------- 1 root root 1679 Dec 5 09:29 kube-service-account-token-key.pem
-rw------- 1 root root 1306 Dec 5 09:29 kube-service-account-token.pem
-rw------- 1 root root 517 Dec 5 09:29 kubecfg-kube-apiserver-proxy-client.yaml
-rw------- 1 root root 533 Dec 5 09:29 kubecfg-kube-apiserver-requestheader-ca.yaml
-rw------- 1 root root 501 Dec 5 09:29 kubecfg-kube-controller-manager.yaml
-rw------- 1 root root 445 Dec 5 09:29 kubecfg-kube-node.yaml
-rw------- 1 root root 449 Dec 5 09:29 kubecfg-kube-proxy.yaml
-rw------- 1 root root 465 Dec 5 09:29 kubecfg-kube-scheduler.yaml
root@ip-10-0-5-79:/etc/kubernetes/ssl# ./check_files_owner_in_dir.sh /etc/kubernetes/ssl/
true
root@ip-10-0-5-79:/etc/kubernetes/ssl#
The text was updated successfully, but these errors were encountered: