Interview Prep/Kubernetes/Security, RBAC and policy

What does a ServiceAccount do and why should you disable the token automount?

BeginnerScenarioSecurity, RBAC and policy
Answer

Situation read → Pods do not call the API but carry a token.

What I'd do →

  1. Set automountServiceAccountToken: false on pods or ServiceAccounts that do not need the API
  2. Create dedicated ServiceAccounts per workload
  3. Check with kubectl exec -- ls /var/run/secrets/kubernetes.io/serviceaccount
  4. Use bound, projected tokens (default now)
  5. Do not use the default ServiceAccount for anything

Why → A token in a compromised pod is a foothold into the API server.

Interview tip → Mention bound tokens expire.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy