2017-09-07 09:42:31 +01:00
|
|
|
# vault
|
|
|
|
|
2023-07-16 18:23:40 +01:00
|
|
|
> Interact with HashiCorp Vault.
|
2019-06-03 01:06:36 +01:00
|
|
|
> More information: <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
|
|
|
|
2020-02-27 14:20:07 +00:00
|
|
|
- Read a specific field from the value:
|
|
|
|
|
|
|
|
`vault read -field={{field_name}} secret/{{hello}}`
|
|
|
|
|
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`
|