Rotation and break-glass
Root credential rotation and the sealed-glass drill.
In short. Vault rotation and break-glass: root credential rotation plus the sealed-glass recovery drill.
Break-glass is the fire axe behind glass on the wall: you hope never to touch it, but the day the building is burning is the wrong day to discover the glass is bulletproof. In Vault, the axe is the root token and the Shamir key shares that can regenerate it. Everything else in this course hands out short-lived, self-expiring credentials; this lesson is about the handful of secrets that can't expire, because they sit above the system that expires everything else. You rotate those on a schedule, and you rehearse pulling them under pressure. Get it wrong and a rotation locks you out of your own vault; get it right and a compromised operator is a shrug, not an outage.
There is no root token at rest
A live root token is a single string that bypasses every policy, every lease, and every expectation your audit log has. It should not exist while you sleep. The pattern is to generate a root token only for the minutes you actually need it, then revoke it. When it's gone, you get it back through generate-root, which forces a quorum of unseal-key holders (or recovery-key holders, under the auto-unseal you saw in lesson 0) to cooperate — no single operator can resurrect root alone. The drill issues a one-time password and a nonce; each holder submits a share against that nonce, and the final output is a root token encrypted to the OTP, so it never travels in cleartext. Store the shares split across people and locations, so assembling them is a deliberate, witnessed act.
# Kick off the drill: prints a Nonce and a one-time password (OTP)vault operator generate-root -init# Each key holder runs this and pastes their unseal/recovery key sharevault operator generate-root -nonce=<nonce># After enough shares, you get an Encoded Token — decode it with the OTPvault operator generate-root \-decode=<encoded-token> \-otp=<otp># Do the one privileged task, then destroy the token immediatelyvault token revoke -self# Started a drill by mistake? Abort itvault operator generate-root -cancel
Rotate the keyring; reshuffle the shares
Two different rotations get confused. vault operator rotate advances Vault's internal encryption keyring so new writes use a fresh key — it's cheap, needs no quorum, and you can cron it; old key terms stick around only to decrypt old data. vault operator rekey is the heavy one: it mints a brand-new set of Shamir unseal shares (or, under auto-unseal, recovery shares) and requires a quorum of the current shares to authorize. Reach for rekey when a key holder leaves the company, when a share may have leaked, or when you want to change the share count or threshold. Rotating the keyring protects data-at-rest going forward; rekeying protects the ability to unseal at all. Confuse them and you'll cron the wrong one and wonder why nothing changed.
# Cheap, quorum-free: advance the encryption keyringvault operator rotatevault read sys/key-status # current key term + install time# Heavy: mint new unseal shares. Needs a quorum of the CURRENT shares.vault operator rekey -init -key-shares=5 -key-threshold=3vault operator rekey -nonce=<nonce> # each holder submits a current share# Under auto-unseal, the Shamir shares are recovery keys — target them:vault operator rekey -target=recovery -init -key-shares=5 -key-threshold=3
Rotate the credentials engines hold
The dynamic-secrets and PKI engines from earlier in this course each hold one privileged credential of their own: the database superuser Vault logs in as, or the cloud key it uses to mint short-lived keys. That bootstrap credential is the single long-lived secret in the whole chain, so you hand it to Vault once and then have Vault rotate it to a value no human ever sees. After rotate-root, only Vault knows the password and you can never read it back out — which is exactly the point. Schedule it: a quarterly rotate-root means a leaked bootstrap password has a short shelf life.
# The Postgres/MySQL superuser configured on the database engine (lesson 2)vault write -force database/rotate-root/my-postgres# Cloud engines expose the same pattern for their root keyvault write -force aws/config/rotate-rootvault write -force gcp/config/rotate-root