More Info:
Verifies that the API server —anonymous-auth argument is set to false. Allowing anonymous requests lets unauthenticated users access the API and is a critical exposure.Risk Level
CriticalAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify how users currently authenticate
- On any machine with
kubectlaccess, list allClusterRoleBindingandRoleBindingobjects to see which subjects (users, groups, service accounts) have access: - Review these files for
kind: ServiceAccountused as long‑lived “users” (e.g., bound to broad cluster roles likecluster-adminor used outside pods).
- On any machine with
-
Locate and review OIDC (or other user auth) configuration
- On every control plane node, inspect the API server static pod manifest to see what authentication mechanisms are configured:
- In the
command:section, look for flags such as--oidc-issuer-url,--oidc-client-id,--oidc-username-claim,--oidc-groups-claim, or webhook/token file auth flags. - If no non–service-account user auth mechanism is configured, plan an OIDC or other supported auth integration before removing any service-account-based user access.
- On every control plane node, inspect the API server static pod manifest to see what authentication mechanisms are configured:
-
Inventory service accounts used as “users”
- On any machine with
kubectlaccess, list all service accounts and their tokens/secrets: - Correlate service accounts that:
- Are referenced in out-of-cluster automation, scripts, or CI/CD as bearer tokens.
- Have powerful bindings (e.g.,
cluster-admin) from step 1.
- Document which external systems rely on these tokens.
- On any machine with
-
Plan and, if appropriate, migrate those “user” identities to OIDC (or another user auth)
- Work with your identity team to create proper user or group identities in your IdP and configure Kubernetes API server OIDC flags in
/etc/kubernetes/manifests/kube-apiserver.yaml(or equivalent mechanism) according to your platform’s guidance. - For each external system identified in step 3, update its configuration to use OIDC (or other non–service-account) auth instead of embedding a service account token.
- Apply any manifest changes to
/etc/kubernetes/manifests/kube-apiserver.yaml; be aware that editing this file will restart the API server pod on that control plane node.
- Work with your identity team to create proper user or group identities in your IdP and configure Kubernetes API server OIDC flags in
-
Tighten or remove service account–based user access
- Once alternate auth is working, on any machine with
kubectlaccess, remove or reduce broad RBAC bindings that treat service accounts as users (example for a specific binding): - Optionally delete no-longer-needed service accounts and their secrets:
- Ensure remaining service accounts are only used by in-cluster workloads and have least-privilege roles.
- Once alternate auth is working, on any machine with
-
Verify current state and document residual exceptions
- Re-run evidence collection to confirm that no service accounts are bound as generic user identities:
- For any remaining intentional uses (e.g., machine-to-machine automation that cannot yet use OIDC), document the justification, scope, and planned remediation timeline, as this check is inherently manual and risk-based.
- Re-run evidence collection to confirm that no service accounts are bound as generic user identities:
Using kubectl
Using kubectl
kubectl cannot change API server process flags or the static pod manifest at
/etc/kubernetes/manifests/kube-apiserver.yaml on control plane nodes. To address this finding, make the change directly on each control plane node’s host configuration as described in the Manual Steps section.Automation
Automation

