Skip to main content

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

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the API server static pod manifest:
  2. On every control plane node, open the manifest for editing:
  3. In the command (or args) list for kube-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/manifests will cause the kubelet to restart the kube-apiserver static pod automatically.
  4. 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-apiserver container is listed and not in a restarting loop.
  5. On any machine with kubectl access, verify that cluster access still works using your supported authentication mechanism (for example, client certificates or an external auth provider):
  6. On every control plane node, verify the --token-auth-file flag is no longer present in the running process:
    Inspect the output and confirm there is no --token-auth-file= argument shown for the kube-apiserver process.
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.