When to rotate
- On a schedule — every 90 days or annually is typical, and several frameworks expect a defined interval.
- When someone who had access to the wrapping key leaves, or the key may have been exposed.
- As part of a compliance exercise, where you need to evidence that rotation works rather than that it is merely possible.
Before you start
- Three of your five Shamir key shares, hex-encoded, as issued at setup.
- The root access token of the main tenant. Only the main-tenant administrator can rotate the wrapping key.
- A running, healthy instance. Rotation is performed against a live vault — see What is recoverable if yours is already down.
- Write access to wherever the wrapping key is configured: your secret manager and your deployment config.
- A maintenance window. The vault keeps serving traffic during the API call, but it has to be restarted afterwards.
Rotate the key
1
Call SystemGenerateWrappingKey
Send any three of the five shares. They are hex-encoded, and the API rejects anything else.Databunker Pro reconstructs the recovery key from the shares, uses it to recover the master key, and confirms the result matches the master key the running instance already holds. Only then does it mint a new wrapping key and re-wrap the master key with it.
2
Store the new key before restarting
Write
wrappingkey to both places it needs to exist:- Your secret manager — AWS Secrets Manager, HashiCorp Vault, Google Secret Manager, or equivalent.
- The deployment configuration the container reads at boot:
DATABUNKER_WRAPPINGKEY,DATABUNKER_WRAPPINGKEY_FILE, or the-wrappingkeyargument. With Docker Compose this is the.envfile; on Kubernetes it is the secret mounted into the pod.
3
Restart Databunker Pro
The running process continues with the key it already holds in memory; the new key only takes effect on restart.On Kubernetes, roll the deployment after updating the secret.
4
Verify
Confirm the service is up:Then read back a known record with
UserGet. A successful decryption proves the new wrapping key resolves to the same master key. Once verified, discard the old wrapping key.Your five Shamir shares remain valid after rotation and do not need to be reissued or redistributed. They protect a separate recovery wrapping of the master key, which rotation does not modify — see Two independent wrappings.
Errors
What is recoverable
A wrapping key lost while the vault is still running is routine to recover; the same loss discovered after it has stopped is not. If you find the key is missing, rotate before anything triggers a restart.