Created
October 26, 2018 11:18
-
-
Save javipolo/4357afdf8506e2d40ceab283266de291 to your computer and use it in GitHub Desktop.
Decode kubernetes base64 secrets
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
# Print decoded kubernetes secrets | |
# kubectl secrets nameofsecret -o json | kubernetes_raw_secrets.sh | |
tmp=$(mktemp) | |
cat > $tmp | |
keys=$(cat $tmp| jq -ra '.data | to_entries[] | .key') | |
for key in $keys; do | |
value=$(cat $tmp | jq -r '.data."'$key'"' | base64 -d) | |
echo "$key: $value" | |
done | |
rm $tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment