safekeys/token-revocation [built]
Revocation invalidates a capability token immediately, without waiting for its TTL to expire. A jti denylist checked on every resolve provides the kill switch; short TTL bounds the residual window for anything already in flight. Later phases add device binding, so a lost hardware token is revoked by serial.
Status: built
Why this exists
Short TTLs alone leave an unacceptable window when a token is known to be leaked — minutes to hours of live authority. A denylist gives an operator the immediate kill switch that incident response requires, and the two mechanisms together cover both the slow case (expiry) and the urgent one (revocation).
Design decisions
denylist-plus-ttl [accepted]
Decision: Use a jti denylist alongside short TTLs rather than one or the other.
Rationale: TTL handles the unattended case cheaply and bounds worst-case exposure; the denylist handles the attended, urgent case. Neither alone is sufficient — long TTLs make leaks linger, and denylists alone still require knowing about the leak.
authoritative-check-at-resolve [accepted]
Decision: Check revocation at resolve time in the sidecar rather than trusting token validity alone.
Rationale: The sidecar is the enforcement point; if revocation is not checked there, a revoked token still works wherever it is presented.
How it works
Revoke a capability token (revoke-token)
An operator invalidates a specific token by its unique id.
- Receive — Operator issues a revoke request for a jti or object id.
- Validate — Control plane checks the operator's authority to revoke that object or token.
- Record — The jti is added to the denylist and the revoke is recorded in the audit log.
- Observe — Every subsequent resolve attempt with that jti is denied.
Revoke a device-bound token (later phase) (revoke-device)
A lost hardware token is revoked by serial.
- Receive — Operator revokes a device serial or its associated binding.
- Record — The device binding is invalidated at the authority.
- Observe — Attestation fails for that device on the next unwrap attempt.
Guarantees
immediate-effect
Revocation must take effect without waiting for token expiry.
Acceptance criteria:
- [ ] The denylist is consulted on every resolve
- [ ] No caching path can serve a revoked token
- [ ] Effect is observable on the next resolve attempt
revoke-is-audited
Revocation is itself an auditable event.
Acceptance criteria:
- [ ] The revoking principal, target, and timestamp are recorded
- [ ] The audit record survives in the append-only log
- [ ] Revocations are queryable alongside resolve history
device-revocation-by-serial
In the hardware phase, a lost device can be revoked by its serial.
Acceptance criteria:
- [ ] Device identity is bound at provisioning
- [ ] Revocation invalidates the binding at the authority
- [ ] No re-provisioning of the same serial without operator action
Test specifications
revoked-token-denied-on-next-resolve
Given:
- ttl_seconds: 3600
- revoke_before_use: true
When: revoke-token
Then:
- assertion: the next resolve with that jti is denied
- assertion: denial occurs well before expiry
Contracts verified: immediate-effect
revocation-recorded
Given:
- valid_token: true
When: revoke-token
Then:
- assertion: an audit record exists for the revocation
- assertion: it names the revoking principal and the target
Contracts verified: revoke-is-audited
no-cache-serves-revoked-token
Given:
- resolved_once_before_revocation: true
When: revoke-token
Then:
- assertion: a previously successful resolve does not make the token reusable
- assertion: no in-memory cache bypasses the denylist
Contracts verified: immediate-effect
Implementation
- Primary: pkg/revocation/checker.go
- Test code: pkg/revocation/checker_test.go
- Test code status: manual
See Also
- safekeys/capability-token
- safekeys/audit-logging
- safekeys/hardware-root