Skip to main content

More Info:

Anonymous authentication allows unauthenticated requests to reach the kubelet API. Setting —anonymous-auth to false ensures every request must be authenticated.

Risk Level

Critical

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, confirm the current kube-apiserver arguments:
  2. On every control plane node, back up the existing manifest:
  3. Edit the kube-apiserver static pod manifest to set anonymous auth to false:
    In the containers:- name: kube-apiservercommand: list, ensure there is a line exactly like:
    If a --anonymous-auth= flag already exists with a different value, change it to false. Save and exit.
    Note: updating this file will cause the kube-apiserver static pod to restart automatically.
  4. (If flags are passed via args: instead of command:) ensure the flag is present or corrected under args::
  5. Wait for the kube-apiserver pod to restart and become Ready (from any machine with kubectl access):
  6. Verify on every control plane node that the process now includes --anonymous-auth=false:
kubectl cannot modify kube-apiserver process flags or static pod manifests, so it cannot be used to set --anonymous-auth=false for this control-plane component. To address this finding, you must edit /etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node; follow the steps in the Manual Steps section.