Skip to content

Instantly share code, notes, and snippets.

@kaparora
Created April 19, 2020 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaparora/b4c7bff6229ebc6e578d19dab3905720 to your computer and use it in GitHub Desktop.
Save kaparora/b4c7bff6229ebc6e578d19dab3905720 to your computer and use it in GitHub Desktop.
#!/bin/sh
# Enable the transit secret engine at a path of your choice
vault secrets enable -path=/data-protection/transit transit
# Create an encryption key, this key is managed and created by Vault
vault write -f /data-protection/transit/keys/customer-key
# You can create multiple keys if you require
vault write -f /data-protection/transit/keys/archive-key
#test and see if encryption works
#with the first key
vault write /data-protection/transit/encrypt/customer-key \
plaintext=$(base64 <<< "my secret data")
#with the second key
vault write /data-protection/transit/encrypt/archive-key \
plaintext=$(base64 <<< "my secret data")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment