Skip to main content

More Info:

Disable anonymous requests to the API server

Risk Level

Low

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the existing manifest:
  2. On every control plane node, edit the API server static pod manifest:
    In the spec.containers[0].command list, ensure this flag is present:
    If a --anonymous-auth= flag already exists, change its value to false. Note: Saving this file causes the kubelet to automatically restart the kube-apiserver static pod.
  3. 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-apiserver if Docker is the runtime.)
  4. On every control plane node, verify the running process includes --anonymous-auth=false and no conflicting value:
    Confirm there is a --anonymous-auth=false argument present and no --anonymous-auth=true argument.
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.

Additional Reading: