More Info:
Automatically mounting service account tokens into pods that do not need API access widens the attack surface. Set automountServiceAccountToken to false unless the workload requires API server access.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS EKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
List service accounts and identify which workloads truly need API access (run on any machine with kubectl access):
For each service account in application namespaces, confirm with the application owner whether the pod needs to talk to the Kubernetes API. Only those should keep
automountServiceAccountToken: trueor default behavior. -
For a service account that does NOT need API access, patch it to disable token mounting (run on any machine with kubectl access, replace NAMESPACE and SA_NAME):
-
For pods that explicitly do NOT need API access but still rely on the default service account, create a dedicated “no-api” service account and disable token mounting on it (run on any machine with kubectl access, replace NAMESPACE and SA_NAME):
Then, update the pod/deployment/daemonset/statefulset spec to use this service account:
-
For workloads that DO require API access, leave their service accounts as-is, but ensure least privilege by checking and minimizing their RBAC bindings (run on any machine with kubectl access, replace NAMESPACE and SA_NAME):
Adjust Role/ClusterRole and bindings to grant only the necessary verbs and resources.
-
For any pod spec that explicitly sets
automountServiceAccountToken: truebut does NOT need API access, update it to false (run on any machine with kubectl access, replace kind/name/namespace): -
Verify that only pods which truly need API access are mounting tokens (run on any machine with kubectl access):
Using kubectl
Using kubectl
On any machine with kubectl access:Manually determine which of these workloads do not need Kubernetes API access.Example: patch a ServiceAccount so that any pods using it do NOT auto‑mount the tokenIn a controller’s Pod template (e.g., Deployment):Apply:
- Identify pods that should not have the token mounted but do
- For each workload that does NOT need API access, edit its Pod spec to disable the token mount. Prefer editing the owning controller (Deployment, DaemonSet, StatefulSet, Job, CronJob) rather than the live Pod.
- Declarative manifest snippets (for future or GitOps use)
- Verification (same logic as the audit)
Automation
Automation

