Created
April 19, 2020 10:18
-
-
Save kaparora/b4c7bff6229ebc6e578d19dab3905720 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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