Files
mtusi2026lab7/security-tests/run_in_net.sh
T
ALMiron 912a874f00
Skeleton contracts / contracts (pull_request) Blocked by required conditions
lab 7 openbao
2026-11-23 14:39:13 +03:00

10 lines
716 B
Bash

#!/bin/sh
# Run a security test script INSIDE the backend network using the application image (all client libraries present).
# Usage: security-tests/run_in_net.sh <script.py> [args]. ./secrets/pki is mounted read-only (operator test only, never part of the stand).
set -eu
cd "$(dirname "$0")/.."
script="$1"; shift
exec docker run --rm --network mtusi-lab7_backend --user 10001:10001 --read-only --cap-drop ALL --security-opt no-new-privileges:true \
-v "$PWD/security-tests:/t:ro" -v "$PWD/secrets/pki:/pki:ro" -v "$PWD/secrets/approle/worker:/approle:ro" -v "$PWD/secrets/ops:/ops:ro" \
-e BAO_ADDR=https://openbao:8200 -e BAO_CACERT=/pki/ca/ca.crt --entrypoint python mtusi-lab7-app:1.0.0 "/t/$script" "$@"