Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stenio123/f85d81a4dc58d86153af963b44d74da8 to your computer and use it in GitHub Desktop.
Save stenio123/f85d81a4dc58d86153af963b44d74da8 to your computer and use it in GitHub Desktop.
Easy Vault Transit Demo
# Log into your vault instance if you haven't already
vault login root
# Enable the transit secret engine
vault secrets enable transit
# Create a key
vault write -f transit/keys/my-key
# Read the key, nothing up my sleeves
vault read transit/keys/my-key
# Write some base64 encrypted data to the transit endpoint
vault write transit/encrypt/my-key plaintext=$(base64 <<< "my secret data")
# "Write" to the endpoint to decrypt the encrypted data. Replace the cyphertext below with your own!
vault write -field=plaintext transit/decrypt/my-key ciphertext=vault:v1:d1AOjmTrduTO6Dy+u3ff2hcBGK4IMumjHpGWylsURvhzd4B3PkO3M6VxqA== | base64 --decode
my secret data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment