Files
oam/knowledge base/hashicorp vault.md
2025-08-02 22:47:51 +02:00

1.1 KiB

HashiCorp Vault

  1. TL;DR
  2. Further readings

TL;DR

# Install the CLI.
brew tap hashicorp/tap && brew install hashicorp/tap/vault

# Settings.
export VAULT_ADDR='https://vault.address/'
export VAULT_NAMESPACE='namespace_name'

# Check the connection to the Vault server.
vault status

# Login.
vault login
vault login -method='oidc'

# Unwrap a token.
# This operation may only be attempted once; after this attempt, the token will
# die and will need to be regenerated.
export VAULT_TOKEN='s.WVDAitOTTTfcjlklwk8AADDs' && vault unwrap

# Create a secret.
vault kv put secret/demo-app/config username='foo' password='bar'

# Get a secret.
# Note: "data" need to be added here in the path (secret/demo-app/config), as
# it is a property of the Vault API.
vault read -format 'json' 'secret/data/demo-app/config'

Further readings