Skip to main content

More Info:

When a kubelet config.yaml file is in use it defines the kubelets security settings and should be protected from modification. Permissions of 600 or more restrictive keep it readable only by root.

Risk Level

Medium

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every worker node, verify that the kubelet config file exists and note its current permissions:
  2. On every worker node, set the file permissions to 600 as required:
  3. On every worker node, ensure the file is owned by root (optional hardening but commonly expected):
  4. On every worker node, verify the permissions are now 600 or more restrictive:
kubectl cannot modify host-level file permissions such as /var/lib/kubelet/config.yaml on worker nodes. This fix must be performed directly on every worker node (for example over SSH); see the Manual Steps section for the exact commands to run.
Usage:
  • Copy this script to a file, for example on any machine with SSH access to the nodes:
    • /tmp/fix-kubelet-config-perms.sh
  • Distribute and run it on every worker node (and any other node that may run a kubelet):
The script is idempotent: re-running it will only change permissions if they are not already 600, and it always prints the final stat output as verification.