Created
February 27, 2017 01:59
-
-
Save anonymous/b3356ce9ccb6d8a1bb8516a1a54cf619 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
#!/usr/bin/env bash | |
# | |
# | |
# 2017-02-26 7:01 PM | |
# | |
# Bash "strict mode header". | |
IFS=$'\n\t' | |
set -euo pipefail | |
# Path to this script. | |
SCRIPT_NAME=$(basename ${BASH_SOURCE[0]}) | |
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | |
# Script | |
TEMPFILE=$(mktemp) | |
BASE64KEY=$(aws kms decrypt --region us-east-1 --encryption-context 'KeyType=Chef Service Discovery' --ciphertext-blob fileb:///foreflight/discovery-v2.encrypted-key --output text --query Plaintext) | |
KEY=$(echo ${BASE64KEY} | base64 -d) | |
echo ${KEY} | |
openssl enc -d -aes-256-cbc -k "${KEY}" -base64 -in /foreflight/discovery-v2.yml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment