More Info:
Ensure that Kubernetes PKI key files have permissions of 600.Risk Level
HighAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every control plane node, list current key files and permissions to understand scope:
-
On every control plane node, restrict permissions on all Kubernetes PKI key files:
-
On every control plane node, ensure ownership of the key files is root (adjust if needed):
-
On every control plane node, re-verify that the permissions are correctly set to 600:
Using kubectl
Using kubectl
kubectl cannot modify file permissions on control plane nodes, so it cannot be used to fix
/etc/kubernetes/pki/*.key permissions. This issue must be remediated directly on every control plane node’s filesystem; follow the guidance in the Manual Steps section to apply the required chmod 600 changes and verify them.Automation
Automation
- Run this script on every control plane node (as root), e.g.:
scp fix_pki_permissions.sh root@CONTROL_PLANE_NODE:/root/ssh root@CONTROL_PLANE_NODE "bash /root/fix_pki_permissions.sh"

