More Info:
Do not use token based 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 manifest before editing:
-
On every control plane node, inspect the current manifest for any
--token-auth-fileusage: -
On every control plane node, edit the manifest to remove the
--token-auth-file=<filename>flag from thekube-apiservercontainercommandorargslist:In the editor, delete the entire line containing--token-auth-file=(or remove just that entry from the list), then save and exit.
Note: Saving this file will trigger the kubelet to restart the API server static pod. -
Wait for the API server pod to restart and become Running on the local node:
Ensure there is a recent kube-apiserver container in
Runningstate. -
On every control plane node, verify the kube-apiserver process no longer has the
--token-auth-fileflag:Confirm that the command line for the kube-apiserver process does not contain--token-auth-file=.
Using kubectl
Using kubectl
kubectl cannot modify the kube-apiserver static pod manifest or its process flags, so it cannot be used to remove the
--token-auth-file parameter. To address this finding, make the change directly on each control plane node in /etc/kubernetes/manifests/kube-apiserver.yaml as described in the Manual Steps section.Automation
Automation

