forked from mtusi2026/mtusi2026lab7
lab 7 openbao
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# Issue a fresh short-lived SecretID (24 h) into ./secrets/approle/<role>/secret_id. Usage: bao_secret_id.sh <role|all>
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."; . scripts/bao_lib.sh; load_root
|
||||
roles="${1:-all}"; [ "$roles" = all ] && roles="api worker dispatcher sweeper"
|
||||
for r in $roles; do
|
||||
mkdir -p "$S/approle/$r"
|
||||
baoc write -f -field=secret_id "auth/approle/role/$r/secret-id" > "$S/approle/$r/secret_id.new"
|
||||
chmod 644 "$S/approle/$r/secret_id.new"; mv -f "$S/approle/$r/secret_id.new" "$S/approle/$r/secret_id"
|
||||
echo "secret_id issued for $r"
|
||||
done
|
||||
Reference in New Issue
Block a user