Skip to main content

More Info:

Do not override node hostnames.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every worker node, check for a hostname override in the running kubelet process:
  2. On every worker node, edit the kubelet systemd drop-in to remove any --hostname-override flag from KUBELET_SYSTEM_PODS_ARGS:
    • In the Environment="KUBELET_SYSTEM_PODS_ARGS=..." line, delete --hostname-override=... (and any trailing spaces).
    • Save and exit.
  3. On every worker node, confirm that no --hostname-override remains in the drop-in:
  4. On every worker node, reload systemd and restart kubelet (this will restart the kubelet and may briefly impact node status/workload scheduling):
  5. On every worker node, if /var/lib/kubelet/config.yaml is used, ensure it does not specify a hostname override (field may be absent or empty, but must not be explicitly overriding):
  6. On every worker node, verify that the running kubelet no longer has a hostname override argument:
kubectl cannot modify kubelet process flags or host-level configuration files such as /etc/systemd/system/kubelet.service.d/10-kubeadm.conf or /var/lib/kubelet/config.yaml, so this finding cannot be fixed via the Kubernetes API. To remediate, make the change directly on each worker node as described in the Manual Steps section.

Additional Reading: