- Someone joins or leaves the organization.
- Security wants to change the number of shares or the threshold.
- Compliance mandates that you rotate the keys at regular intervals.
Rekeying Vault
To rekey the Vault with HSM Auto Unseal configured, use the vault operator rekey command with the -target=recovery flag. This command generates a new set of recovery keys. It does not generate a new root key on the KMES Series 3. The process can optionally modify the total number of recovery key shares or the recovery key threshold required. Note that recovery keys cannot decrypt the root key; they are purely for authorization purposes.1
Run the following command to initialize the rekeying operation, modifying the key shares and key threshold values:
Shell
This command generates a nonce value and starts the rekeying process, as shown in the following example output. All other unseal keys must also provide this nonce value. This nonce value is not a secret, so it is safe to distribute over insecure channels, such as chat or email.
Shell
2
Each key holder runs the following command, specifying their unique recovery key in the last field instead of this example recovery key (
8iJCZkAqmFcIh7KyTQcyH7p/dPVFOUsEnSq/p5E1g9KX):Shell
The output should be similar to the following example:
None
3
Repeat the step to complete the rekey operation. When the final unseal key holder enters their key, Vault outputs the new recovery keys.
The output should be similar to the following example:
None
Rotating the encryption key
Unlike rekeying the Vault, rotating the Vault encryption key does not require a quorum of recovery keys. Anyone with the proper permissions in Vault can perform the encryption key rotation. You can rotate keys automatically or manually.With Vault 1.7 and later, Vault automatically rotates the backend encryption key before reaching 2^32 encryption operations, adhering to NIST SP 800-32D guidelines.
Adjust the automatic key rotation
Perform the following steps to adjust the automatic key rotation:1
Run the following command to view the current automatic rotation policy:
Shell
This returns the current status and configuration of automatic encryption key rotation, as shown in the following output example:
None
2
Run the following command to configure a time interval for automatic key rotation:
Shell
The output should be similar to the following output example:
None
3
Run the following command to configure the maximum number of encryption operations per key:
Shell
The output should be similar to the following output example:
None
Perform manual key rotation
Perform the following steps to perform manual key rotation:Shell
The output should resemble the following example, which displays the key version and installation time.:
None

