More Info:
Limit the Node and Pod objects that a kubelet could modify.Risk Level
LowAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Confirm the apiserver manifest exists
Run on: every control plane nodeIf the file is missing, stop and investigate how the control plane is deployed. -
Back up the existing kube-apiserver manifest
Run on: every control plane node -
Edit the kube-apiserver manifest to include NodeRestriction
Run on: every control plane node
Open the file:In thespec.containers[0].commandlist, locate the existing--enable-admission-plugins=entry, for example:Modify it so thatNodeRestrictionis included in the comma-separated list (do not remove existing plugins), for example:If there is no--enable-admission-plugins=line, add one to thecommandsection, preserving other options:Save and exit.
Operational impact: because this is a static pod manifest under/etc/kubernetes/manifests, the kubelet will automatically restart thekube-apiserverpod with the new configuration. -
Wait for the kube-apiserver pod to restart and become Ready
Run on: any machine with kubectl accessWait until thekube-apiserver-...pod showsSTATUSasRunningandREADYas1/1. -
Verify the kube-apiserver process includes NodeRestriction in —enable-admission-plugins
Run on: every control plane nodeConfirm the output line forkube-apiservershows--enable-admission-plugins=withNodeRestrictionpresent in the list, for example:
Using kubectl
Using kubectl
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.Automation
Automation

