Skip to content

Instantly share code, notes, and snippets.

@weavenet
Created March 9, 2019 15:35
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 weavenet/f3af28350f07176674a5474b2d891102 to your computer and use it in GitHub Desktop.
Save weavenet/f3af28350f07176674a5474b2d891102 to your computer and use it in GitHub Desktop.
# Examples on how to store secret data outside of dotfiles
#
# Encyrpted cipher text created via:
#
# echo SECRET_VALUE | openssl enc -e -aes-256-cbc -a -salt -pass pass:`cat ~/.password`
#
password=`cat ~/.password`
cipher_text=U2FsdGVkX1/OGxV6uRFeFfihJXZ/DU8rOibHL3uKxcY=
export SECRET1=`echo $cipher_text | openssl enc -d -aes-256-cbc -a -salt -pass pass:$password`
#
# Password stored in AWS SSM Parameter Store via:
#
# aws ssm put-parameter --name /secret2 --value SECRET_VALUE --type SecureString
#
# More info: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html
#
export SECRET2=`aws ssm get-parameter --name /secret2 |jq -r .Parameter.Value`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment