Skip to main content

More Info:

Limit the Node and Pod objects that a kubelet could modify.

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. Confirm the apiserver manifest exists
    Run on: every control plane node
    If the file is missing, stop and investigate how the control plane is deployed.
  2. Back up the existing kube-apiserver manifest
    Run on: every control plane node
  3. Edit the kube-apiserver manifest to include NodeRestriction
    Run on: every control plane node
    Open the file:
    In the spec.containers[0].command list, locate the existing --enable-admission-plugins= entry, for example:
    Modify it so that NodeRestriction is included in the comma-separated list (do not remove existing plugins), for example:
    If there is no --enable-admission-plugins= line, add one to the command section, preserving other options:
    Save and exit.
    Operational impact: because this is a static pod manifest under /etc/kubernetes/manifests, the kubelet will automatically restart the kube-apiserver pod with the new configuration.
  4. Wait for the kube-apiserver pod to restart and become Ready
    Run on: any machine with kubectl access
    Wait until the kube-apiserver-... pod shows STATUS as Running and READY as 1/1.
  5. Verify the kube-apiserver process includes NodeRestriction in —enable-admission-plugins
    Run on: every control plane node
    Confirm the output line for kube-apiserver shows --enable-admission-plugins= with NodeRestriction present in the list, for example:
kubectl cannot configure admission plugins for the API server or edit /etc/kubernetes/manifests/kube-apiserver.yaml, because this is a host-level static pod manifest on each control plane node. Make the change directly on the control plane nodes as described in the Manual Steps section.

Additional Reading: