Skip to main content

More Info:

Ensure that the kubelet service file ownership is set to root:root.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every worker node, confirm the kubelet drop-in file exists and see its current ownership:
    If you see No such file or directory, this check is not applicable on that node.
  2. On every worker node where the file exists, change its ownership to root:root:
  3. (Optional but recommended) Reload systemd metadata on every worker node so it sees any permission changes:
  4. Verify on every worker node that the ownership is now correctly set to root:root:
    The command must output:
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 ownership directly on each worker node’s OS; see the Manual Steps section for the exact commands.
Usage:
  1. Copy this script to each worker node, e.g. /root/fix-kubelet-ownership.sh.
  2. On each worker node, run:
  3. Optionally, re-run the audit command on each worker node:

Additional Reading: