Skip to main content

More Info:

Protect tuned kernel parameters from overriding kubelet default kernel parameter values.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every worker node, check whether kubelet uses a config file and locate it:
    If you see a flag like --config=/var/lib/kubelet/config.yaml, you are using a config file (path may differ; below assumes /var/lib/kubelet/config.yaml).
  2. If using a kubelet config file, edit it to set protectKernelDefaults to true:
    If there is no protectKernelDefaults line, add it under the main kubeletConfiguration block, for example:
  3. If instead kubelet is configured only via command-line flags (no --config= flag in ps output), edit the systemd drop-in on each worker node:
    In the line that starts with KUBELET_SYSTEM_PODS_ARGS=, add or update:
    Save and exit.
  4. Reload systemd and restart kubelet on each worker node (this restarts the kubelet process and may briefly impact scheduling on that node):
  5. Verify on each worker node that kubelet is now running with protect-kernel-defaults enabled:
    If using flags, ensure the output contains --protect-kernel-defaults=true.
    If using a config file, confirm the file still has protectKernelDefaults: true:
kubectl cannot modify kubelet host-level configuration or process flags, so this finding cannot be fixed via the Kubernetes API. The correction must be made directly on each worker node by editing /var/lib/kubelet/config.yaml or the kubelet systemd unit as described in the Manual Steps section.

Additional Reading: