More Info:
Verifies that the API server —token-auth-file parameter is not set. Static token files are long-lived, unrotatable credentials that should be replaced with stronger authentication.Risk Level
HighAddress
SecurityCompliance Standards
- CIS Kubernetes
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On every control plane node, back up the API server static pod manifest:
-
On every control plane node, open the manifest for editing:
-
In the
command(orargs) list forkube-apiserver, locate and delete the entire--token-auth-file=...entry, ensuring it is removed as a separate list item, for example delete a line like:Save and exit the editor. Editing a file under/etc/kubernetes/manifestswill cause the kubelet to restart thekube-apiserverstatic pod automatically. -
On every control plane node, wait for the API server pod to be recreated and running (this may take up to a minute):
Confirm that a
kube-apiservercontainer is listed and not in a restarting loop. -
On any machine with
kubectlaccess, verify that cluster access still works using your supported authentication mechanism (for example, client certificates or an external auth provider): -
On every control plane node, verify the
--token-auth-fileflag is no longer present in the running process:Inspect the output and confirm there is no--token-auth-file=argument shown for thekube-apiserverprocess.
Using kubectl
Using kubectl
kubectl cannot modify the kube-apiserver static pod manifest or its process flags, so this finding cannot be fixed via the Kubernetes API. To remediate, you must edit
/etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node; see the Manual Steps section for the exact host-level procedure.Automation
Automation

