Skip to main content

More Info:

Validate service account before validating token.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, open the kube-apiserver static pod manifest for editing (this will cause the API server pod to restart when saved):
  1. In the spec.containers[0].command list, either add or update the argument to explicitly enable service account lookup, ensuring there is only one such flag and it is set to true, for example:
  1. If you prefer to rely on the default behavior instead of setting it explicitly, remove any existing --service-account-lookup= entry from the command list and leave it absent (do not add a replacement).
  2. Save the file and exit the editor; the kubelet will detect the manifest change and automatically restart the kube-apiserver static pod. Allow a few moments for it to restart.
  3. On the same control plane node, verify the API server process now has the correct argument set (or the flag removed if you chose to rely on the default):
  1. In the output, confirm that either:
    • --service-account-lookup=true is present and there is no --service-account-lookup=false, or
    • there is no --service-account-lookup= argument at all (indicating the default applies).
kubectl cannot modify the kube-apiserver static pod manifest or its process flags. To remediate this finding, you must edit /etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node; see the Manual Steps section for exact host-level instructions.

Additional Reading: