2017-09-07 09:42:31 +01:00
|
|
|
# vault
|
|
|
|
|
2017-09-07 17:50:18 +01:00
|
|
|
> A CLI to interact with HashiCorp Vault.
|
2019-05-14 17:09:07 +01:00
|
|
|
> Homepage: <https://www.vaultproject.io/docs/commands>.
|
2017-09-07 09:42:31 +01:00
|
|
|
|
2017-09-08 13:21:37 +01:00
|
|
|
- Connect to a Vault server and initialize a new encrypted data store:
|
2017-09-07 09:42:31 +01:00
|
|
|
|
2017-09-08 13:21:37 +01:00
|
|
|
`vault init`
|
2017-09-07 09:42:31 +01:00
|
|
|
|
2017-09-08 15:36:06 +01:00
|
|
|
- Unseal (unlock) the vault, by providing one of the key shares needed to access the encrypted data store:
|
2017-09-07 09:42:31 +01:00
|
|
|
|
|
|
|
`vault unseal {{key-share-x}}`
|
|
|
|
|
2017-09-08 15:36:06 +01:00
|
|
|
- Authenticate the CLI client against the Vault server, using an authentication token:
|
2017-09-07 09:42:31 +01:00
|
|
|
|
2018-10-29 11:14:25 +00:00
|
|
|
`vault auth {{authentication_token}}`
|
2017-09-07 09:42:31 +01:00
|
|
|
|
2017-09-08 15:36:06 +01:00
|
|
|
- Store a new secret in the vault, using the generic back-end called "secret":
|
2017-09-07 09:42:31 +01:00
|
|
|
|
2017-09-07 20:30:59 +01:00
|
|
|
`vault write secret/{{hello}} value={{world}}`
|
2017-09-07 09:42:31 +01:00
|
|
|
|
2017-09-08 15:36:06 +01:00
|
|
|
- Read a value from the vault, using the generic back-end called "secret":
|
2017-09-07 09:42:31 +01:00
|
|
|
|
2017-09-07 20:30:59 +01:00
|
|
|
`vault read secret/{{hello}}`
|
2017-09-07 09:42:31 +01:00
|
|
|
|
2017-09-08 15:36:06 +01:00
|
|
|
- Seal (lock) the Vault server, by removing the encryption key of the data store from memory:
|
2017-09-07 09:42:31 +01:00
|
|
|
|
|
|
|
`vault seal`
|