phase1: update script

ADP-179_sops_manage_keys
LeeW 11 months ago
parent 36b01996cb
commit 651b701896

@ -3,6 +3,7 @@
set -euo pipefail set -euo pipefail
sops_config=".sops.yaml" sops_config=".sops.yaml"
secrets_file="${1:-0}"
function fn_extract_fpr(){ function fn_extract_fpr(){
gpgkeyfile=$1;shift; gpgkeyfile=$1;shift;
@ -76,6 +77,10 @@ fn_verify_sops_config(){
# dump secrets, GPG_TTY src: https://www.varokas.com/secrets-in-code-with-mozilla-sops/ # dump secrets, GPG_TTY src: https://www.varokas.com/secrets-in-code-with-mozilla-sops/
GPG_TTY=$(tty) sops -d "${sops_enc_file}" GPG_TTY=$(tty) sops -d "${sops_enc_file}"
} }
fn_verify_sops_config __mock_secrets.yaml if [[ "${secrets_file}" != "0" ]]; then
fn_verify_sops_config "${secrets_file}"
echo "# SUCESS: all users with keys in this dir should have functional keys" echo "# SUCESS: all users with keys in this dir should have functional keys"
else
echo "# WARN: no secrets file passed in, make sure to call 'sops updatekeys' on secrets files"
fi

@ -0,0 +1,5 @@
#!/usr/bin/env bash
cd "$( dirname "${BASH_SOURCE[0]}")"
../bin/update_sops.sh
Loading…
Cancel
Save