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
MediumAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every worker node, verify that the kubelet config file exists and note its current permissions:
-
On every worker node, set the file permissions to 600 as required:
-
On every worker node, ensure the file is owned by root (optional hardening but commonly expected):
-
On every worker node, verify the permissions are now 600 or more restrictive:
Using kubectl
Using kubectl
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.Automation
Automation
- 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):
600, and it always prints the final stat output as verification.
