Watch
0
0
Fork
You've already forked hyperhive
0

raise the cert role token ttl to 1h

This commit is contained in:
atlas 2026-10-28 20:18:18 +01:00 • committed by mara
commit 099af86cd2

View file

@ -456,8 +456,8 @@ responders log in on every check, and the store keeps no record of a batch token
so unauthenticated requests don't grow its token storage. Nothing can renew
or revoke a batch token.
The other roles issue service tokens that live 15 minutes (`token_ttl=15m` and
`token_max_ttl=15m`). That covers the roles `swarm-bao.nix` writes, and the
The other roles issue service tokens that live an hour (`token_ttl=1h` and
`token_max_ttl=1h`). That covers the roles `swarm-bao.nix` writes, and the
agent and hive roles the controller writes through
`SecretStore::write_cert_role`, which takes the same value from
`CERT_ROLE_TOKEN_TTL`. The store keeps a lease for every token until it
@ -465,10 +465,14 @@ expires, and the mount default of 32 days leaves one lease per login for a
month; at the 17 thousand logins a day this swarm made, that came to half a
million leases. A reader logs in per operation and holds the token for seconds.
The longest hold is the controller's forge work, which stops after two minutes.
A client that keeps a `SecretStore` handle longer than 15 minutes must log in
A client that keeps a `SecretStore` handle longer than an hour must log in
again, because nothing renews the token. A role the controller writes takes the
TTL at its next write: a hive's at the controller's start, an agent's at its
next certificate renewal.
next certificate renewal. At that rate an hour keeps about 700 tokens live.
The granter's role keeps 15 minutes. Only the one-time bootstrap token writes
it, and a deployed store never rewrites it, so the longer TTL would not reach
it; the granter logs in and finishes within seconds.
### What a missing leaf costs