Interview Prep/Kubernetes/Security, RBAC and policy

How do you rotate a leaked ServiceAccount token?

IntermediateScenarioSecurity, RBAC and policy
Answer

Situation read → A token appeared in a public log.

What I'd do →

  1. Delete the affected Secret (legacy) or the ServiceAccount and recreate it
  2. Bound tokens expire, and you can restart pods to get new ones
  3. Check audit logs for use of the token
  4. Reduce its permissions
  5. Move to short-lived tokens with TokenRequest

Why → Revocation means invalidating the identity, not just removing the file.

Interview tip → Mention audit log queries by user.username.

All Kubernetes questions Roadmap: Kubernetes networking, storage & scaling

More on Security, RBAC and policy