HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

vault — Interact with HashiCorp Vault. More information: <https://developer.hashicorp.com/vault/docs/command

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandinteractcliwithmorehashicorpvault

Problem

How to use the vault command: Interact with HashiCorp Vault. More information: <https://developer.hashicorp.com/vault/docs/commands>.

Solution

vault — Interact with HashiCorp Vault. More information: <https://developer.hashicorp.com/vault/docs/commands>.

Connect to a Vault server and initialize a new encrypted data store:
vault init


Unseal (unlock) the vault, by providing one of the key shares needed to access the encrypted data store:
vault unseal {{key-share-x}}


Authenticate the CLI client against the Vault server, using an authentication token:
vault auth {{authentication_token}}


Store a new secret in the vault, using the generic back-end called "secret":
vault write secret/{{hello}} value={{world}}


Read a value from the vault, using the generic back-end called "secret":
vault read secret/{{hello}}


Read a specific field from the value:
vault read -field={{field_name}} secret/{{hello}}


Seal (lock) the Vault server, by removing the encryption key of the data store from memory:
vault seal

Code Snippets

Connect to a Vault server and initialize a new encrypted data store

vault init

Unseal (unlock) the vault, by providing one of the key shares needed to access the encrypted data store

vault unseal {{key-share-x}}

Authenticate the CLI client against the Vault server, using an authentication token

vault auth {{authentication_token}}

Store a new secret in the vault, using the generic back-end called "secret"

vault write secret/{{hello}} value={{world}}

Read a value from the vault, using the generic back-end called "secret"

vault read secret/{{hello}}

Context

tldr-pages: common/vault

Revisions (0)

No revisions yet.