Skip to content

Instantly share code, notes, and snippets.

@socketbox
Last active June 15, 2022 23:53
Show Gist options
  • Save socketbox/8d31afe6a782ed7d4abe07c9cee125c3 to your computer and use it in GitHub Desktop.
Save socketbox/8d31afe6a782ed7d4abe07c9cee125c3 to your computer and use it in GitHub Desktop.
Get all secrets and sensitive data for a GCP project
#!/usr/bin/env bash
set -eou pipefail
sec_list=$(gcloud secrets list --format="table[no-heading](name.basename())")
for s in ${sec_list[*]};
do
sec=$(gcloud secrets versions access latest --secret="$s")
printf "%s: %s\n" $s $sec
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment