Rotate the secrets key
Add a new version of the realm's secrets key, and move the realm's own secrets onto it as they are written.
Available, with limitsAPI
Your key policy may ask for keys to be replaced on a schedule. Rotating the realm’s secrets key, which seals the realm’s own vault, adds a new version: everything written from then on is sealed under it, and everything written before still opens. No one notices.
Before you start: you are a realm administrator holding RealmOwner in this realm or a realm above it, signed in
with your session in $CVYUH_SESSION (Call the API shows how). Users’ and groups’ vaults are under their own keys, which this doesn’t
touch.
Rotate it
Section titled “Rotate it”-
Rotate the key:
Terminal window curl -X PUT https://foobar.cvyuh.com/api/v0/am/keys/v1/secrets/encryption \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{}'The realm answers
200with the newversion. Note it, with the time: a rotation isn’t on the realm’s audit trail yet. -
Each secret in the realm’s vault moves onto the new version the next time it is written, every version it holds sealed again. To move one now, write it again, here
infra/db-root:Terminal window curl https://foobar.cvyuh.com/api/v0/vault/managed/v1/realm/data/infra/db-root \-H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \-H "Content-Type: application/json" \-d '{ "data": { "user": "root", "password": "<password>" } }'
Check it worked
Section titled “Check it worked”Read a secret written before the rotation: it still opens. No answer shows which key version a secret is under yet, so
to be sure every secret has moved, write each one again: list them with a GET on
https://foobar.cvyuh.com/api/v0/vault/managed/v1/realm/metadata?list=true.
Good to know
Section titled “Good to know”- A secret not written since stays under the older version, which still opens it. There is no call yet that seals every secret again at once: see What’s next for keys and protection.
Related
Section titled “Related”- Key rotation: how it works, and when a user’s key rotates.
- Shred a realm’s secrets: destroy the key instead.