Skip to main content

More Info:

Ensure that Kubernetes PKI key files have permissions of 600.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, list current key files and permissions to understand scope:
  2. On every control plane node, restrict permissions on all Kubernetes PKI key files:
  3. On every control plane node, ensure ownership of the key files is root (adjust if needed):
  4. On every control plane node, re-verify that the permissions are correctly set to 600:
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.
Usage:
  • 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"

Additional Reading: