projected service account token
A short-lived, signed token for a service account that the kubelet mounts into a pod and refreshes, valid only for a stated audience.
Anyone holding a valid token can act as the service account until it expires.
In more detail
Because it expires and names its intended audience, a stolen copy is useful for a short time and only to the right receiver, which limits replay. kubectl create token issues one on demand with a chosen duration. Older clusters used long-lived tokens stored in Secrets, which you should avoid.
Examples
kubectl create token web --duration=10mProjected tokens expire within hours and stop working when the pod is deleted, so a stolen one is far less useful than a long-lived token Secret.Related terms
- service account — An identity for a program rather than a person; in Kubernetes each pod runs as one and gets a signed token for it.
- token audience — The field in a token that names which service it is meant for, so any other service should reject it.
- access token — A generated string that proves who you are to a service, used instead of a password and revocable on its own.
- service account token Secret — A Kubernetes Secret holding a service account token that never expires, created on request and valid until the Secret is deleted.
Taught in
- ServiceAccounts And Tokens — Certified Kubernetes Application Developer (CKAD) Exam Prep
- Authentication, ServiceAccounts And Short Lived Tokens — Kubernetes: Production-Grade Container Orchestration
- kubeadm, High Availability And Cluster Lifecycle — Kubernetes: Production-Grade Container Orchestration
- Detecting Persistence: Tasks, Registry & Services — Security Operations & Threat Hunting (SOC)
References
- Kubernetes: Service account tokens
- Kubernetes: kubectl create token
- Kubernetes: Service account token volume projection