Interview Prep/Kubernetes/Security: RBAC, ServiceAccounts & Pod Security

Why set `automountServiceAccountToken: false`?

IntermediateConceptSecurity: RBAC, ServiceAccounts & Pod Security
Answer

By default every Pod mounts a token at /var/run/secrets/kubernetes.io/serviceaccount, even if it never calls the API. If the app is compromised, the attacker gets that identity. Disable mounting on the ServiceAccount or Pod when the workload does not need the Kubernetes API.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security: RBAC, ServiceAccounts & Pod Security