Kubernetes Token Rotation Leaves Old Tokens Valid; Bound Marker Secrets Offer a Fix
A common assumption is that rotating a Kubernetes service account token invalidates the previous one, but TokenRequest-issued tokens remain valid until their expiry claim. The author, who works on the zenxPAM access platform, describes a fix using the boundObjectRef feature, which ties a token to an object so it stops working when that object is deleted. Because no Pod exists for external workloads, they use a dedicated marker Secret as the anchor. In lab tests on a single-node k3s cluster, revoked tokens were refused roughly 9 to 11 seconds after deletion, reflecting the API server's authentication cache. The design adds two alternating marker slots per identity, a verification step using SelfSubjectReview before switching, and compensating rollback on failure.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in