TTL and max TTL from the system, the mount and the role, renewals that cannot pass the max, explicit max TTLs, periodic tokens, and what expiry revokes.
Study it
Time-to-live: TTL, max TTL, explicit max TTL and periodic tokens
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the HashiCorp documentation page that proves it.
Question 1 · choose 1
Tokens from the approle mount start with a 1-hour TTL. The role sets token_max_ttl to 24 hours, but the approle mount was tuned with a max lease TTL of 8 hours. The application renews its token every 30 minutes. What happens?
ARenewals work for 24 hours, because the role's token_max_ttl overrides the mount's tuned value
BRenewals work until about 8 hours after login, and then a new login is needed
CRenewals work for 32 days, the system max TTL
DEvery renewal fails, because the role's max TTL exceeds the mount's
Show the answer and why
ARenewals work for 24 hours, because the role's token_max_ttl overrides the mount's tuned value
Incorrect
The value an auth method suggests is never allowed to exceed the mount's max TTL.
BRenewals work until about 8 hours after login, and then a new login is needed
Correct
A role's max TTL may be lower than the mount's but not higher, so the 8-hour mount limit caps the token's life.
CRenewals work for 32 days, the system max TTL
Incorrect
The mount's tuned max replaces the system default for tokens from that mount.
DEvery renewal fails, because the role's max TTL exceeds the mount's
Incorrect
Vault does not reject the renewals; it limits the lifetime to the lower value.
The effective max TTL comes from the system max, the mount's tuned max and the auth method's value: the mount's value replaces the system max, and the auth method's value can only lower it.
A long-running service holds a token created with -period=24h and no other TTL options. The service renews it once a day. The server uses the default system max TTL of 32 days. What is the token's state on day 60?
AIt was revoked on day 32, when the system max TTL was reached
BIt was revoked after the first 24 hours, because the period is its max TTL
CIt still works, and its TTL has grown by 24 hours with every renewal
DIt still works; each renewal resets its TTL to 24 hours with no max TTL
Show the answer and why
AIt was revoked on day 32, when the system max TTL was reached
Incorrect
Periodic tokens escape the normal max TTL mechanism; the system max does not end them.
BIt was revoked after the first 24 hours, because the period is its max TTL
Incorrect
The period is the TTL granted at each renewal, not a limit on the token's total life.
CIt still works, and its TTL has grown by 24 hours with every renewal
Incorrect
Renewal resets the TTL to the period; it does not add the period to the time remaining.
DIt still works; each renewal resets its TTL to 24 hours with no max TTL
Correct
A periodic token's TTL is set back to the period at every renewal, and without an explicit max TTL it never expires while renewed.
Periodic tokens suit long-running services that renew regularly: they stay valid as long as each renewal arrives within the period.
Security wants no token or lease anywhere in the cluster to live longer than 7 days unless a mount is deliberately tuned otherwise, instead of the built-in 32-day system limit. Where is this set?
Amax_lease_ttl = "168h" in the server configuration of each node
Bvault auth tune -max-lease-ttl=168h token/
Ctoken_max_ttl=168h on every role of every auth method
Ddefault_lease_ttl = "168h" in the server configuration of each node
Show the answer and why
Amax_lease_ttl = "168h" in the server configuration of each node
Correct
max_lease_ttl sets the maximum lease duration for tokens and secrets server-wide; individual mounts can still override it by tuning.
Bvault auth tune -max-lease-ttl=168h token/
Incorrect
This limits only tokens issued by the token mount; other auth methods and secrets engines keep the system limit.
Ctoken_max_ttl=168h on every role of every auth method
Incorrect
Role settings apply only to tokens from those roles; secrets engines and roles created later would not be covered.
Ddefault_lease_ttl = "168h" in the server configuration of each node
Incorrect
default_lease_ttl is the starting duration; tokens and leases could still be renewed up to the maximum.
The server configuration file holds the cluster-wide lease limits: default_lease_ttl for the starting duration and max_lease_ttl for the ceiling.