#!/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 [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" "$@"