Prerequisites
- An EC2 instance running Vault
- A Customer Managed Key (CMK) in AWS KMS (e.g., Vault Unseal Key)
1. Check Current Vault Status
SSH into your Vault server and run:By default, Vault uses Shamir’s Secret Sharing for unsealing. We’ll replace this with AWS KMS.
2. Review the Vault Configuration
Open/etc/vault.d/vault.hcl:
seal stanza yet—this is where we’ll plug in our AWS KMS configuration.
3. Add the AWS KMS Seal Stanza
- In the AWS Console, go to KMS → Customer managed keys and copy your CMK ARN (for example:
arn:aws:kms:us-east-1:123456789012:key/abcd1234-5678-90ab-cdef-EXAMPLEKEY).
Treat your KMS key ARN and Vault configuration file as sensitive information. Do not expose them in public repositories.
- Edit the Vault HCL:
- Insert the
awskmsseal stanza anywhere in the file:
- Your complete configuration should now be:
4. Restart Vault and Verify Seal Type
Restart the Vault service:
Vault is now configured to auto-unseal with AWS KMS, but still needs initialization.
5. Initialize the Vault Cluster
Initialize Vault:vault status:
6. Use Vault as Usual
Authenticate with the root token:7. Confirm Auto-Unseal After Restart
Restart Vault again:Congratulations! You’ve successfully set up Cloud Auto Unseal with AWS KMS. This configuration streamlines your Vault operations and boosts security by removing manual unseal key handling.