lab7: обязательное mTLS LB->API с allowlist identity (SAN lb), health только на loopback, скрипт отрицательных проверок mtls_check

This commit is contained in:
Alexey Bodanyuk
2026-11-27 16:14:05 +03:00
parent 7c43d31dc7
commit f36da97951
10 changed files with 401 additions and 20 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
# LB -> API mTLS proof: scripts/mtls_check.py in the `edge` network + the API's own record of the
# identity refusals (event mtls_identity_rejected, SAN of the refused client) since the run started.
set -eu
cd "$(dirname "$0")/.."
since="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
rc=0
docker compose run --rm mtls-check 2>/dev/null || rc=$?
echo
echo "API log since $since, identity allowlist refusals (cases 1-2 are dropped by TLS and never logged):"
docker compose logs --no-log-prefix --since "$since" api 2>/dev/null | grep mtls_identity_rejected || echo " (none)"
exit "$rc"