Skip to main content
In this hands-on guide, you will learn how to rekey a Vault cluster and rotate its encryption keys using AWS KMS for auto-unseal. Rekeying lets you replace old recovery keys (for example when an employee leaves), while key rotation refreshes the master encryption key to maintain security.

Prerequisites

  • Vault Enterprise v1.10.0+ configured with AWS KMS auto-unseal
  • vault CLI installed (>= v1.10.0)
  • AWS IAM permissions for KMS
  • Network access to Vault server

1. Check Initial Vault Status

Verify that Vault is sealed and using AWS KMS for auto-unseal:
Expected output:

2. Initialize the Vault Cluster

Initialize Vault to set up Shamir sealing and generate recovery keys and a root token:
Vault logs will display the security barrier setup and Raft storage configuration. Review the generated tokens:
Sample output:
Check status again—Vault should now be unsealed with Shamir recovery:

3. Rekey the Vault Cluster

Rekeying replaces existing recovery keys with a new set. This is crucial if a key is compromised or when rotating personnel access.
Losing all recovery keys renders your data unrecoverable. Always store keys securely and offsite.

3.1 Initiate Rekey

Output:

3.2 Submit Existing Recovery Keys

Submit any 3 of the existing 5 recovery keys (order does not matter). Each submission advances the progress:
Repeat until Rekey Progress: 3/3:
You now have a fresh set of recovery keys.

4. Rotate the Encryption Key

Periodic encryption key rotation keeps your data encryption strong by refreshing the master key.

4.1 Configure Environment Variables

4.2 Check Current Key Status

Example:

4.3 Rotate to a New Key

Verify:

Vault Key Management Commands

References

Practice these steps in a non-production environment to master Vault’s key management workflows.

Watch Video

Practice Lab