Skip to content

Instantly share code, notes, and snippets.

@javipolo
Created October 26, 2018 11:18
Show Gist options
  • Save javipolo/4357afdf8506e2d40ceab283266de291 to your computer and use it in GitHub Desktop.
Save javipolo/4357afdf8506e2d40ceab283266de291 to your computer and use it in GitHub Desktop.
Decode kubernetes base64 secrets
# 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