More Info:
Disable anonymous requests to the API serverRisk Level
LowAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every control plane node, back up the existing manifest:
-
On every control plane node, edit the API server static pod manifest:
In the
spec.containers[0].commandlist, ensure this flag is present:If a--anonymous-auth=flag already exists, change its value tofalse. Note: Saving this file causes the kubelet to automatically restart the kube-apiserver static pod. -
On every control plane node, wait 30–60 seconds for the kube-apiserver pod to restart, then verify it is running:
(or use
sudo docker ps | grep kube-apiserverif Docker is the runtime.) -
On every control plane node, verify the running process includes
--anonymous-auth=falseand no conflicting value:Confirm there is a--anonymous-auth=falseargument present and no--anonymous-auth=trueargument.
Using kubectl
Using kubectl
kubectl cannot change the --anonymous-auth flag because it is configured in the static pod manifest on each control plane node, not via the Kubernetes API. To remediate this finding, edit /etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node as described in the Manual Steps section.Automation
Automation

