Interview Prep/DevSecOps/Kubernetes Security Posture

Why do bound, projected service account tokens matter, and how do you use them?

IntermediateProductionKubernetes Security Posture
Answer

Since Kubernetes 1.24, pods receive short-lived tokens through the TokenRequest API, bound to the pod and an audience, instead of non-expiring Secret-based tokens. A stolen token expires and stops working when the pod is deleted.

For integrations that need a token for an external system, request a dedicated audience:

volumes:
- name: vault-token
  projected:
    sources:
    - serviceAccountToken:
        audience: vault
        expirationSeconds: 600
        path: token

Also find and remove legacy kubernetes.io/service-account-token Secrets; Kubernetes now labels unused ones and can clean them up automatically.

All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Kubernetes Security Posture