tldr/pages/common/vault.md

33 lines
907 B
Markdown
Raw Normal View History

2017-09-07 09:42:31 +01:00
# vault
2017-09-07 17:50:18 +01:00
> A CLI to interact with HashiCorp Vault.
> More information: <https://www.vaultproject.io/docs/commands>.
2017-09-07 09:42:31 +01:00
- Connect to a Vault server and initialize a new encrypted data store:
2017-09-07 09:42:31 +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
`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
`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
`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`