lab 7 openbao

This commit is contained in:
2026-11-23 14:39:13 +03:00
parent 20afc2c790
commit 912a874f00
118 changed files with 12464 additions and 5108 deletions
+11
View File
@@ -0,0 +1,11 @@
#!/bin/sh
# Revoke an AppRole identity (stolen RoleID/SecretID/tokens become useless). Usage: revoke_identity.sh <role>
# Destroys every SecretID of the role and revokes all tokens issued through AppRole login (apps only hold a token for milliseconds at start).
set -eu
cd "$(dirname "$0")/.."; . scripts/bao_lib.sh; load_root
r="${1:?role}"
for acc in $(baoc list -format=json "auth/approle/role/$r/secret-id" 2>/dev/null | python3 -c "import sys,json; print(' '.join(json.load(sys.stdin)))" 2>/dev/null || true); do
baoc write "auth/approle/role/$r/secret-id-accessor/destroy" secret_id_accessor="$acc" >/dev/null
done
baoc lease revoke -prefix auth/approle/login >/dev/null 2>&1 || true
echo "identity $r revoked (SecretIDs destroyed, login tokens revoked)"