Skip to content

Instantly share code, notes, and snippets.

@rkuzsma
Created December 30, 2016 23:48
Show Gist options
  • Save rkuzsma/9d246adfe166dcbdb21705ff3f515f37 to your computer and use it in GitHub Desktop.
Save rkuzsma/9d246adfe166dcbdb21705ff3f515f37 to your computer and use it in GitHub Desktop.
Poor-man's secure ENV variable storage using GPG

Store the secrets on a local machine:

mkdir -p ~/.secrets
touch ~/.secrets/my_secrets
chmod 600 ~/.secrets/my_secrets
cat << EOF | gpg -c -o ~/.secrets/my_secrets
export SOME_SECRET_VARIABLE=some value
export ANOTHER_SECRET_VARIABLE=another value
EOF

Inject the secrets into a terminal ENV (anytime):

$(gpg -q -d ~/.secrets/my_secrets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment