Skip to main content

More Info:

Ensure that the certificate authorities file has permissions of 644 or more restrictive.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every worker node, identify the certificate authority file the kubelet is using:
  2. On every worker node, review the current permissions and ownership of the CA file:
  3. On every worker node, set the permissions of the CA file to 644 as required:
  4. (Optional but recommended) On every worker node, ensure the CA file is owned by root:
  5. On every worker node, verify the permissions are now 644 or more restrictive:
kubectl cannot modify file permissions on worker node files such as /var/lib/kubelet/config.yaml or the kubelet --client-ca-file path; this must be fixed directly on every worker node via host-level access (SSH or similar). Refer to the Manual Steps section for the exact commands to correct the certificate authorities file permissions.
Usage:
  • Run on every worker node, for example:
This script:
  • Detects the kubelet --client-ca-file (or defaults to /etc/kubernetes/pki/ca.crt).
  • Sets permissions to 644 only if they are currently less restrictive than 644.
  • Re-runs a verification similar to the audit command and prints the resulting permissions.

Additional Reading: