Use KV Secrets Engine for Secrets Versioning
KV secrets engine is essentially a key-value store. It’s a simple and flexible way to store secrets. One of its strongest features is secret versioning, which lets you track changes to your secrets and revert to a specific version of secret if needed.
Prerequisites
You need a running Vault cluster. Refer to the Shortcut “Run HashiCorp Vault with Helm” for a refresher on running Vault.
Get Started with KV Secrets Engine
-
Enable KV secrets engine (version 2):
vault secrets enable -path=kv-v2 kv-v2
You should get an output like this:
You can check all the secrets engines using this command:
vault secrets list
You should see an output like this:
-
Write a
kv-v2
secret:vault kv put kv-v2/my-secret test="shortcuts"
Your output should look something like the following:
Notice the version 1 in the output.
-
Write another version of the same secret:
vault kv put kv-v2/my-secret test="shortcuts-new"
Now notice that it says version 2:
-
Read the secret you just created:
vault kv get ...
Get Use KV Secrets Engine for Secrets Versioning now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.