Skip to main content

More Info:

Ensure that the kubelet service 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 service file:
  2. On every worker node, set the permissions to 644 (owner read/write, group read, others read):
  3. (Optional but recommended) Confirm ownership is root:root to avoid unexpected access:
  4. On every worker node, reload systemd so it recognizes any unit file permission/metadata changes:
  5. Verify the permissions are now compliant on every worker node:
    The output must show:
kubectl cannot modify host-level systemd unit files such as /etc/systemd/system/kubelet.service.d/10-kubeadm.conf on worker nodes. To remediate this finding, you must change file permissions directly on each worker node over SSH; see the Manual Steps section for the exact commands.
Usage:
  • Copy this script to a file, e.g. /usr/local/sbin/fix-kubelet-perms.sh.
  • Make it executable:
  • Run on every worker node:

Additional Reading: