Skip to main content

More Info:

Ensure that if the kubelet refers to a configuration file with the —config argument, that 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, check the current permissions of the kubelet config file:
  2. On every worker node, set the permissions to 644 as required:
  3. (Optional, if you want to enforce ownership as well) On every worker node, ensure root owns the file:
  4. On every worker node, verify the permissions are now compliant:
kubectl cannot modify file permissions or systemd configuration on cluster nodes, so this kubelet config file finding must be remediated directly on every worker node’s host OS. Use SSH and follow the guidance in the Manual Steps section to update /var/lib/kubelet/config.yaml permissions.
Run this script on every worker node (and any other node running kubelet):
To fan this out from a central machine with SSH access, you can use:

Additional Reading: