thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make check python3 scripts/check_contract.py PASS: offline skeleton structure, local refs and Python syntax; application NOT tested. thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make validate python3 scripts/validate_openapi.py PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested. thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make up sh scripts/up.sh bootstrap done (PKI, passwords, Redis ACL). Next: scripts/up.sh [+] Running 8/8 ✔ openbao Pulled 13.8s [+] Running 6/7 [+] Running 9/9i-lab7_backend Created 0.2s ✔ Network mtusi-lab7_backend Created 0.2s ✔ Volume "mtusi-lab7_grafana_data" Created 0.1s [+] Running 9/10-lab7_bao_data" Created 0.0s ✔ Network mtusi-lab7_backend Created 0.2s ✔ Volume "mtusi-lab7_grafana_data" Created 0.1s ✔ Volume "mtusi-lab7_bao_data" Created 0.0s [+] Running 9/10-lab7_redis_data" Created 0.0s ✔ Network mtusi-lab7_backend Created 0.2s ✔ Volume "mtusi-lab7_grafana_data" Created 0.1s ✔ Volume "mtusi-lab7_bao_data" thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ curl --cacert secrets/pki/ca/ca.crt https://localhost:8443/health/ready {"status":"ok"}thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make test python3 tests/smoke.py --base-url "https://localhost:8443" --ca-file "/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork/secrets/pki/ca/ca.crt" PASS: lab7 public API scenario; infrastructure and grading evidence remain separate. thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make test-security python3 tests/security.py --base-url "https://localhost:8443" --ca-file "/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork/secrets/pki/ca/ca.crt" PASS: trusted HTTPS works; untrusted CA rejected. This does NOT verify internal mTLS, OpenBao or hardening. thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make test-tls sh security-tests/run_in_net.sh tls_audit.py PASS api: lb identity accepted: HTTP/1.1 200 OK PASS api: no client cert refused: EmptyReply PASS api: foreign-CA cert refused: EmptyReply PASS api: same-CA, wrong identity (outsider) refused: EmptyReply PASS api: worker identity refused: EmptyReply PASS api: client distrusting server CA fails verification: SSLCertVerificationError PASS collector: api identity accepted: HTTP/1.1 404 Not Found PASS collector: worker identity accepted: HTTP/1.1 404 Not Found PASS collector: dispatcher identity accepted: HTTP/1.1 404 Not Found PASS collector: outsider (same root CA, not a workload) refused: SSLError PASS collector: grafana (same root CA, not a workload) refused: SSLError PASS collector: lb (same root CA, not a workload) refused: SSLError PASS collector: no client cert refused: SSLError PASS collector: plaintext refused: TLS_ONLY PASS kafka: dispatcher may produce: OK %0|1795386387.764|FATAL|rdkafka#producer-2| [thrd:main]: Fatal error: Broker: Cluster authorization failed: Failed to acquire idempotence PID from broker ssl://kafka:9092/1: Broker: Cluster authorization failed %4|1795386387.764|TERMINATE|rdkafka#producer-2| [thrd:app]: Producer terminating with 1 message (11 bytes) still in queue or transit: use flush() to wait for outstanding message delivery PASS kafka: worker may NOT produce: KafkaError{FATAL,code=CLUSTER_AUTHORIZATION_FAILED,val=31,str="Failed to acquire idempotence PID from broker ssl://kafka:9092/1: Broker: Cluster authorization failed"} PASS kafka: CA-signed outsider may NOT produce: KafkaError{code=TOPIC_AUTHORIZATION_FAILED,val=29,str="Broker: Topic authorization failed"} PASS kafka: api identity may NOT produce: KafkaError{code=TOPIC_AUTHORIZATION_FAILED,val=29,str="Broker: Topic authorization failed"} PASS kafka: plaintext refused: NoHTTP PASS postgres: foreign CA -> verification error: SSLCertVerificationError PASS redis: foreign CA -> verification error: SSLCertVerificationError PASS s3: foreign CA -> verification error: SSLCertVerificationError PASS openbao: foreign CA -> verification error: SSLCertVerificationError PASS prometheus: foreign CA -> verification error: SSLCertVerificationError PASS loki: foreign CA -> verification error: SSLCertVerificationError PASS tempo: foreign CA -> verification error: SSLCertVerificationError PASS prometheus: no client cert refused (mTLS): SSLError PASS prometheus: client cert accepted: HTTP/1.1 302 Found PASS loki: no client cert refused (mTLS): SSLError PASS loki: client cert accepted: HTTP/1.1 404 Not Found PASS tempo: no client cert refused (mTLS): SSLError PASS tempo: client cert accepted: HTTP/1.1 404 Not Found PASS s3: TLS with verification works: HTTP/1.1 200 OK PASS openbao: TLS with verification works: HTTP/1.1 200 OK PASS redis: plaintext refused: ConnectionResetError PASS s3: plaintext refused: TLS_ONLY PASS openbao: plaintext refused: TLS_ONLY PASS postgres: sslmode=disable refused (pg_hba reject): OperationalError 38/38 probes as expected thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make test-acl python3 security-tests/acl_leak.py --ca-file "/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork/secrets/pki/ca/ca.crt" --grafana-password-file secrets/ops/grafana_admin_password PASS outsider cannot read chat metadata (404) PASS outsider cannot read messages (404) PASS outsider cannot attach a file to a foreign chat (404) PASS forged X-User-Id does not change the Bearer identity (404) PASS X-User-Id alone gives no access (401) PASS logout returns 204 (204) PASS token is dead after logout (401) PASS JSON body over 64 KiB -> 413 (413) PASS canary user registered (201) PASS canary login (201) PASS password and token absent from container logs PASS password and token absent from Loki PASS login: 429 after repeated failures, Retry-After present ([401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 429, 429, 429, 429] retry=59) ALL PASS thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ docker compose run --rm --entrypoint python migrate scripts/argon2_bench.py --runs 20 [+] Creating 1/1 ✔ Container mtusi-lab7-postgres-1 Running 0.0s m=19 MiB t=2 p=1: median 83 ms, p95 94 ms, max logins/s per slot 12.0 m=46 MiB t=1 p=1: median 211 ms, p95 400 ms, max logins/s per slot 4.7 m=64 MiB t=3 p=4: median 609 ms, p95 811 ms, max logins/s per slot 1.6 thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make test-persistence python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "https://localhost:8443" --ca-file "/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork/secrets/pki/ca/ca.crt" Executing explicit persistence hook; hook output suppressed to avoid leaking secrets. PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence. thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make test-failover python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "https://localhost:8443" --ca-file "/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork/secrets/pki/ca/ca.crt" Executing explicit failover hook; hook output suppressed to avoid leaking secrets. {"observed_instances_before": 2, "successful_writes": 100, "failed_attempts": 1, "first_recovery_seconds": 2.785} PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence. thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make test-compromise sh security-tests/run_in_net.sh worker_compromise.py --profile after > evidence/worker-compromise-after.json %5|1795386798.420|PARTCNT|rdkafka#producer-2| [thrd:ssl://kafka:9092/1]: Topic attachment-jobs partition count changed from 3 to 0 PASS: every probe matches the least-privilege expectation sh security-tests/run_in_net.sh worker_compromise.py --profile before > evidence/worker-compromise-before.json thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ make incident docker compose stop worker [+] Stopping 0/1 [+] Stopping 0/1si-lab7-worker-1 Stopping 0.1s [+] Stopping 0/1si-lab7-worker-1 Stopping 0.2s [+] Stopping 0/1si-lab7-worker-1 Stopping 0.3s [+] Stopping 0/1si-lab7-worker-1 Stopping 0.4s [+] Stopping 0/1si-lab7-worker-1 Stopping 0.5s [+] Stopping 0/1si-lab7-worker-1 Stopping 0.6s [+] Stopping 0/1si-lab7-worker-1 Stopping 0.7s [+] Stopping 0/1si-lab7-worker-1 Stopping 0.8s [+] Stopping 0/1si-lab7-worker-1 Stopping 0.9s [+] Stopping 1/1si-lab7-worker-1 Stopping 1.0s ✔ Container mtusi-lab7-worker-1 Stopped 1.1s python3 security-tests/jobs_integrity.py submit --n 10 --ca-file "/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork/secrets/pki/ca/ca.crt" submitted 10 jobs; they stay queued while the worker is stopped sh scripts/incident_worker.sh [+] Stopping 1/1 ✔ Container mtusi-lab7-worker-1 Stopped 0.0s identity worker revoked (SecretIDs destroyed, login tokens revoked) [+] Creating 1/1 ✔ Container mtusi-lab7-postgres-1 Running0.0s [+] Restarting 1/1 ✔ Container mtusi-lab7-worker-1 Started0.5s 4s rotated db-worker; old value is dead in the store, new value lives in OpenBao only; worker restarted [+] Creating 2/2 ✔ Container mtusi-lab7-init_perms-1 Created0.0s ✔ Container mtusi-lab7-s3-1 Running0.0s [+] Running 1/1 ✔ Container mtusi-lab7-init_perms-1 Exited1.4s [+] Restarting 1/1 ✔ Container mtusi-lab7-worker-1 Started30.8s 7s rotated s3-worker; old value is dead in the store, new value lives in OpenBao only; worker restarted issued worker (workload CA, 14 d) secret_id issued for worker [+] Running 1/1 ✔ Container mtusi-lab7-worker-1 Running 0.0s PASS OpenBao: login with OLD SecretID: rejected (expected rejected) PASS PostgreSQL: new connection with OLD role password: rejected (expected rejected) PASS S3: new request with OLD svc-worker secret: rejected (expected rejected) PASS OpenBao: login with NEW SecretID: accepted (expected accepted) PASS PostgreSQL: new connection with NEW role password: accepted (expected accepted) PASS S3: new request with NEW svc-worker secret: accepted (expected accepted) 6/6 probes as expected worker recovered; old credentials are dead on new connections (evidence/revoked-creds.txt) also run: security-tests/run_in_net.sh worker_compromise.py --profile after cd "$PWD" && python3 security-tests/jobs_integrity.py verify --ca-file "/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork/secrets/pki/ca/ca.crt" 10/10 attachments ready; lost=0 thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ for c in $(docker compose ps -q); do docker inspect --format '{{.Name}} priv={{.HostConfig.Privileged}} net={{.HostConfig.NetworkMode}} ro={{.HostConfig.ReadonlyRootfs}} user={{.Config.User}} capdrop={{.HostConfig.CapDrop}} secopt={{.HostConfig.SecurityOpt}}' $c; done /mtusi-lab7-api-1 priv=false net=mtusi-lab7_backend ro=true user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-api-2 priv=false net=mtusi-lab7_backend ro=true user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-dispatcher-1 priv=false net=mtusi-lab7_backend ro=true user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-grafana-1 priv=false net=mtusi-lab7_backend ro=false user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-kafka-1 priv=false net=mtusi-lab7_backend ro=false user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-load_balancer-1 priv=false net=mtusi-lab7_backend ro=true user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-loki-1 priv=false net=mtusi-lab7_backend ro=false user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-openbao-1 priv=false net=mtusi-lab7_backend ro=false user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-otel-collector-1 priv=false net=mtusi-lab7_backend ro=true user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-postgres-1 priv=false net=mtusi-lab7_backend ro=false user= capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-prometheus-1 priv=false net=mtusi-lab7_backend ro=false user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-redis-1 priv=false net=mtusi-lab7_backend ro=true user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-s3-1 priv=false net=mtusi-lab7_backend ro=false user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-s3_sweeper-1 priv=false net=mtusi-lab7_backend ro=true user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-tempo-1 priv=false net=mtusi-lab7_backend ro=false user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] /mtusi-lab7-worker-1 priv=false net=mtusi-lab7_backend ro=true user=10001:10001 capdrop=[ALL] secopt=[no-new-privileges:true] thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ docker compose restart openbao sleep 15 docker compose restart worker sleep 20 docker compose logs worker --tail 8 curl --cacert secrets/pki/ca/ca.crt https://localhost:8443/health/ready sh scripts/bao_unseal.sh sh scripts/bao_secret_id.sh all docker compose restart worker sleep 30 docker compose ps worker [+] Restarting 1/1 ✔ Container mtusi-lab7-openbao-1 Started 0.6s [+] Restarting 1/1 ✔ Container mtusi-lab7-worker-1 Started 1.1s worker-1 | {"timestamp": "2026-11-23T11:14:55.994Z", "severity": "INFO", "service.name": "messenger-worker", "event": "worker_started", "message": "worker 84aa576470e6 started, concurrency=2, max_attempts=5, lease=75s"} {"status":"ok"}OpenBao unsealed secret_id issued for api secret_id issued for worker secret_id issued for dispatcher secret_id issued for sweeper [+] Restarting 1/1 ✔ Container mtusi-lab7-worker-1 Started 0.7s NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS mtusi-lab7-worker-1 mtusi-lab7-app:1.0.0 "python -m src.worker" worker 16 minutes ago Up 30 seconds thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$ thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026la b7-fork$ m ake scan sh scripts/scan.sh Scanning mtusi-lab7-app:1.0.0 ... PASS: mtusi-lab7-app:1.0.0; report saved to evidence/trivy-mtusi-lab7-app_1.0.0.txt Scanning openbao/openbao:2.4.1 ... PASS: openbao/openbao:2.4.1; report saved to evidence/trivy-openbao_openbao_2.4.1.txt Scanning redis:7.4.2-alpine ... PASS: redis:7.4.2-alpine; report saved to evidence/trivy-redis_7.4.2-alpine.txt Scanning postgres:17.6-alpine ... PASS: postgres:17.6-alpine; report saved to evidence/trivy-postgres_17.6-alpine.txt Scanning haproxy:3.2.5-alpine ... PASS: haproxy:3.2.5-alpine; report saved to evidence/trivy-haproxy_3.2.5-alpine.txt scan finished: evidence/pip-audit.txt, evidence/trivy-*.txt thereal_alyoname@DESKTOP-8Q26HPT:/mnt/c/Users/User/Desktop/MTUCI/4_course/highload_apps/lab7/mtusi2026lab7-fork$