Лабораторная 7: TLS, mTLS и OpenBao
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
2026-11-28 01:28:30 +03:00
parent 20afc2c790
commit 2c2734df60
119 changed files with 8651 additions and 104 deletions
+15 -3
View File
@@ -1,5 +1,17 @@
# Доказательства
# Результаты проверок лабораторной 7
Храните небольшие обезличенные результаты: команды и stdout проверок, JSON/CSV агрегатов нагрузки, EXPLAIN, dashboard JSON, текст разбора отказа. Укажите дату, commit, аппаратные лимиты и профиль нагрузки.
Краткие обезличенные результаты локальных прогонов. Методика и команды находятся в REPORT.md. JSON с boolean-полями фиксирует проверенные assertions, а не исчерпывающий аудит безопасности.
Не добавляйте .env, session tokens, cookies, приватные ключи, credentials, реальные сообщения, raw dumps и signed URLs. Для скриншотов скрывайте секреты. Большие логи/бинарные traces сохраняйте отдельно по правилам преподавателя; одного скриншота без методики недостаточно.
- check.txt, validate.txt, smoke.txt, external-tls.txt — публичные проверки.
- tls-matrix.json — обе API-реплики, identities, TLS, grants/ACL и закрытые plaintext-порты.
- public-security.json — Argon2 budget, legacy rehash, ACL, logout/expiry и общий rate limit.
- lifecycle.json, policy-revocation.json — ротация, отзыв, sealed/restart/expiry и восстановление.
- rotation-recovery.txt, proxy-limits.txt — регрессии частичного сбоя ротации и malformed HTTP length.
- observability-tls.json — сквозные telemetry по mTLS и поиск credential canaries.
- persistence.txt, public-failover.txt, failover-each.json — реальные инфраструктурные действия.
- hardening.json, environment.txt, resources.txt — действующая конфигурация и среда.
- load.json — короткий closed-loop контрольный прогон; не capacity proof.
- dependency-scan.txt — Python inventory audit; полные JSON и image OSV inventory находятся в security/.
- secret-scan.json — поиск точных текущих операторских значений в исходниках/результатах; не универсальный secret scanner.
Не добавлять сюда сертификаты с private keys, токены, пароли, необработанные environment/config dumps или каталог secrets/.
+225
View File
@@ -0,0 +1,225 @@
PASS: local CA, service certificates and CRL ready
PASS: scoped bootstrap inputs generated; private values not printed
Image mtusi-lab7-s3:2025-09-07 Building
Image mtusi-lab7-api:local Building
#1 [internal] load local bake definitions
#1 reading from stdin 1.13kB done
#1 DONE 0.0s
#2 [api-a internal] load build definition from Dockerfile
#2 DONE 0.0s
#3 [s3 internal] load build definition from Dockerfile.s3
#3 transferring dockerfile: 1.01kB done
#3 DONE 0.0s
#2 [api-a internal] load build definition from Dockerfile
#2 transferring dockerfile: 2.37kB done
#2 DONE 0.0s
#4 [s3 internal] load metadata for docker.io/library/python:3.12-slim-bookworm@sha256:392307d22300de8b5986851a12d9176dfc0fc073e65bf6523ebd7dcbeb23564e
#4 DONE 0.1s
#5 [s3 internal] load metadata for public.ecr.aws/docker/library/golang:1.24.2-alpine@sha256:7772cb5322baa875edd74705556d08f0eeca7b9c4b5367754ce3f2f00041ccee
#5 DONE 0.1s
#6 [s3 internal] load .dockerignore
#6 transferring context: 196B done
#6 DONE 0.0s
#7 [s3 build 1/7] FROM public.ecr.aws/docker/library/golang:1.24.2-alpine@sha256:7772cb5322baa875edd74705556d08f0eeca7b9c4b5367754ce3f2f00041ccee
#7 resolve public.ecr.aws/docker/library/golang:1.24.2-alpine@sha256:7772cb5322baa875edd74705556d08f0eeca7b9c4b5367754ce3f2f00041ccee done
#7 DONE 0.0s
#8 [api-a 1/8] FROM docker.io/library/python:3.12-slim-bookworm@sha256:392307d22300de8b5986851a12d9176dfc0fc073e65bf6523ebd7dcbeb23564e
#8 resolve docker.io/library/python:3.12-slim-bookworm@sha256:392307d22300de8b5986851a12d9176dfc0fc073e65bf6523ebd7dcbeb23564e done
#8 DONE 0.0s
#9 [api-a internal] load build context
#9 transferring context: 1.49kB done
#9 DONE 0.0s
#10 [api-a 6/8] COPY --chown=10001:10001 src/ /app/src/
#10 CACHED
#11 [api-a 2/8] RUN pip install --no-cache-dir psycopg2-binary==2.9.11 redis==7.0.1 bcrypt==4.0.1 boto3==1.42.97 Pillow==13.0.0 pika==1.3.2 opentelemetry-sdk==1.45.2 opentelemetry-exporter-otlp-proto-grpc==1.45.2
#11 CACHED
#12 [api-a 7/8] COPY --chown=10001:10001 migrations/ /app/migrations/
#12 CACHED
#13 [api-a 5/8] WORKDIR /app
#13 CACHED
#14 [api-a 3/8] RUN pip install --no-cache-dir argon2-cffi==25.1.0 cryptography==50.0.0
#14 CACHED
#15 [api-a 4/8] RUN groupadd --gid 10001 app && useradd --uid 10001 --gid 10001 --create-home --shell /usr/sbin/nologin app
#15 CACHED
#16 [api-a 8/8] RUN python -m pip uninstall --yes pip
#16 CACHED
#17 [api-a] exporting to image
#17 exporting layers done
#17 exporting manifest sha256:8a3eb7fcccd8a415a1ce44522e7dfed9ac070dcb4cdc83cf1f0794077ebb1bfe done
#17 exporting config sha256:832882987b7c077fef65baee484a5ebaff0d9cd20fd8b19a3ee8cc7bd4c356c0 done
#17 exporting attestation manifest sha256:c9cd58a69d84ebe0335ed152c2e6c855d6ecec5f2bc0dad4777f6fc2cb3714d4 done
#17 exporting manifest list sha256:e9e955609c760a352001a83e990f08b7e707b65c3cc4877314e5a93fecd29906 done
#17 naming to docker.io/library/mtusi-lab7-api:local done
#17 unpacking to docker.io/library/mtusi-lab7-api:local done
#17 DONE 0.0s
#18 [api-a] resolving provenance for metadata file
#18 DONE 0.0s
#19 [s3 build 3/7] ADD https://codeload.github.com/minio/minio/tar.gz/refs/tags/RELEASE.2025-09-07T16-13-09Z /tmp/minio.tar.gz
#19 DONE 0.4s
#20 [s3 build 6/7] ADD https://codeload.github.com/minio/mc/tar.gz/refs/tags/RELEASE.2025-08-13T08-35-41Z /tmp/mc.tar.gz
#20 DONE 0.4s
#21 [s3 build 2/7] WORKDIR /src/minio
#21 CACHED
#22 [s3 build 7/7] RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build tar -xzf /tmp/mc.tar.gz --strip-components=1 && go build -o /out/mc .
#22 CACHED
#23 [s3 build 3/7] ADD https://codeload.github.com/minio/minio/tar.gz/refs/tags/RELEASE.2025-09-07T16-13-09Z /tmp/minio.tar.gz
#23 CACHED
#24 [s3 build 5/7] WORKDIR /src/mc
#24 CACHED
#25 [s3 build 6/7] ADD https://codeload.github.com/minio/mc/tar.gz/refs/tags/RELEASE.2025-08-13T08-35-41Z /tmp/mc.tar.gz
#25 CACHED
#26 [s3 build 4/7] RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build tar -xzf /tmp/minio.tar.gz --strip-components=1 && go build -o /out/minio .
#26 CACHED
#27 [s3 stage-1 2/2] COPY --from=build /out/minio /out/mc /usr/local/bin/
#27 CACHED
#28 [s3] exporting to image
#28 exporting layers done
#28 exporting manifest sha256:09e96eff66f57826f01c211981257c9743afd7381577251d4310852640ee3dab done
#28 exporting config sha256:a20b875dffd87ee3cd652ae2e21f5b8383ea58602f1e8259588d1593303213d7 done
#28 exporting attestation manifest sha256:b514f998b4ef56d7728f121a4f5f082a07d3dcc2d5952cc7887ce961af5dd2cc done
#28 exporting manifest list sha256:540da36776c883c83a3fa7311838914be54f465471aa480b058e892e67bf4c35 done
#28 naming to docker.io/library/mtusi-lab7-s3:2025-09-07 done
#28 unpacking to docker.io/library/mtusi-lab7-s3:2025-09-07 done
#28 DONE 0.0s
#29 [s3] resolving provenance for metadata file
#29 DONE 0.0s
Image mtusi-lab7-api:local Built
Image mtusi-lab7-s3:2025-09-07 Built
Container mtusi-lab7-prometheus-1 Recreate
Container mtusi-lab7-loki-1 Recreate
Container mtusi-lab7-tempo-1 Recreate
Container mtusi-lab7-grafana-1 Recreate
Container mtusi-lab7-openbao-1 Recreate
Container mtusi-lab7-redis-1 Recreate
Container mtusi-lab7-s3-1 Recreate
Container mtusi-lab7-rabbitmq-1 Recreate
Container mtusi-lab7-otel-collector-1 Recreate
Container mtusi-lab7-postgres-1 Recreate
Container mtusi-lab7-otel-collector-1 Recreated
Container mtusi-lab7-otel-collector-tls-1 Recreate
Container mtusi-lab7-s3-1 Recreated
Container mtusi-lab7-prometheus-1 Recreated
Container mtusi-lab7-prometheus-tls-1 Recreate
Container mtusi-lab7-redis-1 Recreated
Container mtusi-lab7-grafana-1 Recreated
Container mtusi-lab7-openbao-1 Recreated
Container mtusi-lab7-postgres-1 Recreated
Container mtusi-lab7-tempo-1 Recreated
Container mtusi-lab7-tempo-tls-1 Recreate
Container mtusi-lab7-loki-1 Recreated
Container mtusi-lab7-loki-tls-1 Recreate
Container mtusi-lab7-otel-collector-tls-1 Recreated
Container mtusi-lab7-prometheus-tls-1 Recreated
Container mtusi-lab7-rabbitmq-1 Recreated
Container mtusi-lab7-tempo-tls-1 Recreated
Container mtusi-lab7-loki-tls-1 Recreated
Container mtusi-lab7-s3-1 Starting
Container mtusi-lab7-postgres-1 Starting
Container mtusi-lab7-prometheus-1 Starting
Container mtusi-lab7-loki-1 Starting
Container mtusi-lab7-openbao-1 Starting
Container mtusi-lab7-redis-1 Starting
Container mtusi-lab7-tempo-1 Starting
Container mtusi-lab7-otel-collector-1 Starting
Container mtusi-lab7-grafana-1 Starting
Container mtusi-lab7-rabbitmq-1 Starting
Container mtusi-lab7-otel-collector-1 Started
Container mtusi-lab7-otel-collector-tls-1 Starting
Container mtusi-lab7-s3-1 Started
Container mtusi-lab7-prometheus-1 Started
Container mtusi-lab7-prometheus-tls-1 Starting
Container mtusi-lab7-otel-collector-tls-1 Started
Container mtusi-lab7-postgres-1 Started
Container mtusi-lab7-prometheus-tls-1 Started
Container mtusi-lab7-rabbitmq-1 Started
Container mtusi-lab7-redis-1 Started
Container mtusi-lab7-openbao-1 Started
Container mtusi-lab7-tempo-1 Started
Container mtusi-lab7-tempo-tls-1 Starting
Container mtusi-lab7-loki-1 Started
Container mtusi-lab7-loki-tls-1 Starting
Container mtusi-lab7-grafana-1 Started
Container mtusi-lab7-tempo-tls-1 Started
Container mtusi-lab7-loki-tls-1 Started
PASS: OpenBao initialized/unsealed; scoped cert roles and KV configured
Container mtusi-lab7-migrate-run-b033a2d7c6bf Creating
Container mtusi-lab7-migrate-run-b033a2d7c6bf Created
PASS: migrations applied
Container mtusi-lab7-setup-db-run-68b2b6d0a482 Creating
Container mtusi-lab7-setup-db-run-68b2b6d0a482 Created
PASS: separate database roles and grants applied
Container mtusi-lab7-s3-bootstrap-run-26c071d8ead2 Creating
Container mtusi-lab7-s3-bootstrap-run-26c071d8ead2 Created
PASS: private bucket and prefix-scoped S3 roles configured
Importing definitions in JSON from a file at "/run/bootstrap/rabbitmq.json" ...
Successfully started definition import. This process is asynchronous and can take some time. Watch target node logs for completion.
Container mtusi-lab7-postgres-1 Running
Container mtusi-lab7-openbao-1 Running
Container mtusi-lab7-api-b-1 Recreate
Container mtusi-lab7-outbox-publisher-1 Recreate
Container mtusi-lab7-attachment-cleaner-1 Recreate
Container mtusi-lab7-api-a-1 Recreate
Container mtusi-lab7-worker-1 Recreate
Container mtusi-lab7-outbox-publisher-1 Recreated
Container mtusi-lab7-attachment-cleaner-1 Recreated
Container mtusi-lab7-api-b-1 Recreated
Container mtusi-lab7-worker-1 Recreated
Container mtusi-lab7-api-a-1 Recreated
Container mtusi-lab7-nginx-1 Recreate
Container mtusi-lab7-nginx-1 Recreated
Container mtusi-lab7-postgres-1 Waiting
Container mtusi-lab7-postgres-1 Waiting
Container mtusi-lab7-postgres-1 Waiting
Container mtusi-lab7-postgres-1 Waiting
Container mtusi-lab7-postgres-1 Waiting
Container mtusi-lab7-postgres-1 Healthy
Container mtusi-lab7-postgres-1 Healthy
Container mtusi-lab7-worker-1 Starting
Container mtusi-lab7-postgres-1 Healthy
Container mtusi-lab7-api-a-1 Starting
Container mtusi-lab7-postgres-1 Healthy
Container mtusi-lab7-attachment-cleaner-1 Starting
Container mtusi-lab7-postgres-1 Healthy
Container mtusi-lab7-api-b-1 Starting
Container mtusi-lab7-outbox-publisher-1 Starting
Container mtusi-lab7-api-a-1 Started
Container mtusi-lab7-attachment-cleaner-1 Started
Container mtusi-lab7-api-b-1 Started
Container mtusi-lab7-api-a-1 Waiting
Container mtusi-lab7-api-b-1 Waiting
Container mtusi-lab7-outbox-publisher-1 Started
Container mtusi-lab7-worker-1 Started
Container mtusi-lab7-api-a-1 Healthy
Container mtusi-lab7-api-b-1 Healthy
Container mtusi-lab7-nginx-1 Starting
Container mtusi-lab7-nginx-1 Started
PASS verified HTTPS API and Grafana ready
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
+5
View File
@@ -0,0 +1,5 @@
/Users/atmose/Documents/Labs_and_etc/ВП/mtusi2026lab7-fork/.venv/lib/python3.9/site-packages/urllib3/__init__.py:35: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
warnings.warn(
WARNING:pip_audit._cli:--no-deps is supported, but users are encouraged to fully hash their pinned dependencies
WARNING:pip_audit._cli:Consider using a tool like `pip-compile`: https://pip-tools.readthedocs.io/en/latest/#using-hashes
No known vulnerabilities found
+4
View File
@@ -0,0 +1,4 @@
macOS-27.2.1-arm64-arm-64bit
arm64
29.5.3
CPUs=10 MemoryBytes=8321515520
+2
View File
@@ -0,0 +1,2 @@
python3 tests/security.py --base-url "https://localhost:8443" --ca-file "/Users/atmose/Documents/Labs_and_etc/ВП/mtusi2026lab7-fork/secrets/ca/ca.crt"
PASS: trusted HTTPS works; untrusted CA rejected. This does NOT verify internal mTLS, OpenBao or hardening.
+20
View File
@@ -0,0 +1,20 @@
{
"api-a": {
"actual_container_stopped": true,
"existing_session_and_message_preserved": true,
"original_image_identical": true,
"surviving_instances": 1,
"first_success_seconds": 1.91,
"failed_attempts": 1,
"successful_writes": 19
},
"api-b": {
"actual_container_stopped": true,
"existing_session_and_message_preserved": true,
"original_image_identical": true,
"surviving_instances": 1,
"first_success_seconds": 2.11,
"failed_attempts": 1,
"successful_writes": 19
}
}
+20
View File
@@ -0,0 +1,20 @@
api-a running healthy
api-b running healthy
attachment-cleaner running
grafana running
loki running
loki-tls running
nginx running healthy
openbao running
otel-collector running
otel-collector-tls running
outbox-publisher running
postgres running healthy
prometheus running
prometheus-tls running
rabbitmq running healthy
redis running
s3 running
tempo running
tempo-tls running
worker running
+455
View File
@@ -0,0 +1,455 @@
[
{
"service": "api-a",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 268435456,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/ca",
"/run/tls"
]
},
{
"service": "api-b",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 268435456,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/ca",
"/run/tls"
]
},
{
"service": "attachment-cleaner",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.25,
"memory_bytes": 134217728,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/ca",
"/run/tls"
]
},
{
"service": "grafana",
"user": "472",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 268435456,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/var/lib/grafana",
"/etc/grafana/provisioning/dashboards",
"/var/lib/grafana/dashboards",
"/etc/grafana/provisioning/datasources/sources.yaml",
"/run/bootstrap/grafana_password",
"/run/ca",
"/run/tls"
]
},
{
"service": "loki",
"user": "10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 402653184,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/ca",
"/run/tls",
"/etc/loki/loki.yaml",
"/loki"
]
},
{
"service": "loki-tls",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 134217728,
"privileged": false,
"network_mode": "container:e451567164e71b9bbbdc648bf642fcf2e4e3e46cea8826c11c8ba9a4b73822a0",
"mount_destinations": [
"/run/ca",
"/run/tls"
]
},
{
"service": "nginx",
"user": "101:101",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 134217728,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/etc/nginx/lab",
"/run/ca",
"/run/tls",
"/etc/nginx/nginx.conf"
]
},
{
"service": "openbao",
"user": "",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 268435456,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/tls",
"/bao/data",
"/bao/config/config.hcl",
"/run/ca",
"/openbao/file",
"/openbao/logs"
]
},
{
"service": "otel-collector",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 201326592,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/etc/otel/collector.yaml",
"/run/ca",
"/run/tls"
]
},
{
"service": "otel-collector-tls",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 134217728,
"privileged": false,
"network_mode": "container:97e163a554a44fcc90d4f9174d7126ee21551eba2718581560d149fb1afbe29b",
"mount_destinations": [
"/run/ca",
"/run/tls"
]
},
{
"service": "outbox-publisher",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 134217728,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/ca",
"/run/tls"
]
},
{
"service": "postgres",
"user": "",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": [
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FOWNER",
"CAP_SETGID",
"CAP_SETUID"
],
"cpu": 1.0,
"memory_bytes": 536870912,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/ca",
"/run/tls",
"/run/bootstrap/postgres_password",
"/postgres-entry.sh",
"/etc/postgresql/pg_hba.conf",
"/var/lib/postgresql/data"
]
},
{
"service": "prometheus",
"user": "nobody",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 402653184,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/ca",
"/run/tls",
"/prometheus",
"/etc/prometheus"
]
},
{
"service": "prometheus-tls",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 134217728,
"privileged": false,
"network_mode": "container:1c0e702ccade4a8cdc09d29a37717597527a6b197574809ae52746107c36a6ac",
"mount_destinations": [
"/run/ca",
"/run/tls"
]
},
{
"service": "rabbitmq",
"user": "",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": [
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FOWNER",
"CAP_SETGID",
"CAP_SETUID"
],
"cpu": 0.5,
"memory_bytes": 402653184,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/tls",
"/etc/rabbitmq/enabled_plugins",
"/etc/rabbitmq/inetrc",
"/var/lib/rabbitmq",
"/etc/rabbitmq/rabbitmq.conf",
"/run/bootstrap/rabbitmq.json",
"/run/bootstrap/rabbitmq_password",
"/run/ca"
]
},
{
"service": "redis",
"user": "",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": [
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FOWNER",
"CAP_SETGID",
"CAP_SETUID"
],
"cpu": 0.25,
"memory_bytes": 134217728,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/ca",
"/run/tls",
"/data",
"/etc/redis.conf"
]
},
{
"service": "s3",
"user": "",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": [
"CAP_DAC_OVERRIDE"
],
"cpu": 0.5,
"memory_bytes": 402653184,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/certs/CAs/ca.crt",
"/data",
"/run/bootstrap/s3_root_password",
"/certs/public.crt",
"/certs/private.key"
]
},
{
"service": "tempo",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 402653184,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/tls",
"/etc/tempo/tempo.yaml",
"/var/tempo",
"/run/ca"
]
},
{
"service": "tempo-tls",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 0.5,
"memory_bytes": 134217728,
"privileged": false,
"network_mode": "container:ae5dedceb72fbb4ea9ff769f1fd8c30eb7aed2a3728553c3e20057bddb3bee3b",
"mount_destinations": [
"/run/tls",
"/run/ca"
]
},
{
"service": "worker",
"user": "10001:10001",
"read_only": true,
"security_opt": [
"no-new-privileges:true"
],
"cap_drop": [
"ALL"
],
"cap_add": null,
"cpu": 1.0,
"memory_bytes": 805306368,
"privileged": false,
"network_mode": "mtusi-lab7_backend",
"mount_destinations": [
"/run/tls",
"/run/ca"
]
}
]
+1
View File
@@ -0,0 +1 @@
PASS image inventory audited: 73 source packages; 32 with findings
+21
View File
@@ -0,0 +1,21 @@
{
"worker_secret_rotation": {
"retired_password_denied_new_connection": true,
"new_password_works": true,
"attachment_ready": true
},
"leaf_rotation": {
"revoked_old_leaf_denied_new_connection": true,
"replacement_accepted": true,
"images_unchanged": true,
"existing_collector_connection_max_age_seconds": 60
},
"sealed_expiry": {
"api_failed_closed_after_seconds": 59.55,
"restart_while_sealed_opened_no_listener": true,
"unrenewed_service_token_expired": true,
"recovered_after_operator_unseal": true,
"existing_bearer_session_preserved": true,
"openbao_restart_preserved_scoped_configuration": true
}
}
+17
View File
@@ -0,0 +1,17 @@
{
"lab": 7,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.024,
"concurrency": 4,
"successful_requests": 7142,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 237.879,
"successful_latency_ms": {
"p50": 11.784,
"p95": 44.142,
"p99": 61.951
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+25
View File
@@ -0,0 +1,25 @@
{
"trace_id": "d79a539e9abb4b0ab9e0eeb91ef88c25",
"span_names": [
"postgresql.transaction",
"postgresql.transaction",
"postgresql.transaction",
"postgresql.transaction",
"s3.put",
"postgresql.transaction",
"POST /api/v1/chats/{chat_id}/attachments",
"postgresql.transaction",
"s3.download",
"s3.put",
"s3.put",
"s3.put",
"s3.put",
"postgresql.transaction",
"attachment.consume",
"attachment.publish"
],
"all_three_log_services": true,
"prometheus_scrapes_tls": true,
"grafana_panels": 14,
"body_token_absent_from_logs": true
}
+3
View File
@@ -0,0 +1,3 @@
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "https://localhost:8443" --ca-file "/Users/atmose/Documents/Labs_and_etc/ВП/mtusi2026lab7-fork/secrets/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.
+5
View File
@@ -0,0 +1,5 @@
{
"kv_policy_revoked_api_stopped_seconds": 1.58,
"renew_self_did_not_extend_cache": true,
"recovered_after_policy_restore": true
}
+1
View File
@@ -0,0 +1 @@
PASS: negative, nonnumeric and duplicate Content-Length rejected before reading
+4
View File
@@ -0,0 +1,4 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "https://localhost:8443" --ca-file "/Users/atmose/Documents/Labs_and_etc/ВП/mtusi2026lab7-fork/secrets/ca/ca.crt"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 118, "failed_attempts": 0, "first_recovery_seconds": 1.093}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+20
View File
@@ -0,0 +1,20 @@
{
"attachment_acl_and_identity_spoof": true,
"kdf_budget": {
"argon2_memory_kib": 19456,
"iterations": 2,
"parallelism": 1,
"samples": 12,
"median_ms": 12.017375000141328,
"max_ms": 77.31487499995637,
"max_concurrent_per_api": 2
},
"legacy_rehash": true,
"session_expiry_logout": true,
"global_login_rate_limit": {
"replicas": 2,
"limited_requests": 8,
"requests": 38,
"limit": "30 per 10 seconds"
}
}
+24
View File
@@ -0,0 +1,24 @@
mtusi-lab7-nginx-1 CPU=3.68% RAM=3.898MiB / 128MiB
mtusi-lab7-outbox-publisher-1 CPU=0.75% RAM=48.88MiB / 128MiB
mtusi-lab7-api-a-1 CPU=2.11% RAM=92.81MiB / 256MiB
mtusi-lab7-worker-1 CPU=0.13% RAM=77.5MiB / 768MiB
mtusi-lab7-attachment-cleaner-1 CPU=0.01% RAM=70.2MiB / 128MiB
mtusi-lab7-api-b-1 CPU=2.00% RAM=93.93MiB / 256MiB
mtusi-lab7-loki-tls-1 CPU=0.30% RAM=13.79MiB / 128MiB
mtusi-lab7-tempo-tls-1 CPU=0.04% RAM=14.95MiB / 128MiB
mtusi-lab7-rabbitmq-1 CPU=36.62% RAM=89.79MiB / 384MiB
mtusi-lab7-postgres-1 CPU=1.16% RAM=44.19MiB / 512MiB
mtusi-lab7-prometheus-tls-1 CPU=0.01% RAM=12.71MiB / 128MiB
mtusi-lab7-otel-collector-tls-1 CPU=0.35% RAM=18.88MiB / 128MiB
mtusi-lab7-grafana-1 CPU=0.14% RAM=89.24MiB / 256MiB
mtusi-lab7-redis-1 CPU=0.38% RAM=9.863MiB / 128MiB
mtusi-lab7-openbao-1 CPU=0.26% RAM=26.7MiB / 256MiB
mtusi-lab7-loki-1 CPU=0.53% RAM=101.1MiB / 384MiB
mtusi-lab7-prometheus-1 CPU=0.19% RAM=46.43MiB / 384MiB
mtusi-lab7-s3-1 CPU=0.11% RAM=345.1MiB / 384MiB
mtusi-lab7-tempo-1 CPU=0.08% RAM=381.5MiB / 384MiB
mtusi-lab7-otel-collector-1 CPU=1.06% RAM=162.5MiB / 192MiB
mtusi-lab5-worker-1 CPU=0.00% RAM=0B / 0B
mtusi-lab5-outbox-publisher-1 CPU=0.00% RAM=0B / 0B
mtusi-lab5-attachment-cleaner-1 CPU=0.00% RAM=0B / 0B
mtusi-lab4-attachment-cleaner-1 CPU=0.00% RAM=0B / 0B
+3
View File
@@ -0,0 +1,3 @@
PASS: worker DB password and scoped KV rotated
PASS: worker DB password and scoped KV rotated
PASS: committed-timeout reconciled; unknown outcome resumes saved target
+15
View File
@@ -0,0 +1,15 @@
{
"files_checked": 150,
"operator_values_checked": 22,
"matches": 0,
"exclusions": [
"secrets",
".env",
".git",
".venv",
"certs",
"__pycache__",
"node_modules"
],
"scope": "Exact current operator credential values; not a universal secret detector"
}
+2
View File
@@ -0,0 +1,2 @@
python3 tests/smoke.py --base-url "https://localhost:8443" --ca-file "/Users/atmose/Documents/Labs_and_etc/ВП/mtusi2026lab7-fork/secrets/ca/ca.crt"
PASS: lab7 public API scenario; infrastructure and grading evidence remain separate.
+54
View File
@@ -0,0 +1,54 @@
docker compose --profile operator run --rm --no-deps -v "/Users/atmose/Documents/Labs_and_etc/ВП/mtusi2026lab7-fork:/workspace:ro" migrate python /workspace/student-tests/internal_security.py
{
"api-a_correct_lb_identity": true,
"api-a_reject_None": true,
"api-a_reject_intruder": true,
"api-a_reject_expired": true,
"api-a_reject_worker": true,
"api-a_foreign_ca": true,
"api-b_correct_lb_identity": true,
"api-b_reject_None": true,
"api-b_reject_intruder": true,
"api-b_reject_expired": true,
"api-b_reject_worker": true,
"api-b_foreign_ca": true,
"external_wrong_hostname": true,
"collector_distinct_allowed_identities": true,
"collector_reject_None": true,
"collector_reject_intruder": true,
"collector_reject_expired": true,
"collector_reject_nginx": true,
"collector_reject_foreign": true,
"broker_distinct_allowed_identities": true,
"broker_reject_None": true,
"broker_reject_intruder": true,
"broker_reject_api-a": true,
"broker_reject_expired": true,
"broker_reject_foreign": true,
"worker_cannot_publish": true,
"postgres_all_roles_verified_tls": true,
"historical_broad_grants_removed": true,
"worker_cannot_read_users": true,
"api_cannot_write_final": true,
"worker_cannot_write_staging": true,
"s3_prefix_acl": true,
"redis_config_denied": true,
"redis_tls_acl": true,
"openbao_api_allow_deny": true,
"openbao_worker_allow_deny": true,
"openbao_wrong_identity_denied": true,
"prometheus_intruder_denied": true,
"loki_intruder_denied": true,
"tempo_intruder_denied": true,
"loki_writer_read_denied": true,
"grafana_log_ingest_denied": true,
"rabbitmq_5672_plaintext_loopback_only": true,
"rabbitmq_15692_plaintext_loopback_only": true,
"rabbitmq_15672_plaintext_loopback_only": true,
"rabbitmq_25672_plaintext_loopback_only": true,
"rabbitmq_4369_plaintext_loopback_only": true,
"otel-collector_43170_plaintext_loopback_only": true,
"loki_13100_plaintext_loopback_only": true,
"tempo_13200_plaintext_loopback_only": true,
"prometheus_19090_plaintext_loopback_only": true
}
+53
View File
@@ -0,0 +1,53 @@
{
"api-a_correct_lb_identity": true,
"api-a_reject_None": true,
"api-a_reject_intruder": true,
"api-a_reject_expired": true,
"api-a_reject_worker": true,
"api-a_foreign_ca": true,
"api-b_correct_lb_identity": true,
"api-b_reject_None": true,
"api-b_reject_intruder": true,
"api-b_reject_expired": true,
"api-b_reject_worker": true,
"api-b_foreign_ca": true,
"external_wrong_hostname": true,
"collector_distinct_allowed_identities": true,
"collector_reject_None": true,
"collector_reject_intruder": true,
"collector_reject_expired": true,
"collector_reject_nginx": true,
"collector_reject_foreign": true,
"broker_distinct_allowed_identities": true,
"broker_reject_None": true,
"broker_reject_intruder": true,
"broker_reject_api-a": true,
"broker_reject_expired": true,
"broker_reject_foreign": true,
"worker_cannot_publish": true,
"postgres_all_roles_verified_tls": true,
"historical_broad_grants_removed": true,
"worker_cannot_read_users": true,
"api_cannot_write_final": true,
"worker_cannot_write_staging": true,
"s3_prefix_acl": true,
"redis_config_denied": true,
"redis_tls_acl": true,
"openbao_api_allow_deny": true,
"openbao_worker_allow_deny": true,
"openbao_wrong_identity_denied": true,
"prometheus_intruder_denied": true,
"loki_intruder_denied": true,
"tempo_intruder_denied": true,
"loki_writer_read_denied": true,
"grafana_log_ingest_denied": true,
"rabbitmq_5672_plaintext_loopback_only": true,
"rabbitmq_15692_plaintext_loopback_only": true,
"rabbitmq_15672_plaintext_loopback_only": true,
"rabbitmq_25672_plaintext_loopback_only": true,
"rabbitmq_4369_plaintext_loopback_only": true,
"otel-collector_43170_plaintext_loopback_only": true,
"loki_13100_plaintext_loopback_only": true,
"tempo_13200_plaintext_loopback_only": true,
"prometheus_19090_plaintext_loopback_only": true
}
+2
View File
@@ -0,0 +1,2 @@
.venv/bin/python scripts/validate_openapi.py
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.