Skip to main content

More Info:

Verifies that —service-account-extend-token-expiration is set to false so bound service account tokens are not automatically extended to long lifetimes, reducing token exposure.

Risk Level

High

Address

Security

Compliance Standards

  • CIS Kubernetes

Triage and Remediation

Remediation

Manual Steps

  1. On every control plane node, back up the existing manifest before editing:
  2. On every control plane node, open the kube-apiserver static pod manifest for editing:
  3. In the container command: section, either add or modify the flag so it is present exactly as:
    Ensure there is no other --service-account-extend-token-expiration flag with a different value in the file, then save and exit.
    Note: editing this file will cause the kube-apiserver static pod to be restarted automatically by the kubelet.
  4. Wait 30–60 seconds for the kube-apiserver pod to restart, then confirm the apiserver container is running (on any control plane node):
    (If crictl is not available, use sudo docker ps | grep kube-apiserver on nodes using Docker.)
  5. On every control plane node, verify the running process includes the correct flag value:
    Ensure this command returns at least one line and that there is no line showing --service-account-extend-token-expiration=true.
kubectl cannot modify the kube-apiserver static pod manifest or its process flags, so this setting cannot be fixed via the Kubernetes API. To remediate, you must edit /etc/kubernetes/manifests/kube-apiserver.yaml directly on every control plane node; follow the Manual Steps section for the exact host-level changes.