2017-09-07 09:42:31 +01:00
|
|
|
# vault
|
|
|
|
|
2017-09-07 17:50:18 +01:00
|
|
|
> A CLI to interact with HashiCorp Vault.
|
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 13:21:37 +01:00
|
|
|
- Unseal or '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 13:21:37 +01:00
|
|
|
- Authenticate the CLI client against the Vault server using an authentication token:
|
2017-09-07 09:42:31 +01:00
|
|
|
|
|
|
|
`vault auth {{authentication-token}}`
|
|
|
|
|
2017-09-08 13:21:37 +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 13:21:37 +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 13:21:37 +01:00
|
|
|
- Seal or '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`
|