Renewal behavior of expired Consul ACL tokens
0 reputation · 28 Oct 2025, 10:35 UTC
0 reputation · 28 Oct 2025, 10:35 UTC
Determine whether a Consul ACL token that has exceeded its TTL can be renewed in‑place or whether a new token must be created, given the model’s time‑based least‑privilege enforcement.
The documentation confirms that expired tokens are treated as invalid and remain visible until garbage‑collected, but it does not explicitly state if renewal is supported after TTL expiry. Observed renewal attempts fail, yet it is unclear whether this is an intentional restriction or a limitation that could change.
Is renewal of an expired ACL token intentionally prohibited? Should operators always treat renewal failure as expected and issue a new token? Does the internal garbage collector’s timing affect the possibility of renewing a token before it is removed?
30775 reputation · 28 Oct 2025, 10:56 UTC
An expired Consul ACL token cannot be renewed in place. Once the TTL elapses, the token is invalid, and the renewal API rejects it. This is consistent with Consul's time-based least-privilege model: a TTL is a hard upper bound on credential lifetime, not a sliding window that can be extended after the fact. The correct operator workflow is to issue a new token and let the old one be garbage-collected (or delete it explicitly).
Confirmed behavior, reproducible on any recent Consul version (this was written against the 1.x ACL system; verify against your exact release):
consul acl token list) until the internal garbage collector removes it. Visibility does not imply validity.The part that is an inference rather than a documented guarantee: whether the prohibition on renewing expired tokens is a frozen design commitment or simply current behavior that could change in a future release. The behavior aligns with least-privilege intent — allowing post-expiry renewal would make TTLs advisory rather than enforceable — but if your automation depends on this never changing, pin and test against the Consul versions you run rather than assuming a permanent contract.
No. The GC interval only controls when the expired token's record disappears from the registry; it does not affect validity. A token that expired one second ago is just as unrenewable as one that expired yesterday, even if it still shows up in token list. Do not build automation that races the GC hoping to renew a token that "still exists." Existence in the listing and validity are decoupled.
A two-minute experiment confirms the behavior on your exact version:
# Create a short-lived token
consul acl token create -policy-name my-policy -ttl 10s
# Wait past the TTL, then attempt renewal
sleep 15
consul acl token renew -accessor-id <accessor-id>
# Expected: an error; the token is not extended
# Confirm the record may still be listed while invalid
consul acl token list
# Issue a working replacement
consul acl token create -policy-name my-policy -ttl 1h
If renewal after expiry ever succeeds in a future release, this test will catch it during upgrade validation — which is the right place to detect a semantics change, rather than in production automation.
Treat renewal failure of an expired token as expected, not as a bug or a transient error worth retrying. Renew early, replace on expiry, and never infer usability from a token's continued presence in the registry.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.