CertGrid CertGrid
Hands-on Lab·Certified Kubernetes Security Specialist

ServiceAccount Tokens and automountServiceAccountToken

The competency says exercise caution in using service accounts, and the caution has three parts: stop mounting credentials into workloads that never call the API, give the ones that do their own identity, and know which token type you are looking at. This guide does all three and measures each.

Cluster Hardening Guide 11 of 40 Intermediate

Written against the versions above. Projected tokens are the default since 1.24 - audience-bound and expiring. Auto-created `kubernetes.io/service-account-token` Secrets ended in the same release; any that exist were made by hand.

The cka6001 cluster: one control plane and 2 schedulable workers, on Cilium.
Server NameIP AddressOSRolesCPURAMHDD
CKA6001192.168.0.46Ubuntu 26.04 LTSControl Plane Node (tainted NoSchedule)2 Core4 GB50 GB
CKA6001-NODE01192.168.0.47Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB
CKA6001-NODE02192.168.0.48Ubuntu 26.04 LTSWorker Node2 Core4 GB50 GB

Before you start

  1. The credential every Pod gets without asking

  2. Turn it off where it is not needed

  3. A dedicated identity for the workload that does need one

  4. The token type that should not exist any more

Official sources