diff --git a/cfg/rke-cis-1.24/master.yaml b/cfg/rke-cis-1.24/master.yaml index c08d6e57b..4b7dd46ee 100644 --- a/cfg/rke-cis-1.24/master.yaml +++ b/cfg/rke-cis-1.24/master.yaml @@ -272,7 +272,7 @@ groups: - id: 1.1.19 text: "Ensure that the Kubernetes PKI directory and file ownership is set to root:root (Automated)" - audit: "check_files_owner_in_dir.sh /node/etc/kubernetes/ssl" + audit : "/bin/sh -c 'if [[ $(stat -c %U:%G \"/node/etc/kubernetes/ssl\") != \"root:root" ]]; then echo \"false\"; exit; fi; for f in "/node/etc/kubernetes/ssl"/*; do if [[ $(basename "$f" .pem) == "kube-etcd-"* ]]; then if [[ $(stat -c %U:%G "$f") != \"root:root\" && $(stat -c %U:%G \"$f\") != \"etcd:etcd\" ]]; then echo \"false\"; exit; fi; else if [[ $(stat -c %U:%G "$f") != \"root:root\" ]]; then echo \"false\"; exit; fi; fi; done; echo \"true'" tests: test_items: - flag: "true"