forked from mtusi2026/mtusi2026lab7
This commit is contained in:
@@ -21,8 +21,10 @@ fi
|
||||
|
||||
"$script_dir/openbao-seed.sh" "$env_file"
|
||||
compose up -d security-bootstrap openbao-permissions openbao
|
||||
openbao_address=$(compose port openbao 8200)
|
||||
BAO_ADDR="https://$openbao_address"
|
||||
if [ -z "${BAO_ADDR:-}" ]; then
|
||||
openbao_address=$(compose port openbao 8200)
|
||||
BAO_ADDR="https://$openbao_address"
|
||||
fi
|
||||
BAO_CACERT="$repo_dir/.runtime/security/openbao/ca.crt"
|
||||
export BAO_ADDR BAO_CACERT ENV_FILE="$env_file"
|
||||
|
||||
|
||||
@@ -56,8 +56,10 @@ mkdir -p "$runtime_dir"
|
||||
chmod 0700 "$repo_dir/.runtime/evidence" "$runtime_dir"
|
||||
trap restore EXIT HUP INT TERM
|
||||
|
||||
openbao_address=$(compose port openbao 8200)
|
||||
BAO_ADDR="https://$openbao_address"
|
||||
if [ -z "${BAO_ADDR:-}" ]; then
|
||||
openbao_address=$(compose port openbao 8200)
|
||||
BAO_ADDR="https://$openbao_address"
|
||||
fi
|
||||
BAO_CACERT="$repo_dir/.runtime/security/openbao/ca.crt"
|
||||
export BAO_ADDR BAO_CACERT
|
||||
|
||||
|
||||
@@ -90,4 +90,3 @@ done
|
||||
"$script_dir/openbao-issue-approle.sh" worker "$openbao_runtime_dir/approle/worker"
|
||||
|
||||
echo "OpenBao policies, AppRoles and KV v2 secrets configured"
|
||||
|
||||
|
||||
@@ -30,7 +30,9 @@ require_file() {
|
||||
|
||||
require_private_file() {
|
||||
require_file "$1"
|
||||
permissions=$(stat -f '%Lp' "$1" 2>/dev/null || stat -c '%a' "$1")
|
||||
if ! permissions=$(stat -c '%a' "$1" 2>/dev/null); then
|
||||
permissions=$(stat -f '%Lp' "$1")
|
||||
fi
|
||||
case "$permissions" in
|
||||
600|400) ;;
|
||||
*) fail "file must have permissions 0600 or 0400: $1" ;;
|
||||
@@ -88,4 +90,3 @@ require_unsealed() {
|
||||
[ "$initialized" = "true" ] || fail "OpenBao is not initialized"
|
||||
[ "$sealed" = "false" ] || fail "OpenBao is sealed"
|
||||
}
|
||||
|
||||
|
||||
@@ -43,4 +43,3 @@ mv "$init_file" "$openbao_operator_file"
|
||||
|
||||
echo "OpenBao initialized; operator material saved to .runtime/openbao/operator/init.json"
|
||||
echo "Keep this file offline and run scripts/openbao-unseal.sh"
|
||||
|
||||
|
||||
@@ -84,4 +84,3 @@ if [ "$output_dir" = "$openbao_runtime_dir/approle/$service" ]; then
|
||||
fi
|
||||
|
||||
echo "issued short-lived AppRole credentials for $service in ${output_dir#"$repo_dir/"}"
|
||||
|
||||
|
||||
@@ -39,4 +39,3 @@ PY
|
||||
"$script_dir/openbao-issue-approle.sh" "$service" "$openbao_runtime_dir/approle/$service"
|
||||
|
||||
echo "$service secret rotated; OpenBao Agent will render the new KV version"
|
||||
|
||||
|
||||
@@ -137,4 +137,3 @@ expect_status worker GET sys/policies/acl 403
|
||||
expect_status worker POST auth/token/renew-self 200 '{}'
|
||||
|
||||
echo "OpenBao AppRole allow/deny and renewal checks passed"
|
||||
|
||||
|
||||
@@ -48,4 +48,3 @@ openbao_status "$status_file"
|
||||
[ "$(json_field "$status_file" sealed)" = "false" ] || fail "OpenBao remains sealed"
|
||||
|
||||
echo "OpenBao unsealed"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user