Demo · M1
Rotate
verified in CI · 2026-11-20 · c06551c
The transcript below is recorded by a test that runs the real command-line tool against a local test setup. Identifiers, times and ports are replaced with numbered placeholders so the transcript is stable from run to run.
## An IAM user's access key is deployed to AWS Secrets Manager and to a GitHub Actions secret (AWS on moto).
$ cat inventory.yaml
tenant: default
credentials:
- id: billing-aws
tier: medium
approval: never
rotator: awsiam
issuer: { user: billing-svc-<n1> }
targets:
- { id: sm, system: awssm, ref: prod/billing/aws-<n2> }
- { id: gha, system: github-actions, ref: acme/billing/AWS_KEY }
$ rotor import inventory.yaml
imported billing-aws (tier medium, managed, awsiam, 2 target(s))
$ rotor plan billing-aws
plan for billing-aws (tier medium)
mode: scheduled (issuer allows overlapping keys (max 2 active))
action: rotate
stages: plan -> escrow-old -> mint -> validate -> propagate -> verify -> drain -> disable-old -> soak -> settle -> revoke-old -> commit -> destroy-escrow
current: <access-key-1>
targets:
- sm awssm prod/billing/aws-<n2>
caps: value-readable, concurrency optimistic, versioned rollback true, reload none
drift detection: fingerprint compare, exact
- gha github-actions acme/billing/AWS_KEY
caps: metadata-only, concurrency none, versioned rollback false, reload none
drift detection: updated_at compare, best-effort, 1s
rollback: target:sm (old value read from value-readable target sm)
reversible disable: true
downtime: none expected (keys overlap)
approval: not required (policy: never, tier medium)
assisted: none
blockers: none
## Scheduled rotation: mint, write to every target, confirm, drain, disable, soak, then revoke the old key.
$ rotor rotate billing-aws
rotation <rotation-1> started for billing-aws
==> plan
mode chosen: issuer allows overlapping keys (max 2 active) (mode=scheduled)
rollback source: old value read from value-readable target sm (source=target:sm)
==> escrow-old
old escrowed: sealed under the rotation data key (envelope=<envelope-1>)
==> mint
minted: key ID journaled before sealing (key=<access-key-2>)
==> validate
validated: read-only call succeeded with the new key (negative_control=unsupported ok=true)
==> propagate
write landed [sm]: PutSecretValue created version <rotation-1>-sm-rotor-rotor (system=awssm)
write landed [gha]: PUT returned HTTP 204 (system=github-actions)
==> verify
==> drain
drained: all confirmable targets live; max lag 1s passed; no use of the old key in the trailing 3s
==> disable-old
old disabled: reversible disable before revoke (key=<access-key-1>)
==> soak
soak clean: no rejected requests on the disabled old key
==> settle
settled [gha]: updated_at still matches our write (best-effort, 1s)
==> revoke-old
old revoked: point of no return passed (key=<access-key-1>)
==> commit
cleanup: sessions derived from the old key outlive its revocation until they expire
==> destroy-escrow
escrow destroyed: data key deleted in the runner; envelopes unreadable everywhere
result: Done (rotated)
$ rotor status <rotation-1>
rotation <rotation-1>
credential: billing-aws
mode: scheduled
status: Done
stage: destroy-escrow
reason: rotated
current key <access-key-2>, version 1
old key <access-key-1> revoked
## Leak mode: the current key is treated as compromised and killed before propagation.
$ rotor rotate billing-aws --mode leak
rotation <rotation-2> started for billing-aws
==> plan
mode chosen: requested: the old key is treated as compromised (mode=leak)
rollback source: leak mode kills the old key immediately (source=unavailable)
==> mint
minted: key ID journaled before sealing (key=<access-key-3>)
==> validate
validated: read-only call succeeded with the new key (negative_control=unsupported ok=true)
==> kill-old
old revoked: leak: old key killed before propagation; downtime accepted (key=<access-key-2>)
==> cleanup
cleanup: sessions derived from the old key outlive its revocation until they expire
==> propagate
write landed [sm]: PutSecretValue created version <rotation-2>-sm-rotor-rotor (system=awssm)
write landed [gha]: PUT returned HTTP 204 (system=github-actions)
==> verify
==> commit
cleanup: sessions derived from the old key outlive its revocation until they expire
==> destroy-escrow
escrow destroyed: data key deleted in the runner; envelopes unreadable everywhere
result: Done (rotated)
$ rotor status <rotation-2>
rotation <rotation-2>
credential: billing-aws
mode: leak
status: Done
stage: destroy-escrow
reason: rotated
current key <access-key-3>, version 2
old key <access-key-2> revoked
$ rotor deployments billing-aws
deployments for billing-aws (current key <access-key-3>, version 2)
sm awssm prod/billing/aws-<n2>
key <access-key-3> via <rotation-2> (current)
drift: in sync; detection: fingerprint compare, exact
gha github-actions acme/billing/AWS_KEY
key <access-key-3> via <rotation-2> (current)
drift: in sync (best-effort); detection: updated_at compare, best-effort, 1s