[+] lab7
Grade 3 secure application acceptance / secure (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Xabenskie
2026-11-30 09:09:57 +03:00
parent 20afc2c790
commit 4eca49fe3d
149 changed files with 68317 additions and 58 deletions
+3
View File
@@ -18,3 +18,6 @@ __pycache__
node_modules
evidence
.DS_Store
.superpowers
.pytest_cache
+4 -40
View File
@@ -1,41 +1,5 @@
# Copy to .env for your LOCAL synthetic test environment; never commit .env.
# These are logical interface suggestions; map actual framework names in REPORT.md.
APP_HOST=0.0.0.0
APP_PORT=8080
APP_ENV=lab
# Generated bootstrap values live only in ignored secrets/ and .env.
SESSION_TTL_SECONDS=3600
# Choose credentials locally. File paths contain no secret values.
DATABASE_URL_FILE=/run/secrets/database_url
# Optional on 3, required use on 4 in lab2; Redis OR Valkey:
SESSION_STORE=postgres
CACHE_URL_FILE=/run/secrets/cache_url
API_REPLICAS=2
IDEMPOTENCY_TTL_SECONDS=86400
S3_ENDPOINT=https://s3:9000
S3_REGION=us-east-1
S3_BUCKET=messenger-attachments
S3_ACCESS_KEY_ID_FILE=/run/secrets/s3_access_key_id
S3_SECRET_ACCESS_KEY_FILE=/run/secrets/s3_secret_access_key
MAX_UPLOAD_BYTES=10485760
MAX_IMAGE_PIXELS=40000000
BROKER_URL_FILE=/run/secrets/broker_url
WORKER_CONCURRENCY=2
JOB_MAX_ATTEMPTS=5
JOB_TIMEOUT_SECONDS=60
STAGING_RETENTION_SECONDS=86400
OTEL_SERVICE_NAME=messenger-api
# Worker must set a distinct service.name.
OTEL_EXPORTER_OTLP_ENDPOINT=https://otel-collector:4318
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=lab
# TLS and OpenBao: actual paths/ports depend on your implemented trust matrix.
PUBLIC_BASE_URL=https://localhost:8443
TLS_CA_FILE=/run/secrets/ca.crt
TLS_CERT_FILE=/run/secrets/service.crt
TLS_KEY_FILE=/run/secrets/service.key
BAO_ADDR=https://openbao:8200
BAO_CACERT=/run/secrets/bao-ca.crt
# No root token here. Bootstrap operator -> short-lived service auth -> scoped token.
ARGON2_MEMORY_KIB=19456
ARGON2_ITERATIONS=2
ARGON2_PARALLELISM=1
# Public endpoint: https://localhost:8443, CA_FILE=secrets/trust/ca.crt.
# Production API/worker/relay authenticate to OpenBao by their own short-lived leaf certificate.
# No root token, unseal key, database or S3 password belongs in application environment variables.
+23
View File
@@ -0,0 +1,23 @@
name: Grade 3 secure application acceptance
on: [push, pull_request]
permissions:
contents: read
jobs:
secure:
runs-on: ubuntu-latest
timeout-minutes: 40
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- run: make up
- run: make check validate-container test test-security test-student test-fresh
- run: make test-matrix verify-persistence verify-failover audit-runtime
- uses: actions/upload-artifact@v4
if: always()
with:
name: lab7-evidence
path: evidence/
- if: always()
run: docker compose down
+19
View File
@@ -0,0 +1,19 @@
FROM python:3.13.18-slim-bookworm
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PYTHONPATH=/app/src
WORKDIR /app
COPY requirements.txt requirements-dev.txt requirements.lock ./
RUN python -m pip install --no-cache-dir --upgrade pip==26.2.0 && pip install --no-cache-dir -r requirements.lock -r requirements.txt && useradd --uid 10001 --create-home messenger
RUN python -m pip uninstall --yes pip setuptools && rm -rf /usr/local/lib/python3.13/ensurepip
COPY src/ src/
COPY migrations/ migrations/
COPY student-tests/ student-tests/
COPY scripts/ scripts/
COPY tests/ tests/
COPY contracts/ contracts/
COPY lab.json Makefile README.md COURSE.md CONTRIBUTING.md REPORT.md ./
ARG APP_RELEASE=lab7-v1
ENV APP_RELEASE=${APP_RELEASE}
LABEL org.opencontainers.image.version=${APP_RELEASE}
USER messenger
EXPOSE 8080
CMD ["uvicorn", "messenger.app:create_app", "--factory", "--host", "0.0.0.0", "--port", "8080", "--timeout-graceful-shutdown", "5", "--no-access-log"]
+57 -1
View File
@@ -1,6 +1,6 @@
PYTHON ?= python3
BASE_URL ?= https://localhost:8443
CA_FILE ?=
CA_FILE ?= $(CURDIR)/secrets/trust/ca.crt
ACTION_SCRIPT ?=
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
@@ -31,3 +31,59 @@ test-failover:
test-security:
$(PYTHON) tests/security.py --base-url "$(BASE_URL)" $(TLS_ARGS)
.PHONY: bootstrap up down test-student test-cluster rolling
bootstrap:
./scripts/bootstrap.sh
$(PYTHON) scripts/pki.py
$(PYTHON) scripts/bootstrap_security.py
up: bootstrap
docker compose build api minio minio-init
docker compose up -d --wait --wait-timeout 120 postgres redis broker minio minio-init volume-init openbao
$(PYTHON) scripts/bao_operator.py bootstrap
docker compose run --rm --no-deps migrate
docker compose up -d --wait --wait-timeout 120
$(PYTHON) scripts/cluster.py wait
down:
docker compose down
test-student:
docker compose run --rm --no-deps student-tests
test-cluster:
$(PYTHON) scripts/verify_cluster.py
rolling:
$(PYTHON) scripts/cluster.py rolling
.PHONY: test-fresh load-evidence verify-persistence verify-failover
test-fresh:
./scripts/check_fresh_migrations.sh
load-evidence:
$(PYTHON) tests/load.py --base-url "$(BASE_URL)" $(TLS_ARGS) --duration 30 --concurrency 4 --output evidence/load.json
verify-persistence:
$(PYTHON) scripts/verify_cluster.py persistence
verify-failover:
$(PYTHON) scripts/verify_cluster.py public-failover
$(PYTHON) scripts/verify_cluster.py failover
.PHONY: validate-container
validate-container:
$(PYTHON) scripts/cluster.py exec python scripts/validate_openapi.py
.PHONY: test-jobs
test-jobs:
$(PYTHON) scripts/verify_jobs.py
.PHONY: test-matrix test-lifecycle scan-deps scan-image audit-runtime
test-matrix:
@set -e; audit_result=$$(mktemp evidence/tls-matrix.XXXXXX); trap 'rm -f "$$audit_result"' EXIT; docker compose run --rm --no-deps security-audit > "$$audit_result"; mv "$$audit_result" evidence/tls-matrix.json
test-lifecycle:
$(PYTHON) scripts/verify_security.py
scan-deps:
$(PYTHON) scripts/scan_dependencies.py
scan-image:
$(PYTHON) scripts/scan_image.py
audit-runtime:
$(PYTHON) scripts/runtime_audit.py
.PHONY: test-observability
test-observability:
$(PYTHON) scripts/verify_observability.py
+218 -17
View File
@@ -1,37 +1,238 @@
# Отчёт — лабораторная 7
- Автор, группа: TODO
- Целевая оценка; выбранный трек 5, если нужен: TODO
- Commit/PR: TODO после публикации
- Использованные источники, библиотеки и помощь ИИ: TODO
- Автор: **Лукьянов К.Р. БПИ2303**.
- Целевая оценка: **3**, обязательный минимум. По решению автора от30.11.2026 уровни4 и5 не заявлены; дальнейшие расширенные проверки прекращены. Уже реализованные возможности и полученные результаты сохранены.
- Commit/PR: изменения подготовлены в `solution/bpi2303-lukyanov`; commit и ссылку PR добавлю после самостоятельной публикации.
- Источники и помощь ИИ: skeleton текущей работы (`README.md`, `COURSE.md`, `contracts/`, публичные `tests/`), моя реализация lab6, документация используемых библиотек и первичные материалы из README. **Реализация выполнена совместно мной и Codex**. Codex участвовал в реализации, проверках, исправлениях и оформлении доказательств; использование ИИ указано явно.
## Запуск из чистого clone
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
Нужны Docker Engine с Compose v2 (`scale`, `--wait`, `depends_on.restart`), Python 3.9+ для операторских скриптов, OpenSSL, make и доступ к registry/PyPI при первой сборке. Приложение работает на Python 3.13.18, FastAPI 0.162.2; зависимости закреплены в `requirements.lock`. Образы: Nginx 1.28.0-alpine, PostgreSQL 17.5-bookworm, Redis 7.4.4-bookworm (отдельно cache и broker Streams), MinIO RELEASE.2025-04-22T22-12-26Z, mc RELEASE.2025-04-16T18-13-26Z, OpenBao 2.2.2, Collector contrib 0.128.0, Prometheus 3.4.1, Loki 3.5.1, Tempo 2.7.2, Grafana 12.0.1. Точные теги и resource limits — `compose.yaml`, фактически запущенные image IDs — `evidence/runtime-hardening.json`.
```sh
# После clone своего fork и перехода в корень mtusi2026lab7:
make up
make check
make validate-container
make test
make test-security
make test-student
make test-matrix
make audit-runtime
```
`make up` сам создаёт ignored `.env` и `secrets/`, CA и отдельные leaf identities, scoped backend credentials и Grafana provisioning; собирает API/MinIO/mc, запускает хранилища и OpenBao, выполняет operator init/unseal, применяет миграции 001–005, запускает две API-реплики и ждёт их за Nginx. Секреты не нужно копировать из другой лабораторной. Bootstrap сохраняет существующие passwords/volumes. `SESSION_TTL_SECONDS` из `.env` (по умолчанию 3600) передаётся API/worker/relay; остальные фактические настройки заданы Compose и scoped KV. Все зависимости поднимаются из этого репозитория.
Публичный endpoint: `https://localhost:8443`, CA: `secrets/trust/ca.crt`. Можно явно передать `BASE_URL=https://localhost:8443 CA_FILE="$PWD/secrets/trust/ca.crt"` в make. Проверка CA и SAN включена; `-k` не нужен. Первый старт telemetry может занять до 90 секунд; аудит ждёт готовности до положительных/отрицательных проверок. Все тесты создают синтетические данные.
Операторские интерфейсы привязаны к loopback: OpenBao 8200, Grafana 3000, Prometheus 9090, Loki 3100, Tempo 3200; только HTTPS. Grafana: пользователь `operator`, пароль читать локально из `secrets/grafana_password`, не включать в отчёт. Для backend query требуются operator cert/key из `secrets/pki/operator/`. CA private key, Bao init/root/unseal находятся только в `secrets/operator/` (0700), не монтируются в API/worker/relay/Bao server. Корневой token нужен только операторскому bootstrap, приложение использует cert auth.
```sh
# После отдельного рестарта OpenBao (он снова sealed):
python3 scripts/bao_operator.py unseal
# После обычного make down достаточно make up: operator unseal входит в запуск.
# Обязательные проверки сохранности/отказа для заявленной3:
make verify-persistence verify-failover
# Дополнительные реализованные сценарии; для сдачи на3 не обязательны.
# Запускать последовательно, не одновременно с другими отказами:
make test-fresh
make test-lifecycle
make test-jobs
make test-observability
make test-cluster
make load-evidence
make scan-deps scan-image
make check
# Безопасная остановка с сохранением данных и operator material:
make down
# Только намеренное удаление учебных данных, НЕ обычная остановка:
docker compose down --volumes
# После удаления bao_data старый secrets/operator/bao-init.json больше не относится
# к новому хранилищу. Сохранить старую secrets отдельно и создать новый локальный
# secrets/ перед make up; никогда не смешивать старые credentials с новым стендом.
```
`make test-fresh` использует отдельное имя Compose-проекта, новые volumes и автоматически удаляет только их. Миграции запускаются дважды, затем собственные тесты. Для публичных hooks доступны `make test-persistence ACTION_SCRIPT=scripts/restart.sh` и `make test-failover ACTION_SCRIPT=scripts/stop-one.sh`; расширенный `make test-cluster` дополнительно проверяет реальные перезапуски/volumes и восстанавливает реплики. После rolling Compose может пересоздать worker/relay под тем же именем с новым image: проверяется полный набор service/name, новое StartedAt и те же volumes, а сохранность сессии/данных доказывает публичный сценарий.
Leaf действует 1 день, корневой CA — 30 дней. Повторный `make up` перевыпускает leaf, если до expiry меньше часа. После обновления leaf уже работающих сервисов нужно пересоздать соответствующие контейнеры, поскольку SSL context загружается при старте; для полного планового renewal: `make down`, затем `make up`. Bootstrap не делает автоматический rollover просроченного root CA: это отдельная операторская процедура с резервной копией и новым trust bundle.
## Архитектура и решения
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab6, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
Из lab6 перенесены Python/FastAPI REST API, PostgreSQL migrations/transactions, общие сессии и идемпотентность сообщений, приватный MinIO и бинарные вложения, Streams/outbox/worker, преобразования изображений и telemetry. Публичные `README.md`, `COURSE.md`, `tests/`, `contracts/` сохранены. Переход lab7 меняет транспорт на HTTPS, бизнес-контракт остаётся прежним: upload 202, metadata polling, content только ready; Bearer остаётся обязательным поверх mTLS.
```mermaid
flowchart LR
C[Клиент] -->|HTTPS CA/SAN| N[Nginx]
N -->|mTLS SAN lb| A[API ×2]
A -->|verify-full TLS| P[(PostgreSQL)]
A -->|TLS scoped S3| S[(MinIO)]
A -->|mTLS producer| B[(Redis Streams)]
B -->|mTLS consumer| W[Worker]
W -->|TLS scoped role| P
W -->|TLS prefix policy| S
R[Outbox relay] --> B
A & W & R -->|mTLS separate identities| O[OTel Collector]
O -->|mTLS| T[Loki / Tempo]
A & W & R -->|TLS cert auth scoped KV| V[OpenBao]
```
PostgreSQL — источник истины для пользователей, session hashes, членства, сообщений, metadata, job/outbox/lease и общего login limiter. Сообщение и запись Idempotency-Key фиксируются атомарно; уникальные ограничения защищают от повторов разных API. Upload staging→PG job/outbox→relay→Streams→worker допускает повторную доставку; эффекты и смена статуса идемпотентны. Streams AOF, PG и MinIO имеют named volumes. Потеря необязательного profile cache не даёт анонимному пользователю доступ и не уничтожает данные. Cache GET/SET имеют caller deadline по 250 мс, максимум четыре outstanding операции на API и без очереди: при занятых slots запрос сразу идёт в PostgreSQL. Socket timeout 200 мс не ограничивал весь DNS/connection path, что выявлено реальным отказом и trace. Просроченная фоновая I/O операция может закончиться позже, но не удерживает HTTP-запрос и не порождает неограниченный поток задач. Авторизация всегда выполняется в PostgreSQL до чтения кэша.
Nginx остаётся балансировщиком: Docker DNS re-resolve, две API, passive failure checks, без автоматического replay неоднозначного POST. API business listener — только 127.0.0.1:8080 внутри контейнера. Python TLS gateway на 9443 в том же процессе/container boundary требует CA + точный разрешённый DNS SAN + разрешённый serial. Прямого опубликованного API-порта нет. Nginx проверяет сертификат API с именем `api`; upstream DNS и проверяемое имя указаны явно, не берутся из пользовательского Host. Для Redis/Collector/backends TLS sidecar разделяет network namespace с backend, а plaintext backend слушает только loopback. Это не plaintext hop через Docker network. Gateway ограничивает handshake/соединения/буферы; session tickets отключены, отзыв проверяется на новом соединении. Query gateway Grafana допускает один bodyless GET/HEAD на соединение, не позволяет последующий/pipelined POST.
PG использует `sslmode=verify-full`, отдельные db_api/db_worker/db_relay без superuser; worker не читает users/passwords/sessions. S3 identities ограничены prefix/action policies. Broker producer listener 6380 разрешает SAN api/relay, consumer 6381 — SAN worker; дополнительно identity/listener связаны с AUTH user/Redis commands. Collector разрешает отдельные api/worker/relay cert, Prometheus и Grafana имеют собственные identities.
OpenBao работает вне dev-mode, TLS, persistent file storage. Operator init создаёт одну unseal share (учебный компромисс); она и root token остаются локальными. Приложение получает только свой leaf и CA, использует cert auth и read-only policy `secret/data/<role>`. Token TTL 60 секунд, max TTL 300; renewal/re-auth, без постоянного BAO_TOKEN. Только успешные auth/read обновляют допуск к KV; кэш не дольше 60 секунд и не дольше token deadline. После бюджета API отвечает 503; если Nginx уже исключил все неготовые API, внешний ответ может быть 502/503/504 без API JSON. Worker откладывает работу, `/health/live` остаётся 200. Ошибки не продлевают допуск. При смене backend password обновляются backend, KV и запускаются новые connection pools; старое открытое соединение не считается доказательством отзыва.
Argon2id: m=19456 KiB, t=2, p=1, случайная salt и параметры в encoded hash, успешный вход обновляет устаревшие параметры. В PG хранятся SHA-256 hashes случайных session tokens. Общий для реплик limiter в PG: 10 попыток на account/10 секунд, 120 KDF admissions/10 секунд глобально; в каждой API максимум две KDF одновременно, semaphore timeout 100 мс. Для двух реплик это максимум четыре KDF и около 76 MiB заданной Argon-memory сверх остальной памяти процессов; фактические latency/RSS приведены ниже. Это оценка ограниченного бюджета, не доказательство устойчивости ко всем видам DoS. 429 имеет Retry-After. Фиксированное окно может пропустить burst на границе, поэтому дополнительно ограничена KDF concurrency.
API/worker/relay: uid10001, read_only, cap_drop ALL, no-new-privileges, ограниченные tmpfs. Одноразовый MinIO init также non-root (10002), read_only/drop ALL/no-new-privileges и пишет runtime-конфигурацию mc только в tmpfs /tmp. Worker: 1 CPU, 512 MiB, deadline эффекта 45 секунд; decoder subprocess CPU15s и RLIMIT_AS768MiB, при этом общий cgroup RAM512MiB строже. Pixel limit40M, текстовые PNG chunks ограничены, media/размер проверяются; original bytes не перекодируются, variants не наследуют metadata. PG/MinIO/Redis/telemetry/Bao пишут в выделенные volumes при read_only rootfs. Исключения: PG entrypoint нужны CHOWN/SETUID/SETGID/DAC_OVERRIDE/FOWNER для инициализации; volume-init запускается root только с CHOWN для владельцев Tempo/Bao volumes, затем завершается. Stateful volumes не заменяются tmpfs.
Tempo после серии нагрузок завершился с OOM при flush в cgroup384MiB; это зафиксировано в `evidence/tempo-memory-before.json`. Для локального стенда ограничены head block8MiB, один одновременный flush, check2s и небольшие query read buffers (4×256KiB); complete blocks хранятся30s при blocklist poll10s. Бюджет Tempo —512MiB/1CPU, `GOMEMLIMIT=384MiB` и restart unless-stopped. GOMEMLIMIT — soft Go runtime budget, жёсткую границу задаёт cgroup; автоматический restart не считается доказательством отсутствия OOM. После изменения выполнены ещё3повтора нагрузки и восстановлен предыдущий trace через WAL. Дальнейший расширенный мониторинг прекращён по решению автора сдавать на3; длительная устойчивость при непрерывном потоке traces не заявлена.
Поля и исходные defaults сверены с [Tempo v2.7.2 ingester config](https://github.com/grafana/tempo/blob/v2.7.2/modules/ingester/config.go) и [storage config](https://github.com/grafana/tempo/blob/v2.7.2/tempodb/config.go); смысл soft memory limit — [Go GC guide](https://go.dev/doc/gc-guide#Memory_limit). Размеры и concurrency выбраны для этого учебного стенда, их достаточность ограничена измеренным профилем.
Заполненная trust matrix, модель угроз, triage и сценарий защиты хранятся отдельно от репозитория в `../lab7/docs/`. Основные сведения и команды продублированы здесь, поэтому этот репозиторий запускается самостоятельно.
### Границы доверия и отрицательные проверки
| Связь | Transport / identity / права | Воспроизводимая проверка |
| --- | --- | --- |
| Client→Nginx | HTTPS localhost:8443, CA/SAN, Bearer | make test-security; lifecycle wrong hostname/logout; smoke |
| Nginx→обе API | mTLS api:9443, клиент только SAN lb; serial denylist | test-matrix: correct200, missing/foreign/intruder отказ, TCP8080 закрыт; lifecycle rotation |
| API/worker/relay→PG | TLS verify-full postgres:5432, разные DB roles | test-matrix: ssl=true, plaintext/worker users read denied; lifecycle password rotation |
| API/worker/relay→S3 | TLS minio:9000, scoped access keys/prefix policies | test-matrix: final write API и staging write worker denied, anonymous/prefix deny |
| API/relay→broker | mTLS broker:6380, SAN api/relay + producer AUTH/commands | test-matrix: publish role разрешена, consume/cross-listener AUTH denied |
| Worker→broker | mTLS broker:6381, SAN worker + consumer AUTH | test-matrix: no-cert/foreign/wrongSAN/publish denied |
| API/worker/relay→Collector | mTLS collector:4319, отдельные identities | test-matrix: correct OTLP200, no-cert/foreign/wrongSAN отказ |
| Collector→Loki/Tempo | mTLS loki:9443 / tempo:4319, SAN collector; gRPC ALPN h2 | lifecycle: реальный upload trace/log; test-observability retry chain |
| Prometheus→Collector | mTLS collector:9465/8889, SAN prometheus, GET/HEAD | test-matrix scrape200/intruder deny |
| Grafana→datasources | mTLS :9443, SAN grafana, один bodyless read/connection | test-matrix POST403/worker deny; gateway pipeline regression |
| Workloads→OpenBao | HTTPS :8200, cert auth pinned leaf, own read-only KV policy; tokens60s/max300s | test-matrix cross-path/write/impersonation deny; lifecycle seal/renew/rotation |
| Operator→admin | localhost HTTPS8200/3000/9090/3100/3200; operator cert/root locally, Grafana password | runtime ports/mounts audit; operator backend queries |
| API→cache | mTLS redis:6380, SAN api + profile AUTH user:* GET/SET | test-matrix prefix/FLUSHDB deny |
| Health/bootstrap | API HTTP8080 только loopback; backend plaintext только loopback; test/migrate profiles отдельно | no-network-bypass matrix; runtime audit |
| S3 admin console / replication | Console только MinIO loopback9001 без публикации; mc admin поTLS. Replication N/A, single-node | Compose/runtime snapshot; ограничение модели |
### Модель угроз
Активы: password/session hashes, chat data, original/variants, job/outbox, service identities, secrets и telemetry. Акторы: посторонний пользователь, сетевой нарушитель, неверная/скомпрометированная service identity, доверенный operator. Docker-host/root и CA operator — доверенная граница.
| Конкретная угроза | Контроль | Отрицательный тест |
| --- | --- | --- |
| MITM/подмена backend | CA/SAN/verify-full, без insecure fallback | wrong CA/hostname, pg plaintext denied |
| Любой cert общего CA выдаёт себя за LB/worker | точный SAN allowlist + serial + broker AUTH role | intruder sameCA, cross-listener AUTH denied |
| Посторонний читает/привязывает файл | session+membership, 404, sender из Bearer | outsider metadata/content/bind, forged X-User-Id |
| Кража raw passwords/tokens из БД/логов | Argon2id, SHA256 random tokens, telemetry без credentials/body | rehash/hash proof, worker SELECT denied, positive traces + negative canary |
| CPU/RAM login/image DoS | общий limiter+KDF slots, body/pixel/cgroup/deadline limits | shared429 на двух API, malformed/large-image/deadline tests |
| Worker получает admin или меняет staging | scoped Bao/DB/S3/Streams roles | policy mutation/cross-path/publish/staging-write denied |
| Старые credential/leaf продолжают работать | смена DB password, revoke serial, новые pools/connections | old DB connection attempt denied; old leaf denied; new работает |
| Sealed/expiry незаметно продлевает доступ | cache budget≤60s, ошибки не обновляют deadline | реальный seal→внешний 502/503/504, live200, unseal→прежняя job ready |
| Grafana превращает read в ingest | один bodyless GET/HEAD на соединение | POST403, GET→POST pipeline/mixed LF regressions |
| Потеря принятой работы | PG outbox/lease, durable staging, broker AOF, идемпотентность | restart, SIGKILL worker, replay, same confirmed messages |
## Доказательства критериев
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
| --- | --- | --- | --- |
| Публичный smoke | make test | TODO | TODO |
| Остальные пункты уровня 3 | TODO | TODO | TODO |
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
Дата повторной проверки: **30 ноября 2026**. Результаты относятся к текущим исходникам; commit ещё не создан.
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства (evidence/) |
| --- | --- | --- | --- |
| Offline / OpenAPI | make check; make validate-container | PASS: structure, local refs, Python syntax; OpenAPI3.1/schema | check.txt; openapi.txt |
| Уровень3: весь прежний API через HTTPS | make test; make test-student | PASS smoke;43 tests passed | smoke.txt; student-tests.txt |
| Уровень3: воспроизводимые миграции/хранилища | make test-fresh | Новые volumes, migrations001–005 дважды;43 tests passed | fresh-migrations.txt |
| Уровень3: CA/SAN внешнегоTLS | make test-security; make test-lifecycle | Trusted HTTPS работает; untrusted CA/wrong hostname отклонены | public-security.txt; security-lifecycle.json |
| Уровень3: LB→обе API mandatory mTLS/no bypass | make test-matrix | Две API: correct identity200; missing/foreign/wrongSAN отказ; plaintext8080 недоступен | tls-matrix.json |
| Уровень3: TLS DB/S3/cache/backends/OpenBao | make test-matrix; make test-lifecycle | verify-full PG; scoped S3/cache; query/scrape roles; реальные trace/logs поTLS | tls-matrix.json; secure-upload-trace.json; secure-upload-logs.json |
| Уровень3: persistent non-dev Bao scoped auth | make test-matrix; make test-cluster | Сервисный cert auth, TTL≤60s; cross-path/policy-write/impersonation denied; restart/unseal | tls-matrix.json; persistence.json |
| Уровень3: least privilege/ports/limits/no secret mounts | make audit-runtime | non-root workloads, limits/read_only/dropcaps; operator material не монтируется; нет tracked secrets | runtime-hardening.json |
| Уровень3: Argon/ACL/logout/expiry/body limits | make test-student; make test-lifecycle | Argon2id19456/2/1; metadata/content/bind outsider404, forged header ignored, logout401; expiry/media/size tests | student-tests.txt; security-lifecycle.json |
| Уровень3: persistence / отказ реплики поHTTPS | make test-cluster | Реальные restart/volumes, прежние token/data; публичный failover и оба отдельных API | persistence.json; public-failover.json; sequential-failover.json |
| Дополнительно, 4 не заявлена: broker/Collector mTLS, разные identities | make test-matrix | Отдельные api/worker/relay cert; missing/foreign/wrongSAN denied; broker cross-AUTH/commands denied | tls-matrix.json |
| Дополнительно, 4 не заявлена: hashes/rehash/shared limiter/DoS budget | make test-lifecycle; make test-student | Rehash legacy, SHA256 session;439+Retry-After на двух API; measured KDF latency/RSS; bounded slots | security-lifecycle.json; student-tests.txt |
| Дополнительно, 4 не заявлена: рабочий secret и leaf rotation/revoke | make test-lifecycle | Старый DB password на новом connection denied; новый works; старый leaf denied, новые leaf/images unchanged | security-lifecycle.json |
| Дополнительно, 4 не заявлена: expiry/sealed/renewal/bootstrap trust | make test-lifecycle; make test-matrix | Token TTL60/max300; seal→503 через58.58s; live200; та жеjob/session восстановлены | security-lifecycle.json; tls-matrix.json |
| Дополнительно, 4 не заявлена: read_only/tmpfs/no-new-privileges/cap_drop | make audit-runtime | PASS runtime snapshot; stateful/CHOWN/PG entrypoint exceptions описаны выше | runtime-hardening.json |
| Дополнительно, 4 не заявлена: dependency/image scan с triage | make scan-deps scan-image | pip-audit0; Trivy Python0; OS findings и применимость разобраны, не скрыты | dependency-scan.json; image-scan.json |
| Дополнительно, 4 не заявлена: ≥6 угроз, upload bounds, telemetry privacy | make test-student test-lifecycle test-observability | Модель угроз выше; decoder/deadline tests; positive API/worker trace/log и0 body-canary matches | student-tests.txt; security-lifecycle.json; observability.json |
| Регрессия bounded cache fallback | make test-student; make test-cluster | При resolver stall2s профиль200 возвращается<1s; полный cache outage сохраняет session/data | cache-deadline-red.txt; cache-deadline-green.txt; dependency-failures.json |
| Сохранённые outbox/worker/observability возможности | make test-jobs test-observability | Broker restart, SIGKILL137/lease, duplicates/replay; retry trace и alerts firing→resolved | jobs-faults.json; observability.json |
| Сохранённый Nginx/rolling/idempotency | make test-cluster | Nginx config PASS;8 requests→1 message; start-first DNS/new image без рестартаLB | nginx.json; concurrent-idempotency.json; rolling-update.json |
Предыдущие evidence `*-before.json` сохранены только для разбора изменений. Текущие PASS выше заново получены в этом прогоне. `make check` первоначально падал из-за пустого tls-matrix.json: аудит выполнен заново, результат теперь сохраняется атомарно. Публичные tests/contracts/README/COURSE не изменены (`evidence/public-integrity.txt`).
### Разбор scan findings
Результаты привязаны к lockfile/image ID и дате JSON, сканируется именно app image, не весь набор сторонних контейнеров. pip-audit проверяет полный pinned lockfile; Trivy — экспортированный локальный image archive, без Docker socket внутри scanner. Runtime pip/setuptools удалены, Python зависимости обновлены. Сканеры и их базы могут давать иной результат позднее.
| Остаточная группа | Применимость в реализации и решение |
| --- | --- |
| SQLite/FTS5, включая critical integer overflow | Код работает через PostgreSQL, не импортирует SQLite и не открывает пользовательские SQLite DB. Прямой API-путь не найден, пакет остаётся в base image; обновление/минимизация base требуется. |
| util-linux/mount, PAM, ACL, systemd | Workloads non-root/drop ALL/no-new-privileges/read_only, не используют host devices, mount/login/systemd-homed. Это уменьшает предпосылки локальной эскалации, но CVE не исправляет. Для PAM scanner показывает доступный fixed version. |
| gzip LZH, Perl tar, ncurses | Эти утилиты не вызываются бизнес-кодом; пользовательский tar/LZH не распаковывается. Остаётся поверхность локального исполнения; обновить/удалить неиспользуемое. |
| zlib/minizip/gz_vacate | PNG decode обрабатывает недоверенные compressed данные, поэтому нельзя автоматически исключить всю библиотеку. ZIP creation и gz_vacate API в коде не используются; CPU/RAM/deadline limits лишь ограничивают последствия. Для части findings есть fixes; обновление base/zlib остаётся следующим шагом. |
| zstd и прочие LOW/MEDIUM/UNKNOWN | Пользовательский zstd не декодируется. Полные ID/package/version/fixed/status — image-scan.json. Не трактовать низкую severity или отсутствие явного пути как доказанную невозможность эксплуатации. |
Для учебного localhost-стенда остаточный риск принят в указанной модели угроз. Не заявляю нулевое общее число CVE или безопасность внешней публикации. Развёрнутый разбор всех уникальных HIGH/CRITICAL хранится в служебном `lab7/docs/SCAN_TRIAGE.md` вне репозитория решения.
## Эксперименты и отказы
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
Стенд: Docker Desktop 29.9.2, aarch64, 12 vCPU, 7.75 GiB RAM Docker VM. Полные данные: environment.json; CPU/RAM-лимиты конкретных сервисов — runtime-hardening.json. Это ресурсы VM, не утверждение о выделенных физических ядрах.
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
Argon2 verify:10 повторов на синтетическом hash, m=19456KiB,t=2,p=1; среднее 10.388ms, максимум 11.106ms; ru_maxrss процесса 41980KiB. Это последовательный microbenchmark в контейнере1CPU, не end-to-end login percentile. Общий limiter и KDF concurrency проверяются отдельно.
Нагрузка: closed-loop POST сообщений через HTTPS, concurrency4; warmup10s, затем3 повтора по30s без намеренных отказов. Percentiles относятся только к успешным HTTP-ответам, ошибки учитываются отдельно. Вложений в этом профиле нет. Raw summaries load-run1/2/3.json, resource samples и размеры данных до/после — load.json.
| Повтор | Успешных / ошибок | RPS | p50 / p95 / p99, ms |
| --- | --- | --- | --- |
| TODO | TODO | TODO | TODO |
| 1 | 9538 / 0 | 317.591 | 11.666 / 18.436 / 39.442 |
| 2 | 9691 / 0 | 322.921 | 11.465 / 18.378 / 35.983 |
| 3 | 9991 / 0 | 332.968 | 11.425 / 16.125 / 35.421 |
Набор данных до нагрузки: `{"users": 616, "chats": 240, "messages": 86748, "attachments": 122, "attachment_jobs": 122}`; после: `{"users": 628, "chats": 244, "messages": 119079, "attachments": 122, "attachment_jobs": 122}`. Изменение числа сообщений входит в профиль.
| Контейнер | Максимальный sampled CPU % | Наблюдаемая RAM (первый / последний sample) |
| --- | --- | --- |
| mtusi-lab7-api-10 | 88.11 | 119.1MiB / 155.7MiB |
| mtusi-lab7-api-9 | 89.49 | 120.4MiB / 156.6MiB |
| mtusi-lab7-collector-1 | 7.6 | 92.11MiB / 88.57MiB |
| mtusi-lab7-lb-1 | 36.17 | 5.074MiB / 4.66MiB |
| mtusi-lab7-postgres-1 | 46.51 | 105MiB / 131.8MiB |
| mtusi-lab7-tempo-1 | 103.95 | 330.4MiB / 420.7MiB |
| mtusi-lab7-worker-1 | 0.61 | 67.79MiB / 68.04MiB |
Docker stats — дискретные samples, не гарантированный peak между измерениями. Для повторения:
```sh
python3 tests/load.py --base-url https://localhost:8443 --ca-file secrets/trust/ca.crt --duration 10 --concurrency 4
for n in 1 2 3; do
python3 tests/load.py --base-url https://localhost:8443 --ca-file secrets/trust/ca.crt --duration 30 --concurrency 4 --output "evidence/load-run$n.json"
done
# Во втором терминале во время нагрузки:
docker compose ps -q api worker postgres lb collector | xargs docker stats --no-stream
```
| Воздействие | Ожидание | Фактическое наблюдение | Восстановление / данные |
| --- | --- | --- | --- |
| Sealed Bao | Ограниченный допуск, без вечного cache | Внешний503 на58.58s, internal live200 | После operator unseal та же сессия/job/original; secrets не потеряны |
| Worker SIGKILL после S3 PUT до ACK | Lease и повтор без дублирования | exit137, attempt2 | 89.778s lease recovery; same job |
| Разрыв COMMIT→publish / broker restart | Durable outbox/Streams | Принятая202 job стала ready после рестарта | Исходные bytes сохранены |
| Worker остановлен / DB lock | QueueLagGrowing / HighApiErrorRate | Оба alerts firing→resolved | 9 ограниченных503 при DB lock; после rollback прежняя сессия работает |
| Loki/Tempo остановлены | Business API продолжает работать, очереди bounded | 1972 успешных сообщений за эксперимент | Collector limit256MiB/queue256 batches; данные сообщений сохранены, потеря части telemetry допустима |
| Последовательная остановка обоих API | Чтение/запись через оставшийся | 2 фазы, confirmed_preserved=True | write recovery: 1.2506s, 1.227s; дубли0 |
| Rolling start-first / смена IP | DNS обнаруживает новые API без restartLB | 2 замены, новый release lab7-db3a1be8 | confirmed_preserved=True, LB не перезапускался |
| Ротация DB password / LB leaf | Старые новые соединения запрещены | old password/leaf denied, new allowed | Образы не пересобирались для ротации, token/original сохранены |
Дополнительно найден реальный cache latency defect: правильный профиль ожидал5.09s; trace показывает SQL<1ms и ожидание в cache path. Отдельный регрессионный тест controlled resolver stall2s сначала упал2.031s>1s, затем прошёл с bounded cache caller deadline. Сохранены cache-fallback-before.txt, fallback-slow-trace.json и cache-deadline-red/green.txt. Persistence harness после rolling также исправлен: Compose может пересоздать worker/relay под прежним service/name; проверяются их StartedAt, полный состав и те же volumes, а не неизменный container ID.
При переносе проверки наблюдаемости обнаружены и устранены ошибки test harness: старые HTTP URLs и CA-less Client; затем ожидание sleep-процесса после уже снятой DB lock. Контрольный сбой TLS сохранён в observability-before.txt. Исправленный полный сценарий повторно прошёл; lock освобождается rollback по явному сигналу stdin, child корректно завершается. Начальный Loki503 до readiness устраняется bounded wait, отрицательные TLS проверки не ослаблены.
## Ограничения и следующие шаги
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
Один Docker-host, один PG/MinIO/broker/Nginx: потеря host, диска или единственного хранилища не покрывается отказом API-реплики. Автоматического HA, backup/restore и CA rollover нет. Оператор и Docker-host доверенные; имеющий host/root доступ может читать bind-mounted secrets. Cert private files внутри защищённого родительского каталога доступны нужному container UID через read-only mounts; это учебная модель, не внешнее KMS/HSM.
Secrets в KV статические; token TTL сам по себе не удаляет credentials из backend, поэтому отдельно реализован ограниченный admission cache и продемонстрирована реальная ротация DB password. Ротация leaf требует restart/reload соответствующего endpoint; отзыв serial действует на новые соединения и не обрывает автоматически уже открытые. Bootstrap cert — первый доверенный credential, его выпуск/хранение требует защиты CA/operator. Это описанная граница доверия, а не отсутствие bootstrap credential.
Scans относятся к конкретному app image и lockfile; scan всех внешних images не заявлен. Остаточные CVE разбираются в SCAN_TRIAGE, отсутствие findings в pip-audit не доказывает отсутствие всех уязвимостей. Нагрузочный клиент closed-loop, latency только успешных запросов; ошибки считаются отдельно, coordinated omission и TLS/client overhead ограничивают переносимость RPS. Тесты синтетические и не являются результатом продакшен-аудита. Трек 5 не заявлен.
Следующие шаги: отдельный operator secret storage/offline CA backup, автоматическое renewal с reload и плановый root rollover, проверяемый restore и HA хранилищ, обновления/сканирование всех upstream images, нагрузка с независимым arrival rate.
+871
View File
@@ -0,0 +1,871 @@
name: mtusi-lab7
services:
postgres:
image: postgres:17.5-bookworm
environment:
POSTGRES_DB: messenger
POSTGRES_USER: messenger
POSTGRES_PASSWORD_FILE: /run/secrets/postgres_password
POSTGRES_INITDB_ARGS: --auth-host=scram-sha-256
secrets:
- postgres_password
volumes:
- postgres_data:/var/lib/postgresql/data
- ./secrets/pki/postgres:/pki:ro
- ./infra/security/postgres.sh:/config/postgres.sh:ro
- ./infra/security/pg_hba.conf:/config/pg_hba.conf:ro
networks:
- data
healthcheck:
test:
- CMD-SHELL
- pg_isready -U messenger -d messenger
interval: 2s
timeout: 2s
retries: 30
mem_limit: 512m
cpus: 1.0
entrypoint:
- /bin/sh
- /config/postgres.sh
command: []
tmpfs:
- /tmp:rw,nosuid,size=16m,mode=1777
- /var/run/postgresql:rw,nosuid,size=16m,mode=3777
read_only: true
cap_drop:
- ALL
cap_add:
- CHOWN
- SETUID
- SETGID
- DAC_OVERRIDE
- FOWNER
security_opt:
- no-new-privileges:true
redis:
image: redis:7.4.4-bookworm
command:
- redis-server
- /etc/redis/server.conf
volumes:
- redis_data:/data
- ./infra/security/cache.conf:/etc/redis/server.conf:ro
- ./secrets/cache.acl:/etc/redis/users.acl:ro
networks:
- data
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 2s
timeout: 2s
retries: 30
mem_limit: 128m
cpus: 0.25
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
user: 999:999
migrate:
image: mtusi-lab7-api:lab7
command:
- sh
- -c
- python -m messenger.migrate && python scripts/grant_roles.py
environment:
DATABASE_URL_FILE: /run/secrets/database_url
SSL_CERT_FILE: /trust/ca.crt
secrets:
- database_url
networks:
- data
depends_on:
postgres:
condition: service_healthy
restart: 'no'
mem_limit: 256m
cpus: 0.5
volumes:
- ./secrets/trust:/trust:ro
- ./secrets/operator/db-roles.json:/operator/db-roles.json:ro
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
api:
image: mtusi-lab7-api:lab7
build: .
scale: 2
environment:
BAO_ADDR: https://openbao:8200
TRUST_CA: /trust/ca.crt
SSL_CERT_FILE: /trust/ca.crt
AWS_CA_BUNDLE: /trust/ca.crt
S3_ENDPOINT: https://minio:9000
S3_REGION: us-east-1
S3_BUCKET: messenger-attachments
OTEL_ENABLED: '1'
OTEL_EXPORTER_OTLP_ENDPOINT: https://collector:4319
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
BAO_ROLE: api
POOL_MAX_SIZE: '8'
JOB_MAX_ATTEMPTS: '5'
networks:
- front
- data
depends_on:
migrate:
condition: service_completed_successfully
redis:
condition: service_healthy
minio-init:
condition: service_completed_successfully
openbao:
condition: service_started
stop_grace_period: 10s
healthcheck:
test:
- CMD
- python
- -c
- import urllib.request; urllib.request.urlopen('http://localhost:8080/health/ready',
timeout=4)
interval: 2s
timeout: 5s
retries: 30
mem_limit: 512m
cpus: 1.0
volumes:
- ./secrets/pki/api:/pki:ro
- ./secrets/trust:/trust:ro
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=128m,mode=1777
command:
- python
- -m
- messenger.secure_api
minio:
image: mtusi-lab7-minio:2025-04-22
build:
context: .
dockerfile: infra/minio/Dockerfile
target: minio
secrets:
- minio_root_user
- minio_root_password
volumes:
- minio_data:/data
- ./secrets/pki/minio/tls.crt:/certs/public.crt:ro
- ./secrets/pki/minio/tls.key:/certs/private.key:ro
- ./secrets/trust:/trust:ro
networks:
- data
healthcheck:
test:
- CMD
- python
- -c
- import urllib.request;urllib.request.urlopen('https://minio:9000/minio/health/ready',timeout=2)
interval: 2s
timeout: 3s
retries: 30
stop_grace_period: 10s
mem_limit: 512m
cpus: 1.0
command:
- server
- /data
- --console-address
- 127.0.0.1:9001
- --certs-dir
- /certs
environment:
SSL_CERT_FILE: /trust/ca.crt
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
minio-init:
image: mtusi-lab7-mc:2025-04-16
build:
context: .
dockerfile: infra/minio/Dockerfile
target: mc
secrets:
- minio_root_user
- minio_root_password
- s3_api_id
- s3_api_secret
- s3_worker_id
- s3_worker_secret
- s3_relay_id
- s3_relay_secret
- s3_test_id
- s3_test_secret
volumes:
- ./infra/minio/bootstrap.sh:/config/bootstrap.sh:ro
- ./secrets/policies:/policies:ro
- ./secrets/trust:/trust:ro
networks:
- data
depends_on:
minio:
condition: service_healthy
restart: 'no'
user: 10002:10002
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
mem_limit: 128m
cpus: 0.25
broker:
image: redis:7.4.4-bookworm
command:
- redis-server
- /etc/redis/server.conf
volumes:
- broker_data:/data
- ./infra/security/broker.conf:/etc/redis/server.conf:ro
- ./secrets/broker.acl:/etc/redis/users.acl:ro
networks:
- data
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 2s
timeout: 2s
retries: 30
mem_limit: 160m
cpus: 0.5
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
user: 999:999
worker:
image: mtusi-lab7-api:lab7
command:
- python
- -m
- messenger.worker
- worker
environment:
BAO_ADDR: https://openbao:8200
TRUST_CA: /trust/ca.crt
SSL_CERT_FILE: /trust/ca.crt
AWS_CA_BUNDLE: /trust/ca.crt
S3_ENDPOINT: https://minio:9000
S3_REGION: us-east-1
S3_BUCKET: messenger-attachments
OTEL_ENABLED: '1'
OTEL_EXPORTER_OTLP_ENDPOINT: https://collector:4319
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
BAO_ROLE: worker
POOL_MAX_SIZE: '8'
JOB_MAX_ATTEMPTS: '5'
networks: &id001
- data
depends_on: &id002
broker:
condition: service_healthy
migrate:
condition: service_completed_successfully
minio-init:
condition: service_completed_successfully
openbao:
condition: service_started
stop_grace_period: 45s
restart: unless-stopped
mem_limit: 512m
cpus: 1.0
volumes:
- ./secrets/pki/worker:/pki:ro
- ./secrets/trust:/trust:ro
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=128m,mode=1777
relay:
image: mtusi-lab7-api:lab7
command:
- python
- -m
- messenger.worker
- relay
environment:
BAO_ADDR: https://openbao:8200
TRUST_CA: /trust/ca.crt
SSL_CERT_FILE: /trust/ca.crt
AWS_CA_BUNDLE: /trust/ca.crt
S3_ENDPOINT: https://minio:9000
S3_REGION: us-east-1
S3_BUCKET: messenger-attachments
OTEL_ENABLED: '1'
OTEL_EXPORTER_OTLP_ENDPOINT: https://collector:4319
SESSION_TTL_SECONDS: ${SESSION_TTL_SECONDS:-3600}
BAO_ROLE: relay
POOL_MAX_SIZE: '8'
JOB_MAX_ATTEMPTS: '5'
networks: *id001
depends_on: *id002
stop_grace_period: 45s
restart: unless-stopped
mem_limit: 192m
cpus: 0.25
volumes:
- ./secrets/pki/relay:/pki:ro
- ./secrets/trust:/trust:ro
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=128m,mode=1777
lb:
image: nginx:1.28.0-alpine
volumes:
- ./infra/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./secrets/pki/lb:/pki:ro
- ./secrets/trust:/trust:ro
networks:
- front
ports:
- 127.0.0.1:8443:8443
depends_on:
api:
condition: service_healthy
healthcheck:
test:
- CMD
- curl
- -fsS
- --cacert
- /trust/ca.crt
- https://localhost:8443/health/ready
interval: 1s
timeout: 8s
retries: 30
mem_limit: 128m
cpus: 0.5
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,nosuid,size=128m,mode=1777
- /var/cache/nginx:rw,nosuid,size=128m,mode=1777
- /var/run:rw,nosuid,size=16m,mode=1777
user: 101:101
collector:
image: otel/opentelemetry-collector-contrib:0.128.0
command:
- --config=/etc/otelcol/config.yaml
volumes:
- ./infra/observability/collector.yaml:/etc/otelcol/config.yaml:ro
- ./secrets/pki/collector:/pki:ro
- ./secrets/trust:/trust:ro
networks:
- data
- observe
mem_limit: 256m
cpus: 0.5
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
prometheus:
image: prom/prometheus:v3.4.1
command:
- --config.file=/etc/prometheus/prometheus.yaml
- --storage.tsdb.retention.time=7d
- --web.listen-address=127.0.0.1:9090
volumes:
- ./infra/observability/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
- ./infra/observability/alerts.yaml:/etc/prometheus/alerts.yaml:ro
- prometheus_data:/prometheus
- ./secrets/pki/prometheus:/pki:ro
- ./secrets/trust:/trust:ro
ports:
- 127.0.0.1:9090:9443
networks:
- observe
- admin
mem_limit: 512m
cpus: 0.5
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
loki:
image: grafana/loki:3.5.1
command:
- -config.file=/etc/loki/local.yaml
volumes:
- ./infra/observability/loki.yaml:/etc/loki/local.yaml:ro
- loki_data:/loki
networks:
- observe
- admin
ports:
- 127.0.0.1:3100:9443
mem_limit: 384m
cpus: 0.5
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
tempo:
image: grafana/tempo:2.7.2
command:
- -config.file=/etc/tempo/local.yaml
user: 10001:10001
volumes:
- ./infra/observability/tempo.yaml:/etc/tempo/local.yaml:ro
- tempo_data:/var/tempo
networks:
- observe
- admin
ports:
- 127.0.0.1:3200:9443
mem_limit: 512m
cpus: 1.0
environment:
GOMEMLIMIT: 384MiB
restart: unless-stopped
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
depends_on:
volume-init:
condition: service_completed_successfully
grafana:
image: grafana/grafana:12.0.1
environment:
GF_SECURITY_ADMIN_USER: operator
GF_SECURITY_ADMIN_PASSWORD__FILE: /run/secrets/grafana_password
GF_USERS_ALLOW_SIGN_UP: 'false'
GF_ANALYTICS_REPORTING_ENABLED: 'false'
GF_SERVER_PROTOCOL: https
GF_SERVER_CERT_FILE: /pki/tls.crt
GF_SERVER_CERT_KEY: /pki/tls.key
GF_SERVER_ROOT_URL: https://localhost:3000
secrets:
- grafana_password
volumes:
- ./infra/observability/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards:ro
- ./secrets/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/local.yaml:ro
- ./infra/observability/grafana/dashboards:/var/lib/grafana/dashboards:ro
- grafana_data:/var/lib/grafana
- ./secrets/pki/grafana:/pki:ro
ports:
- 127.0.0.1:3000:3000
networks:
- observe
- admin
mem_limit: 256m
cpus: 0.5
read_only: true
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
broker-tls:
image: mtusi-lab7-api:lab7
command:
- python
- -m
- messenger.tls_gateway
network_mode: service:broker
depends_on:
broker:
condition: service_started
restart: true
volumes:
- ./infra/security/broker-gateway.json:/etc/gateway.json:ro
- ./secrets/pki/broker:/pki:ro
- ./secrets/trust:/trust:ro
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
mem_limit: 96m
cpus: 0.25
restart: unless-stopped
redis-tls:
image: mtusi-lab7-api:lab7
command:
- python
- -m
- messenger.tls_gateway
network_mode: service:redis
depends_on:
redis:
condition: service_started
restart: true
volumes:
- ./infra/security/redis-gateway.json:/etc/gateway.json:ro
- ./secrets/pki/redis:/pki:ro
- ./secrets/trust:/trust:ro
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
mem_limit: 96m
cpus: 0.25
restart: unless-stopped
collector-tls:
image: mtusi-lab7-api:lab7
command:
- python
- -m
- messenger.tls_gateway
network_mode: service:collector
depends_on:
collector:
condition: service_started
restart: true
volumes:
- ./infra/security/collector-gateway.json:/etc/gateway.json:ro
- ./secrets/pki/collector:/pki:ro
- ./secrets/trust:/trust:ro
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
mem_limit: 96m
cpus: 0.25
restart: unless-stopped
prometheus-tls:
image: mtusi-lab7-api:lab7
command:
- python
- -m
- messenger.tls_gateway
network_mode: service:prometheus
depends_on:
prometheus:
condition: service_started
restart: true
volumes:
- ./infra/security/prometheus-gateway.json:/etc/gateway.json:ro
- ./secrets/pki/prometheus:/pki:ro
- ./secrets/trust:/trust:ro
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
mem_limit: 96m
cpus: 0.25
restart: unless-stopped
loki-tls:
image: mtusi-lab7-api:lab7
command:
- python
- -m
- messenger.tls_gateway
network_mode: service:loki
depends_on:
loki:
condition: service_started
restart: true
volumes:
- ./infra/security/loki-gateway.json:/etc/gateway.json:ro
- ./secrets/pki/loki:/pki:ro
- ./secrets/trust:/trust:ro
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
mem_limit: 96m
cpus: 0.25
restart: unless-stopped
tempo-tls:
image: mtusi-lab7-api:lab7
command:
- python
- -m
- messenger.tls_gateway
network_mode: service:tempo
depends_on:
tempo:
condition: service_started
restart: true
volumes:
- ./infra/security/tempo-gateway.json:/etc/gateway.json:ro
- ./secrets/pki/tempo:/pki:ro
- ./secrets/trust:/trust:ro
read_only: true
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
tmpfs:
- /tmp:rw,noexec,nosuid,size=16m,mode=1777
mem_limit: 96m
cpus: 0.25
restart: unless-stopped
openbao:
image: openbao/openbao:2.2.2
command:
- server
- -config=/openbao/config/server.hcl
volumes:
- ./infra/security/openbao.hcl:/openbao/config/server.hcl:ro
- ./secrets/pki/openbao:/pki:ro
- ./secrets/trust:/trust:ro
- bao_data:/openbao/file
networks:
- data
- admin
ports:
- 127.0.0.1:8200:8200
mem_limit: 256m
cpus: 0.5
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
environment:
SKIP_SETCAP: 'true'
SKIP_CHOWN: 'true'
user: 100:1000
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,size=32m,mode=1777
depends_on:
volume-init:
condition: service_completed_successfully
student-tests:
image: mtusi-lab7-api:lab7
profiles:
- tests
command:
- python
- -m
- pytest
- student-tests
- -q
- -o
- cache_dir=/tmp/pytest-cache
environment:
DATABASE_URL_FILE: /run/secrets/database_url
S3_ENDPOINT: https://minio:9000
S3_REGION: us-east-1
S3_BUCKET: messenger-attachments
S3_ACCESS_KEY_ID_FILE: /run/secrets/s3_test_id
S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_test_secret
OTEL_ENABLED: '0'
SSL_CERT_FILE: /trust/ca.crt
AWS_CA_BUNDLE: /trust/ca.crt
CACHE_URL_FILE: /run/secrets/test_cache_url
secrets:
- database_url
- s3_test_id
- s3_test_secret
- test_cache_url
volumes:
- ./secrets/trust:/trust:ro
- ./secrets/trust:/security-tests/trust:ro
- ./secrets/pki/api:/security-tests/pki/api:ro
- ./secrets/pki/lb:/security-tests/pki/lb:ro
- ./secrets/pki/grafana:/security-tests/pki/grafana:ro
- ./secrets/pki/intruder:/security-tests/pki/intruder:ro
- ./secrets/operator/foreign/leaf:/security-tests/operator/foreign/leaf:ro
- ./secrets/pki/operator:/pki:ro
networks:
- data
read_only: true
tmpfs:
- /tmp:rw,nosuid,size=128m,mode=1777
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
mem_limit: 512m
cpus: 1
volume-init:
image: python:3.13.5-slim
user: 0:0
command:
- python
- -c
- import os;os.chown('/tempo',10001,10001);os.chown('/bao',100,1000)
volumes:
- tempo_data:/tempo
- bao_data:/bao
networks:
- data
cap_drop:
- ALL
cap_add:
- CHOWN
security_opt:
- no-new-privileges:true
read_only: true
mem_limit: 64m
cpus: 0.25
security-audit:
image: mtusi-lab7-api:lab7
profiles:
- operator
command:
- python
- /audit-scripts/matrix_audit.py
volumes:
- ./scripts:/audit-scripts:ro
- ./secrets/trust:/trust:ro
- ./secrets/operator/workloads.json:/operator/workloads.json:ro
- ./secrets/operator/foreign/leaf:/foreign:ro
- ./secrets/pki/api:/identities/api:ro
- ./secrets/pki/lb:/identities/lb:ro
- ./secrets/pki/worker:/identities/worker:ro
- ./secrets/pki/relay:/identities/relay:ro
- ./secrets/pki/broker:/identities/broker:ro
- ./secrets/pki/redis:/identities/redis:ro
- ./secrets/pki/collector:/identities/collector:ro
- ./secrets/pki/prometheus:/identities/prometheus:ro
- ./secrets/pki/loki:/identities/loki:ro
- ./secrets/pki/tempo:/identities/tempo:ro
- ./secrets/pki/grafana:/identities/grafana:ro
- ./secrets/pki/operator:/identities/operator:ro
- ./secrets/pki/intruder:/identities/intruder:ro
networks:
- front
- data
- observe
read_only: true
tmpfs:
- /tmp:rw,noexec,nosuid,size=64m,mode=1777
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
mem_limit: 256m
cpus: 0.5
secrets:
- database_url
- s3_test_id
- s3_test_secret
environment:
DATABASE_URL_FILE: /run/secrets/database_url
S3_ACCESS_KEY_ID_FILE: /run/secrets/s3_test_id
S3_SECRET_ACCESS_KEY_FILE: /run/secrets/s3_test_secret
S3_ENDPOINT: https://minio:9000
S3_REGION: us-east-1
S3_BUCKET: messenger-attachments
AWS_CA_BUNDLE: /trust/ca.crt
SSL_CERT_FILE: /trust/ca.crt
OTEL_ENABLED: '0'
networks:
admin: null
observe:
internal: true
front: null
data:
internal: true
secrets:
grafana_password:
file: ./secrets/grafana_password
postgres_password:
file: ./secrets/postgres_password
database_url:
file: ./secrets/database_url
cache_url:
file: ./secrets/cache_url
minio_root_user:
file: ./secrets/minio_root_user
minio_root_password:
file: ./secrets/minio_root_password
s3_access_key_id:
file: ./secrets/s3_access_key_id
s3_secret_access_key:
file: ./secrets/s3_secret_access_key
s3_api_id:
file: ./secrets/s3_api_id
s3_api_secret:
file: ./secrets/s3_api_secret
s3_worker_id:
file: ./secrets/s3_worker_id
s3_worker_secret:
file: ./secrets/s3_worker_secret
s3_relay_id:
file: ./secrets/s3_relay_id
s3_relay_secret:
file: ./secrets/s3_relay_secret
s3_test_id:
file: ./secrets/s3_test_id
s3_test_secret:
file: ./secrets/s3_test_secret
test_cache_url:
file: ./secrets/test_cache_url
volumes:
postgres_data: null
redis_data: null
minio_data: null
broker_data: null
prometheus_data: null
loki_data: null
tempo_data: null
grafana_data: null
bao_data: {}
+22
View File
@@ -0,0 +1,22 @@
{
"recorded_at_utc": "2026-11-30T06:07:01.423165+00:00",
"target_grade": 3,
"level4_claimed": false,
"track5": false,
"branch": "solution/bpi2303-lukyanov",
"uncommitted_work": true,
"result": "PASS for claimed grade3 checks",
"checks": [
"offline check",
"OpenAPI",
"HTTPS smoke",
"external TLS rejection",
"43 student tests",
"fresh migrations twice +43 tests",
"internal mTLS/policy matrix",
"persistence/public failover",
"runtime limits and all required services running"
],
"pending_required_work": [],
"note": "User explicitly chose grade3; further extended grade4 work stopped. Historical optional evidence retained; no claim of full grade4 acceptance."
}
+10
View File
@@ -0,0 +1,10 @@
Container mtusi-lab7-student-tests-run-7013d99d2651 Creating
Container mtusi-lab7-student-tests-run-7013d99d2651 Created
. [100%]
=============================== warnings summary ===============================
../usr/local/lib/python3.13/site-packages/fastapi/testclient.py:1
/usr/local/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
1 passed, 1 warning in 0.94s
+48
View File
@@ -0,0 +1,48 @@
Container mtusi-lab7-student-tests-run-54f28d9aaf76 Creating
Container mtusi-lab7-student-tests-run-54f28d9aaf76 Created
F [100%]
=================================== FAILURES ===================================
____________ test_slow_cache_dns_does_not_delay_authorized_profile _____________
client = <starlette.testclient.TestClient object at 0xffff860d6510>
monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0xffff85f49480>
def test_slow_cache_dns_does_not_delay_authorized_profile(client, monkeypatch):
"""Cache socket timeouts must not let a stalled resolver hold the profile API."""
import socket
import threading
account, body = user(client)
headers, _ = login(client, body)
client.app.state.db.cache.connection_pool.disconnect()
original = socket.getaddrinfo
release = threading.Event()
entered = threading.Event()
def slow_cache_dns(host, *args, **kwargs):
if host == 'redis':
entered.set()
release.wait(2)
return original(host, *args, **kwargs)
monkeypatch.setattr(socket, 'getaddrinfo', slow_cache_dns)
try:
start = time.monotonic()
response = client.get('/api/v1/users/me', headers=headers)
elapsed = time.monotonic() - start
assert response.status_code == 200 and response.json() == account
assert entered.is_set(), 'The cache resolver fault was not exercised'
> assert elapsed < 1, f'Optional cache stalled the profile for {elapsed:.3f}s'
E AssertionError: Optional cache stalled the profile for 2.031s
E assert 2.0308806670000195 < 1
student-tests/test_api.py:168: AssertionError
=============================== warnings summary ===============================
../usr/local/lib/python3.13/site-packages/fastapi/testclient.py:1
/usr/local/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED student-tests/test_api.py::test_slow_cache_dns_does_not_delay_authorized_profile
1 failed, 1 warning in 2.48s
+24
View File
@@ -0,0 +1,24 @@
python3 scripts/verify_cluster.py
PASS: nginx.json
PASS: concurrent-idempotency.json
PASS: persistence.json
PASS: public-failover.json
PASS: sequential-failover.json
PASS: graceful-shutdown.json
PASS: rolling-update.json
Traceback (most recent call last):
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/scripts/verify_cluster.py", line 462, in <module>
main()
~~~~^^
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/scripts/verify_cluster.py", line 456, in main
function()
~~~~~~~~^^
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/scripts/verify_cluster.py", line 396, in dependency_failures
check(response['json']==actor['user'] and response['elapsed']<3,
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
'Redis fallback failed: same_profile='+str(response['json']==actor['user'])+', seconds='+str(round(response['elapsed'],4)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/tests/client.py", line 24, in check
raise Failure(message)
client.Failure: Redis fallback failed: same_profile=True, seconds=5.0902
make: *** [test-cluster] Error 1
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
+22
View File
@@ -0,0 +1,22 @@
python3 scripts/verify_cluster.py
PASS: nginx.json
PASS: concurrent-idempotency.json
PASS: persistence.json
PASS: public-failover.json
PASS: sequential-failover.json
PASS: graceful-shutdown.json
PASS: rolling-update.json
Traceback (most recent call last):
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/scripts/verify_cluster.py", line 458, in <module>
main()
~~~~^^
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/scripts/verify_cluster.py", line 452, in main
function()
~~~~~~~~^^
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/scripts/verify_cluster.py", line 393, in dependency_failures
check(response['json']==actor['user'] and response['elapsed']<3,'Redis fallback failed')
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/tests/client.py", line 24, in check
raise Failure(message)
client.Failure: Redis fallback failed
make: *** [test-cluster] Error 1
+10
View File
@@ -0,0 +1,10 @@
python3 scripts/verify_cluster.py
PASS: nginx.json
PASS: concurrent-idempotency.json
PASS: persistence.json
PASS: public-failover.json
PASS: sequential-failover.json
PASS: graceful-shutdown.json
PASS: rolling-update.json
PASS: dependency-failures.json
PASS: infrastructure.json
+11
View File
@@ -0,0 +1,11 @@
{
"result": "PASS",
"parallel_requests": 8,
"observed_instances": [
"0f61bef4a37a4cb7a5c53ad27bd44e25",
"e15ff292e3d94864a1e757b7734cc5b8"
],
"responses_201": 8,
"messages_created": 1,
"different_body_status": 409
}
+15
View File
@@ -0,0 +1,15 @@
[
{
"labels": {
"alertname": "HighApiErrorRate",
"severity": "warning"
},
"annotations": {
"runbook": "Check postgres.query error spans, DB pool and request logs. Restore DB and confirm resolved.",
"summary": "Business API 5xx exceeds 5% in 1 minute"
},
"state": "firing",
"activeAt": "2026-11-30T05:31:16.478517494Z",
"value": "7.272727272727273e-01"
}
]
+1
View File
@@ -0,0 +1 @@
[]
+2
View File
@@ -0,0 +1,2 @@
PASS: dependency-failures.json
PASS: infrastructure.json
+20
View File
@@ -0,0 +1,20 @@
{
"result": "PASS",
"redis": {
"profile_status": 200,
"fallback_seconds": 0.5153,
"anonymous": 401,
"readiness": 200
},
"postgres": {
"authenticated_status": 503,
"response_seconds": 0.0231,
"anonymous_status": 401,
"internal_api_liveness": [
200,
200
],
"note": "Nginx-generated502/503/504 may have no API JSON/instance headers when all backends become unavailable."
},
"same_session_after_recovery": true
}
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
{"dependencies": [{"name": "annotated-doc", "version": "0.0.5", "vulns": []}, {"name": "annotated-types", "version": "0.8.0", "vulns": []}, {"name": "anyio", "version": "4.16.0", "vulns": []}, {"name": "argon2-cffi", "version": "25.1.0", "vulns": []}, {"name": "argon2-cffi-bindings", "version": "26.1.0", "vulns": []}, {"name": "attrs", "version": "26.1.0", "vulns": []}, {"name": "boto3", "version": "1.38.27", "vulns": []}, {"name": "botocore", "version": "1.38.46", "vulns": []}, {"name": "certifi", "version": "2026.10.23", "vulns": []}, {"name": "cffi", "version": "2.1.1", "vulns": []}, {"name": "charset-normalizer", "version": "3.5.2", "vulns": []}, {"name": "click", "version": "8.5.0", "vulns": []}, {"name": "fastapi", "version": "0.162.2", "vulns": []}, {"name": "googleapis-common-protos", "version": "1.75.0", "vulns": []}, {"name": "h11", "version": "0.16.0", "vulns": []}, {"name": "httpcore", "version": "1.0.9", "vulns": []}, {"name": "httpx", "version": "0.28.1", "vulns": []}, {"name": "idna", "version": "3.20", "vulns": []}, {"name": "importlib-metadata", "version": "8.7.1", "vulns": []}, {"name": "iniconfig", "version": "2.3.1", "vulns": []}, {"name": "jmespath", "version": "1.1.0", "vulns": []}, {"name": "jsonschema", "version": "4.26.0", "vulns": []}, {"name": "jsonschema-path", "version": "0.3.4", "vulns": []}, {"name": "jsonschema-specifications", "version": "2025.9.1", "vulns": []}, {"name": "lazy-object-proxy", "version": "1.13.0", "vulns": []}, {"name": "openapi-schema-validator", "version": "0.6.3", "vulns": []}, {"name": "openapi-spec-validator", "version": "0.7.2", "vulns": []}, {"name": "opentelemetry-api", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-exporter-http-transport", "version": "0.66b2", "vulns": []}, {"name": "opentelemetry-exporter-otlp-common", "version": "0.66b2", "vulns": []}, {"name": "opentelemetry-exporter-otlp-proto-common", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-exporter-otlp-proto-http", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-proto", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-sdk", "version": "1.45.2", "vulns": []}, {"name": "opentelemetry-semantic-conventions", "version": "0.66b2", "vulns": []}, {"name": "packaging", "version": "26.3", "vulns": []}, {"name": "pathable", "version": "0.4.4", "vulns": []}, {"name": "pillow", "version": "13.0.0", "vulns": []}, {"name": "pluggy", "version": "1.7.0", "vulns": []}, {"name": "protobuf", "version": "7.36.2", "vulns": []}, {"name": "psycopg", "version": "3.2.9", "vulns": []}, {"name": "psycopg-binary", "version": "3.2.9", "vulns": []}, {"name": "psycopg-pool", "version": "3.2.6", "vulns": []}, {"name": "pycparser", "version": "3.12", "vulns": []}, {"name": "pydantic", "version": "2.11.5", "vulns": []}, {"name": "pydantic-core", "version": "2.33.2", "vulns": []}, {"name": "pygments", "version": "2.21.0", "vulns": []}, {"name": "pytest", "version": "9.2.0", "vulns": []}, {"name": "python-dateutil", "version": "2.9.0.post0", "vulns": []}, {"name": "pyyaml", "version": "6.0.3", "vulns": []}, {"name": "redis", "version": "6.2.0", "vulns": []}, {"name": "referencing", "version": "0.36.2", "vulns": []}, {"name": "requests", "version": "2.34.2", "vulns": []}, {"name": "rfc3339-validator", "version": "0.1.4", "vulns": []}, {"name": "rpds-py", "version": "2026.9.1", "vulns": []}, {"name": "s3transfer", "version": "0.13.1", "vulns": []}, {"name": "six", "version": "1.17.0", "vulns": []}, {"name": "sniffio", "version": "1.3.1", "vulns": []}, {"name": "starlette", "version": "1.10.0", "vulns": []}, {"name": "typing-inspection", "version": "0.4.4", "vulns": []}, {"name": "typing-extensions", "version": "4.16.0", "vulns": []}, {"name": "urllib3", "version": "2.8.0", "vulns": []}, {"name": "uvicorn", "version": "0.34.3", "vulns": []}, {"name": "zipp", "version": "4.1.2", "vulns": []}], "fixes": []}
+9
View File
@@ -0,0 +1,9 @@
{
"ServerVersion": "29.9.2",
"OperatingSystem": "Docker Desktop",
"OSType": "linux",
"Architecture": "aarch64",
"NCPU": 12,
"MemTotal": 8319172608,
"Driver": "overlayfs"
}
File diff suppressed because one or more lines are too long
+1
View File
@@ -0,0 +1 @@
PASS: infrastructure.json
+83
View File
@@ -0,0 +1,83 @@
./scripts/check_fresh_migrations.sh
Volume mtusi-lab7-fresh-82190_minio_data Creating
Volume mtusi-lab7-fresh-82190_minio_data Creating
Volume mtusi-lab7-fresh-82190_redis_data Creating
Volume mtusi-lab7-fresh-82190_redis_data Creating
Network mtusi-lab7-fresh-82190_data Creating
Volume mtusi-lab7-fresh-82190_postgres_data Creating
Volume mtusi-lab7-fresh-82190_postgres_data Creating
Network mtusi-lab7-fresh-82190_data Creating
Volume mtusi-lab7-fresh-82190_minio_data Created
Volume mtusi-lab7-fresh-82190_minio_data Created
Volume mtusi-lab7-fresh-82190_redis_data Created
Volume mtusi-lab7-fresh-82190_redis_data Created
Volume mtusi-lab7-fresh-82190_postgres_data Created
Volume mtusi-lab7-fresh-82190_postgres_data Created
Network mtusi-lab7-fresh-82190_data Created
Network mtusi-lab7-fresh-82190_data Created
Container mtusi-lab7-fresh-82190-minio-1 Creating
Container mtusi-lab7-fresh-82190-postgres-1 Creating
Container mtusi-lab7-fresh-82190-redis-1 Creating
Container mtusi-lab7-fresh-82190-minio-1 Created
Container mtusi-lab7-fresh-82190-minio-init-1 Creating
Container mtusi-lab7-fresh-82190-redis-1 Created
Container mtusi-lab7-fresh-82190-redis-tls-1 Creating
Container mtusi-lab7-fresh-82190-postgres-1 Created
Container mtusi-lab7-fresh-82190-minio-init-1 Created
Container mtusi-lab7-fresh-82190-redis-tls-1 Created
Container mtusi-lab7-fresh-82190-redis-1 Starting
Container mtusi-lab7-fresh-82190-minio-1 Starting
Container mtusi-lab7-fresh-82190-postgres-1 Starting
Container mtusi-lab7-fresh-82190-redis-1 Started
Container mtusi-lab7-fresh-82190-redis-tls-1 Starting
Container mtusi-lab7-fresh-82190-minio-1 Started
Container mtusi-lab7-fresh-82190-minio-1 Waiting
Container mtusi-lab7-fresh-82190-postgres-1 Started
Container mtusi-lab7-fresh-82190-redis-tls-1 Started
Container mtusi-lab7-fresh-82190-minio-1 Healthy
Container mtusi-lab7-fresh-82190-minio-init-1 Starting
Container mtusi-lab7-fresh-82190-minio-init-1 Started
Container mtusi-lab7-fresh-82190-minio-init-1 Waiting
Container mtusi-lab7-fresh-82190-postgres-1 Waiting
Container mtusi-lab7-fresh-82190-minio-1 Waiting
Container mtusi-lab7-fresh-82190-redis-1 Waiting
Container mtusi-lab7-fresh-82190-redis-tls-1 Waiting
Container mtusi-lab7-fresh-82190-minio-1 Healthy
Container mtusi-lab7-fresh-82190-redis-1 Healthy
Container mtusi-lab7-fresh-82190-redis-tls-1 Healthy
Container mtusi-lab7-fresh-82190-postgres-1 Healthy
Container mtusi-lab7-fresh-82190-minio-init-1 Healthy
Container mtusi-lab7-fresh-82190-migrate-run-9bb7751b3020 Creating
Container mtusi-lab7-fresh-82190-migrate-run-9bb7751b3020 Created
Applied 001_initial.sql
Applied 002_idempotency.sql
Applied 003_attachments.sql
Applied 004_jobs.sql
Applied 005_auth_limits.sql
Migrations up to date
Least privilege DB roles ready
Container mtusi-lab7-fresh-82190-migrate-run-eb821a1a5660 Creating
Container mtusi-lab7-fresh-82190-migrate-run-eb821a1a5660 Created
Migrations up to date
Least privilege DB roles ready
Container mtusi-lab7-fresh-82190-student-tests-run-bf71a5bb9f1c Creating
Container mtusi-lab7-fresh-82190-student-tests-run-bf71a5bb9f1c Created
........................................... [100%]
=============================== warnings summary ===============================
../usr/local/lib/python3.13/site-packages/fastapi/testclient.py:1
/usr/local/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
student-tests/test_attachments.py: 19 warnings
student-tests/test_idempotency.py: 1 warning
student-tests/test_jobs.py: 6 warnings
/usr/local/lib/python3.13/site-packages/botocore/auth.py:422: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
datetime_now = datetime.datetime.utcnow()
student-tests/test_attachments.py::test_invalid_media_corruption_limits_and_filename
/usr/local/lib/python3.13/site-packages/PIL/Image.py:3593: DecompressionBombWarning: Image size (40004000 pixels) exceeds limit of 40000000 pixels, could be decompression bomb DOS attack.
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
43 passed, 28 warnings in 13.43s
PASS: TLS-backed fresh volumes, migrations 001–005 twice and full operator test suite.
+16
View File
@@ -0,0 +1,16 @@
{
"result": "PASS",
"target_container": "8d0c20070ca334dfdd732b758346508c72be60ec36df8fd94be0f4997358ffb4",
"target_instance": "2270a1857a6b4cd6affd685750c1bcb8",
"fixture": "temporary BEFORE INSERT trigger sleeps2s for one synthetic text; removed afterwards",
"in_flight_observed_in_pg_stat_activity": true,
"in_flight_response": 201,
"new_tcp_after_sigterm": {
"accepted": false,
"error_type": "ConnectionRefusedError"
},
"target_still_running_when_new_tcp_rejected": true,
"exit_code": 0,
"shutdown_seconds_from_sigterm": 1.7817,
"confirmed_message_preserved": true
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+479
View File
@@ -0,0 +1,479 @@
{
"result": "PASS",
"containers": [
{
"service": "api",
"container": "8732cc34386f7b1d772735c45db3b7b18501e1dbeee4bab209ef66926d45b36a",
"name": "mtusi-lab7-api-10",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:55:47.894462129Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data",
"mtusi-lab7_front"
],
"http_status": 200,
"instance": "40a0525623da4796ac6410b953c2509a",
"release": "lab7-db3a1be8"
},
{
"service": "api",
"container": "2a9ffbea893ad045d3e1370392342508083ffc6736534bafab156e314c4a191c",
"name": "mtusi-lab7-api-9",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:55:47.778499338Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data",
"mtusi-lab7_front"
],
"http_status": 200,
"instance": "c391ed5c8bd849fd9af23f726ca8426a",
"release": "lab7-db3a1be8"
},
{
"service": "broker",
"container": "c128f35c22d105b94a0946e7cea13ebcfc33c3cb75ab3e1919900052beb2575b",
"name": "mtusi-lab7-broker-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:39.147270875Z",
"image": "redis:7.4.4-bookworm",
"image_id": "sha256:7b5ee51c14cf5febd4adde3a4b6cced72efdf154df7e9a0383163b13e16e9091",
"memory_bytes": 167772160,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_broker_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "broker-tls",
"container": "91bd506b6ddee965196cd65d629e30974e9fbf2552eb149f14942b3db24f60b4",
"name": "mtusi-lab7-broker-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:57:49.60183113Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "collector",
"container": "7b20fe9c7fd98096933f3cf8a256e988df98794e5bf99115333b546eb38aaddf",
"name": "mtusi-lab7-collector-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:41.199239835Z",
"image": "otel/opentelemetry-collector-contrib:0.128.0",
"image_id": "sha256:1ab0baba0ee3695d823c46653d8a6e8894896e668ce8bd7ebe002e948d827bc7",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data",
"mtusi-lab7_observe"
]
},
{
"service": "collector-tls",
"container": "dd5f31c61273bd574c6aa3bdea7910084b6c3c6cfb9efbb0d3f27e9b6133f750",
"name": "mtusi-lab7-collector-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:57:49.364164797Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "grafana",
"container": "f48af18f481bf773c662a920288ddf549c70780ce18056d6ae9234d6f490f3a0",
"name": "mtusi-lab7-grafana-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:39.349721875Z",
"image": "grafana/grafana:12.0.1",
"image_id": "sha256:06dc8d60e184705e5dc00e051a6d92342a44010d7d5e538d0a36339e85abb9b7",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {
"3000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3000"
}
]
},
"volumes": [
"mtusi-lab7_grafana_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "lb",
"container": "bde68a3ccbf1498562bf014833f62e7ee57a7323b047428e56916b4444b351ca",
"name": "mtusi-lab7-lb-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:48.626875171Z",
"image": "nginx:1.28.0-alpine",
"image_id": "sha256:30f1c0d78e0ad60901648be663a710bdadf19e4c10ac6782c235200619158284",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8443"
}
]
},
"volumes": [],
"networks": [
"mtusi-lab7_front"
]
},
{
"service": "loki",
"container": "ab7a3685b1a62b27ed338f4ede68fa726f5429a5ec8d9b8415ef4eda248e1cfe",
"name": "mtusi-lab7-loki-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:41.387287543Z",
"image": "grafana/loki:3.5.1",
"image_id": "sha256:a74594532eec4cc313401beedc4dd2708c43674c032084b1aeb87c14a5be1745",
"memory_bytes": 402653184,
"nano_cpus": 500000000,
"published_ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3100"
}
]
},
"volumes": [
"mtusi-lab7_loki_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "loki-tls",
"container": "53947192c662def21522452bb65e4d9ef138bc5b09702124607c188be064ba9a",
"name": "mtusi-lab7-loki-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:57:49.519024339Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "migrate",
"container": "b5824ce688874d7716a59276fd2f5ce14061a654dfeb6e20d9fbf45ce30b959a",
"name": "mtusi-lab7-migrate-1",
"status": "exited",
"health": null,
"started_at": "2026-11-30T05:50:02.145670803Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "minio",
"container": "5e764d999c7ff4f752440039cd00ad420cbd9bf5fa3557784f388ced703ea3af",
"name": "mtusi-lab7-minio-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:39.201783917Z",
"image": "mtusi-lab7-minio:2025-04-22",
"image_id": "sha256:81a1e194f7ccc95eb250d815021a1b2196e6fb0d51e69fb4ed886243d28cd0c9",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_minio_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "minio-init",
"container": "c1a4484b41823d7746fa5de9dc6f5313886422e28164587d43140baa3dc58425",
"name": "mtusi-lab7-minio-init-1",
"status": "exited",
"health": null,
"started_at": "2026-11-30T05:50:02.03693722Z",
"image": "mtusi-lab7-mc:2025-04-16",
"image_id": "sha256:39bdefe42ef942ebc93a448f07a6eba9895a3a7d740693208d4db33865799efb",
"memory_bytes": 134217728,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "openbao",
"container": "ab080ae67c50bc4c5b7ee82245e6da9fae3d8a32791ec8fd357dd0afcff44842",
"name": "mtusi-lab7-openbao-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:39.761705376Z",
"image": "openbao/openbao:2.2.2",
"image_id": "sha256:d5d098f98f5ca7cae2e33d1e6dd9e2bea332275ad6bb7ff09032b48af3e1141e",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {
"8200/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8200"
}
]
},
"volumes": [
"c94f0ce3a8a7735bfb5d9d3916af425bcbd2c67b871e72143122f71a452923e6",
"mtusi-lab7_bao_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_data"
]
},
{
"service": "postgres",
"container": "6243c8e298b2e41ab620421f3f97fa2aad7d5a01ed46c23bda4bcdb8f00f10a7",
"name": "mtusi-lab7-postgres-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:39.264848709Z",
"image": "postgres:17.5-bookworm",
"image_id": "sha256:fbcea1bd13b6a882cd6caa6b58db3ae5c102efe50ec625b3e2a5cbc50db5bfe4",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_postgres_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "prometheus",
"container": "62f36584701c1a7ea1c3baf10cd037ce73e2ea781fdbbc5976fb25d558f636c5",
"name": "mtusi-lab7-prometheus-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:39.411575792Z",
"image": "prom/prometheus:v3.4.1",
"image_id": "sha256:9abc6cf6aea7710d163dbb28d8eeb7dc5baef01e38fa4cd146a406dd9f07f70d",
"memory_bytes": 536870912,
"nano_cpus": 500000000,
"published_ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9090"
}
]
},
"volumes": [
"mtusi-lab7_prometheus_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "prometheus-tls",
"container": "148bcbd6c96b68b4d9530680f780846f669cad666d0e34008fa16fa6b8785964",
"name": "mtusi-lab7-prometheus-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:57:49.30123963Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "redis",
"container": "d4b1cc3a4e63bb59ba335c4caaf63d303a6dfa1d084b5d7e15132bbc5ec35bd4",
"name": "mtusi-lab7-redis-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:39.293127417Z",
"image": "redis:7.4.4-bookworm",
"image_id": "sha256:7b5ee51c14cf5febd4adde3a4b6cced72efdf154df7e9a0383163b13e16e9091",
"memory_bytes": 134217728,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_redis_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "redis-tls",
"container": "8edbf90709bb8fe71d36d1861de7b1f41f6e51411f4225d217e02614907d6de0",
"name": "mtusi-lab7-redis-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:57:49.436564755Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "relay",
"container": "e20303230205618b61087d44b6d3e2c671baffadc501d1c38d91f2563fb8a50d",
"name": "mtusi-lab7-relay-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:45.766696837Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 201326592,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "tempo",
"container": "6a23563d1b29abe512915123f3c2af1ea785c8a1b801bcaa3112017250fab99d",
"name": "mtusi-lab7-tempo-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T06:01:11.630758085Z",
"image": "grafana/tempo:2.7.2",
"image_id": "sha256:4b0277a9b572a4b1fa43b01468e58911ec214dd69d033f2cd476596d14de9fe3",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3200"
}
]
},
"volumes": [
"mtusi-lab7_tempo_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "tempo-tls",
"container": "561f56259305cffaf93500c22568a03f76a891f65512b43e066a4828ea89ded8",
"name": "mtusi-lab7-tempo-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T06:01:11.73995371Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "volume-init",
"container": "96e8282d8074e506814cd6d52c79f27e45237dc77f095f2329e225de7a8b2bde",
"name": "mtusi-lab7-volume-init-1",
"status": "exited",
"health": null,
"started_at": "2026-11-30T05:50:01.522942219Z",
"image": "python:3.13.5-slim",
"image_id": "sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419",
"memory_bytes": 67108864,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_bao_data",
"mtusi-lab7_tempo_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "worker",
"container": "a092f6c54bf48986639f627ff1a59dd816fd87c67aeb51f387245ba876037677",
"name": "mtusi-lab7-worker-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:56:52.460603007Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
}
]
}
+28
View File
@@ -0,0 +1,28 @@
{
"result": "PASS",
"commit_publish_gap": {
"accepted_status": 202,
"outbox_unpublished": true,
"api_broker_restarted": true,
"same_job_ready": true
},
"broker_persistence": {
"unread_job_survived_restart": true
},
"after_put_before_ack": {
"s3_effect_written": true,
"lease_recovery_seconds": 89.778,
"attempt_after_recovery": 2,
"same_job": true,
"crash_exit_code": 137
},
"duplicate": {
"ready_noop": true
},
"retry_replay": {
"failed_after": 5,
"code": "retry_exhausted",
"explicit_replay_ready": true,
"failed_attachment_binding": 409
}
}
+3
View File
@@ -0,0 +1,3 @@
python3 scripts/verify_jobs.py
Waiting for real 90s lease expiry after killed worker.
PASS: jobs-faults.json
+11
View File
@@ -0,0 +1,11 @@
{
"container": "c1c9d8fc713aec83cc8e303fb777aa55dd694a8a675ba33534449f4bcdcf6936",
"name": "mtusi-lab7-api-8",
"instance": "6fc2ed0d62874c2a84e0fdaae42e94cf",
"release": "lab7-v1",
"image_id": "sha256:5de48f3e0b4c1ed6967c8a390a0d03591ea421cb3a63e90a9b929d1bb2a2b947",
"stopped_at_utc": "2026-11-30T05:50:28.647788+00:00",
"stop_seconds": 0.43,
"exit_code": 0,
"left_stopped": true
}
+4
View File
@@ -0,0 +1,4 @@
python3 scripts/verify_security.py
OpenBao initialized/unsealed; scoped cert auth and KV policies ready. Values hidden.
OpenBao initialized/unsealed; scoped cert auth and KV policies ready. Values hidden.
PASS: security-lifecycle.json and secure trace/log proof
File diff suppressed because it is too large Load Diff
+1
View File
@@ -0,0 +1 @@
PASS:3 load repeats + resource samples and dataset counts
+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.032,
"concurrency": 4,
"successful_requests": 9538,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 317.591,
"successful_latency_ms": {
"p50": 11.666,
"p95": 18.436,
"p99": 39.442
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+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.032,
"concurrency": 4,
"successful_requests": 9538,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 317.591,
"successful_latency_ms": {
"p50": 11.666,
"p95": 18.436,
"p99": 39.442
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+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.01,
"concurrency": 4,
"successful_requests": 9691,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 322.921,
"successful_latency_ms": {
"p50": 11.465,
"p95": 18.378,
"p99": 35.983
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+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.01,
"concurrency": 4,
"successful_requests": 9691,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 322.921,
"successful_latency_ms": {
"p50": 11.465,
"p95": 18.378,
"p99": 35.983
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+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.006,
"concurrency": 4,
"successful_requests": 9991,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 332.968,
"successful_latency_ms": {
"p50": 11.425,
"p95": 16.125,
"p99": 35.421
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+18
View File
@@ -0,0 +1,18 @@
python3 tests/load.py --base-url "https://localhost:8443" --ca-file "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/secrets/trust/ca.crt" --duration 30 --concurrency 4 --output evidence/load.json
{
"lab": 7,
"workload": "closed-loop POST messages; no automatic retries",
"requested_duration_seconds": 30.0,
"elapsed_seconds": 30.006,
"concurrency": 4,
"successful_requests": 9991,
"failed_requests": 0,
"error_ratio": 0.0,
"successful_rps": 332.968,
"successful_latency_ms": {
"p50": 11.425,
"p95": 16.125,
"p99": 35.421
},
"note": "Latency percentiles cover successes only. Timeouts/errors are counted separately; closed-loop has coordinated omission and client overhead."
}
+2064
View File
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
{
"result": "PASS",
"version": "nginx version: nginx/1.28.0",
"image": "nginx:1.28.0-alpine",
"public_server_header": "nginx",
"config_syntax": "PASS",
"observed_instances": [
"0f61bef4a37a4cb7a5c53ad27bd44e25",
"e15ff292e3d94864a1e757b7734cc5b8"
]
}
+13
View File
@@ -0,0 +1,13 @@
Traceback (most recent call last):
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/scripts/verify_observability.py", line 143, in <module>
if __name__=='__main__': main()
~~~~^^
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/scripts/verify_observability.py", line 54, in main
c=Client();alice,bob,_,chat=c.bootstrap()
~~~~~~~~~~~^^
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/tests/client.py", line 171, in bootstrap
self.call('GET','/health/live',schema='Health')
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/tests/client.py", line 125, in call
raise Failure(method + ' ' + path.split('?')[0] + ': connection/TLS failure (' + type(exc).__name__ + ')') from None
client.Failure: GET /health/live: connection/TLS failure (URLError)
+374
View File
@@ -0,0 +1,374 @@
{
"result": "PASS",
"trace": {
"trace_id": "0628221118a0c0036d21036b8ebc7bcf",
"span_names": [
"POST /api/v1/chats/{chat_id}/attachments",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.query",
"s3.put",
"postgres.query",
"postgres.query",
"postgres.query",
"postgres.commit",
"fastapi.dependencies",
"fastapi.endpoint",
"fastapi.serialization",
"attachments.publish",
"attachments.consume",
"postgres.query",
"postgres.query",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.query",
"postgres.commit",
"attachments.process_objects",
"s3.get",
"attachments.publish",
"attachments.consume",
"postgres.query",
"postgres.query",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.query",
"postgres.commit",
"attachments.process_objects",
"s3.get",
"attachments.publish",
"attachments.consume",
"postgres.query",
"postgres.query",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.query",
"s3.delete",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.commit",
"postgres.query",
"postgres.query",
"postgres.commit",
"attachments.process_objects",
"s3.get",
"s3.put",
"s3.put",
"s3.put",
"s3.put"
],
"retry_attempts": 3,
"api_worker_logs_correlated": true
},
"queue_incident": {
"oldest_age": [
{
"metric": {},
"value": [
1796016664.654,
"33.977758"
]
}
],
"depth": [
{
"metric": {},
"value": [
1796016664.663,
"1"
]
}
],
"alert": "firing",
"after_restore": "resolved"
},
"db_incident": {
"failures": [
{
"status": 503,
"elapsed": 4.0340326249133795,
"trace_id": "6c8a3962f6f5e9d05708ab80eaf2420f"
},
{
"status": 503,
"elapsed": 4.029339542030357,
"trace_id": "a4faf54f378e5371f3128376d2ce3300"
},
{
"status": 503,
"elapsed": 4.040454874979332,
"trace_id": "d5d73b236e61197e7b9d85a9faaef21d"
},
{
"status": 503,
"elapsed": 4.021067416993901,
"trace_id": "0c8a94ef29beb97742efbfd74a2b6b80"
},
{
"status": 503,
"elapsed": 4.016547124949284,
"trace_id": "17ccc17de550c38e0c71addcb055889e"
},
{
"status": 503,
"elapsed": 4.031094582984224,
"trace_id": "842e860d175518ef97623033674f9e07"
},
{
"status": 503,
"elapsed": 4.019175374996848,
"trace_id": "114f14849dc971e32a7a90efe32ed981"
},
{
"status": 503,
"elapsed": 4.013815667014569,
"trace_id": "624e4fc5ae9925fc5204f16a6238998b"
},
{
"status": 503,
"elapsed": 4.031454249983653,
"trace_id": "ad13e58f4f14ec3477f3e7d90a8f3a5a"
}
],
"before": "firing",
"after": "resolved",
"pool_waiting": [
{
"metric": {},
"value": [
1796016738.606,
"0"
]
}
]
},
"telemetry_outage": {
"successful_messages": 1972,
"seconds": 27.168,
"collector_before": {
"BlockIO": "1.26GB / 21MB",
"CPUPerc": "3.52%",
"Container": "7b20fe9c7fd98096933f3cf8a256e988df98794e5bf99115333b546eb38aaddf",
"ID": "7b20fe9c7fd9",
"MemPerc": "78.35%",
"MemUsage": "200.6MiB / 256MiB",
"Name": "mtusi-lab7-collector-1",
"NetIO": "19MB / 10.2MB",
"PIDs": "17"
},
"collector_after": {
"BlockIO": "1.26GB / 21MB",
"CPUPerc": "1.08%",
"Container": "7b20fe9c7fd98096933f3cf8a256e988df98794e5bf99115333b546eb38aaddf",
"ID": "7b20fe9c7fd9",
"MemPerc": "79.45%",
"MemUsage": "203.4MiB / 256MiB",
"Name": "mtusi-lab7-collector-1",
"NetIO": "26.1MB / 10.8MB",
"PIDs": "17"
},
"collector_metrics": [
{
"metric": {
"__name__": "otelcol_exporter_queue_capacity",
"data_type": "logs",
"exporter": "otlphttp/loki",
"instance": "collector:8889",
"job": "collector",
"otel_scope_name": "go.opentelemetry.io/collector/exporter/exporterhelper"
},
"value": [
1796016766.07,
"256"
]
},
{
"metric": {
"__name__": "otelcol_exporter_queue_capacity",
"data_type": "traces",
"exporter": "otlp/tempo",
"instance": "collector:8889",
"job": "collector",
"otel_scope_name": "go.opentelemetry.io/collector/exporter/exporterhelper"
},
"value": [
1796016766.07,
"256"
]
},
{
"metric": {
"__name__": "otelcol_exporter_queue_size",
"data_type": "logs",
"exporter": "otlphttp/loki",
"instance": "collector:8889",
"job": "collector",
"otel_scope_name": "go.opentelemetry.io/collector/exporter/exporterhelper"
},
"value": [
1796016766.07,
"23"
]
},
{
"metric": {
"__name__": "otelcol_exporter_queue_size",
"data_type": "traces",
"exporter": "otlp/tempo",
"instance": "collector:8889",
"job": "collector",
"otel_scope_name": "go.opentelemetry.io/collector/exporter/exporterhelper"
},
"value": [
1796016766.07,
"220"
]
},
{
"metric": {
"__name__": "otelcol_exporter_send_failed_spans_total",
"exporter": "otlp/tempo",
"instance": "collector:8889",
"job": "collector",
"otel_scope_name": "go.opentelemetry.io/collector/exporter/exporterhelper"
},
"value": [
1796016766.07,
"256"
]
},
{
"metric": {
"__name__": "otelcol_exporter_sent_spans_total",
"exporter": "otlp/tempo",
"instance": "collector:8889",
"job": "collector",
"otel_scope_name": "go.opentelemetry.io/collector/exporter/exporterhelper"
},
"value": [
1796016766.07,
"38287"
]
},
{
"metric": {
"__name__": "otelcol_receiver_accepted_spans_total",
"instance": "collector:8889",
"job": "collector",
"otel_scope_name": "go.opentelemetry.io/collector/receiver/receiverhelper",
"receiver": "otlp",
"transport": "http"
},
"value": [
1796016766.07,
"67259"
]
}
],
"queue_limit_batches": 256,
"collector_limit_mib": 256
},
"dashboard_queries": [
{
"panel": "Business RPS",
"expression": "sum(rate(http_requests_total[1m]))",
"series": 1
},
{
"panel": "5xx ratio",
"expression": "sum(rate(http_requests_total{status_class=\"5xx\"}[1m])) / clamp_min(sum(rate(http_requests_total[1m])),0.001)",
"series": 1
},
{
"panel": "HTTP p50",
"expression": "histogram_quantile(0.5,sum by(le)(rate(http_server_duration_seconds_bucket[1m])))",
"series": 1
},
{
"panel": "HTTP p95",
"expression": "histogram_quantile(0.95,sum by(le)(rate(http_server_duration_seconds_bucket[1m])))",
"series": 1
},
{
"panel": "HTTP p99",
"expression": "histogram_quantile(0.99,sum by(le)(rate(http_server_duration_seconds_bucket[1m])))",
"series": 1
},
{
"panel": "Jobs by outcome",
"expression": "sum by(outcome)(rate(jobs_processed_total[1m]))",
"series": 1
},
{
"panel": "Job p95",
"expression": "histogram_quantile(0.95,sum by(le)(rate(job_processing_duration_seconds_bucket[1m])))",
"series": 1
},
{
"panel": "Accepted to ready p95",
"expression": "histogram_quantile(0.95,sum by(le)(rate(attachment_ready_seconds_bucket[1m])))",
"series": 1
},
{
"panel": "Queue depth",
"expression": "max(queue_depth)",
"series": 1
},
{
"panel": "Oldest unfinished job",
"expression": "max(queue_oldest_age_seconds)",
"series": 1
},
{
"panel": "DB pool used / waiting",
"expression": "sum by(service_name)(db_pool_used)",
"series": 3
},
{
"panel": "DB pool waiting",
"expression": "sum by(service_name)(db_pool_waiting)",
"series": 3
},
{
"panel": "Worker busy / capacity",
"expression": "sum(worker_busy{service_name=\"messenger-worker\"}) / clamp_min(sum(worker_capacity{service_name=\"messenger-worker\"}),1)",
"series": 1
},
{
"panel": "Process RSS",
"expression": "process_memory_bytes",
"series": 4
},
{
"panel": "Process CPU cores",
"expression": "rate(process_cpu_seconds_total[1m])",
"series": 4
}
]
}
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/verify_observability.py
PASS: observability.json, traces/logs and firing/resolved alerts
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/cluster.py exec python scripts/validate_openapi.py
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
+956
View File
@@ -0,0 +1,956 @@
{
"result": "PASS",
"before": [
{
"service": "api",
"container": "f702f1490dee9897163a65acf7131783c6df35a078f213ea6d4486772c899c1b",
"name": "mtusi-lab7-api-10",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:03.616594095Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data",
"mtusi-lab7_front"
],
"http_status": 200,
"instance": "d79daeab2c2647aab850e6963ee3bb45",
"release": "lab7-db3a1be8"
},
{
"service": "api",
"container": "d49f5e45ed8dd945cad9d2e6c439b6a0471aecc81c46aeb0c417aab30d14e947",
"name": "mtusi-lab7-api-9",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:50:57.536282884Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data",
"mtusi-lab7_front"
],
"http_status": 200,
"instance": "083e1353373d4d829a394729392f1d45",
"release": "lab7-db3a1be8"
},
{
"service": "broker",
"container": "c128f35c22d105b94a0946e7cea13ebcfc33c3cb75ab3e1919900052beb2575b",
"name": "mtusi-lab7-broker-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:49:35.416826763Z",
"image": "redis:7.4.4-bookworm",
"image_id": "sha256:7b5ee51c14cf5febd4adde3a4b6cced72efdf154df7e9a0383163b13e16e9091",
"memory_bytes": 167772160,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_broker_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "broker-tls",
"container": "9eedfced5b64ea731e1210bf38c5402f0ad4dfdea369e60214d39cb662ab33f2",
"name": "mtusi-lab7-broker-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:39.645892792Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "collector",
"container": "7b20fe9c7fd98096933f3cf8a256e988df98794e5bf99115333b546eb38aaddf",
"name": "mtusi-lab7-collector-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:35.477378638Z",
"image": "otel/opentelemetry-collector-contrib:0.128.0",
"image_id": "sha256:1ab0baba0ee3695d823c46653d8a6e8894896e668ce8bd7ebe002e948d827bc7",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data",
"mtusi-lab7_observe"
]
},
{
"service": "collector-tls",
"container": "67888c667a398497ea7206c6fa04393e6ae77753509dd07b87ea86a151ca0f51",
"name": "mtusi-lab7-collector-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:39.641900709Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "grafana",
"container": "f48af18f481bf773c662a920288ddf549c70780ce18056d6ae9234d6f490f3a0",
"name": "mtusi-lab7-grafana-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:35.543958305Z",
"image": "grafana/grafana:12.0.1",
"image_id": "sha256:06dc8d60e184705e5dc00e051a6d92342a44010d7d5e538d0a36339e85abb9b7",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {
"3000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3000"
}
]
},
"volumes": [
"mtusi-lab7_grafana_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "lb",
"container": "bde68a3ccbf1498562bf014833f62e7ee57a7323b047428e56916b4444b351ca",
"name": "mtusi-lab7-lb-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:49:43.308140711Z",
"image": "nginx:1.28.0-alpine",
"image_id": "sha256:30f1c0d78e0ad60901648be663a710bdadf19e4c10ac6782c235200619158284",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8443"
}
]
},
"volumes": [],
"networks": [
"mtusi-lab7_front"
]
},
{
"service": "loki",
"container": "ab7a3685b1a62b27ed338f4ede68fa726f5429a5ec8d9b8415ef4eda248e1cfe",
"name": "mtusi-lab7-loki-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:35.970190263Z",
"image": "grafana/loki:3.5.1",
"image_id": "sha256:a74594532eec4cc313401beedc4dd2708c43674c032084b1aeb87c14a5be1745",
"memory_bytes": 402653184,
"nano_cpus": 500000000,
"published_ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3100"
}
]
},
"volumes": [
"mtusi-lab7_loki_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "loki-tls",
"container": "e356601cd3b1928860c39b5b60c1b5785d0b9bccb3148175f43aba4e3158e51c",
"name": "mtusi-lab7-loki-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:39.640199042Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "migrate",
"container": "b5824ce688874d7716a59276fd2f5ce14061a654dfeb6e20d9fbf45ce30b959a",
"name": "mtusi-lab7-migrate-1",
"status": "exited",
"health": null,
"started_at": "2026-11-30T05:50:02.145670803Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "minio",
"container": "5e764d999c7ff4f752440039cd00ad420cbd9bf5fa3557784f388ced703ea3af",
"name": "mtusi-lab7-minio-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:49:35.301305388Z",
"image": "mtusi-lab7-minio:2025-04-22",
"image_id": "sha256:81a1e194f7ccc95eb250d815021a1b2196e6fb0d51e69fb4ed886243d28cd0c9",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_minio_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "minio-init",
"container": "c1a4484b41823d7746fa5de9dc6f5313886422e28164587d43140baa3dc58425",
"name": "mtusi-lab7-minio-init-1",
"status": "exited",
"health": null,
"started_at": "2026-11-30T05:50:02.03693722Z",
"image": "mtusi-lab7-mc:2025-04-16",
"image_id": "sha256:39bdefe42ef942ebc93a448f07a6eba9895a3a7d740693208d4db33865799efb",
"memory_bytes": 134217728,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "openbao",
"container": "ab080ae67c50bc4c5b7ee82245e6da9fae3d8a32791ec8fd357dd0afcff44842",
"name": "mtusi-lab7-openbao-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:35.59360193Z",
"image": "openbao/openbao:2.2.2",
"image_id": "sha256:d5d098f98f5ca7cae2e33d1e6dd9e2bea332275ad6bb7ff09032b48af3e1141e",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {
"8200/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8200"
}
]
},
"volumes": [
"c94f0ce3a8a7735bfb5d9d3916af425bcbd2c67b871e72143122f71a452923e6",
"mtusi-lab7_bao_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_data"
]
},
{
"service": "postgres",
"container": "6243c8e298b2e41ab620421f3f97fa2aad7d5a01ed46c23bda4bcdb8f00f10a7",
"name": "mtusi-lab7-postgres-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:20.231999547Z",
"image": "postgres:17.5-bookworm",
"image_id": "sha256:fbcea1bd13b6a882cd6caa6b58db3ae5c102efe50ec625b3e2a5cbc50db5bfe4",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_postgres_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "prometheus",
"container": "62f36584701c1a7ea1c3baf10cd037ce73e2ea781fdbbc5976fb25d558f636c5",
"name": "mtusi-lab7-prometheus-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:35.609649013Z",
"image": "prom/prometheus:v3.4.1",
"image_id": "sha256:9abc6cf6aea7710d163dbb28d8eeb7dc5baef01e38fa4cd146a406dd9f07f70d",
"memory_bytes": 536870912,
"nano_cpus": 500000000,
"published_ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9090"
}
]
},
"volumes": [
"mtusi-lab7_prometheus_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "prometheus-tls",
"container": "108d2f140a0b273de4436aaf71bc6cddd3a6630eca7eced358b58733af1e01fa",
"name": "mtusi-lab7-prometheus-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:39.642763126Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "redis",
"container": "d4b1cc3a4e63bb59ba335c4caaf63d303a6dfa1d084b5d7e15132bbc5ec35bd4",
"name": "mtusi-lab7-redis-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:15.43913842Z",
"image": "redis:7.4.4-bookworm",
"image_id": "sha256:7b5ee51c14cf5febd4adde3a4b6cced72efdf154df7e9a0383163b13e16e9091",
"memory_bytes": 134217728,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_redis_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "redis-tls",
"container": "9b38712f8e171d0b8588b710b25cd7b03b674147c9ec725b1040db870c7b6161",
"name": "mtusi-lab7-redis-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:18.862429963Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "relay",
"container": "46fbebac7f9be692f8e486d5327bc5be7abcd240bc14d68b0e886cc1328cca25",
"name": "mtusi-lab7-relay-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:39.986720751Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:5de48f3e0b4c1ed6967c8a390a0d03591ea421cb3a63e90a9b929d1bb2a2b947",
"memory_bytes": 201326592,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "tempo",
"container": "1b7e0b1cb472f474d780cf0100ae404e4fbe6394f3719475c213c2f5fff1477c",
"name": "mtusi-lab7-tempo-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:35.63535168Z",
"image": "grafana/tempo:2.7.2",
"image_id": "sha256:4b0277a9b572a4b1fa43b01468e58911ec214dd69d033f2cd476596d14de9fe3",
"memory_bytes": 402653184,
"nano_cpus": 500000000,
"published_ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3200"
}
]
},
"volumes": [
"mtusi-lab7_tempo_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "tempo-tls",
"container": "f6335b6d9684c303991e39f18a731be18a2d74153ee0836f844fbf2dfae8138d",
"name": "mtusi-lab7-tempo-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:39.646652084Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "volume-init",
"container": "96e8282d8074e506814cd6d52c79f27e45237dc77f095f2329e225de7a8b2bde",
"name": "mtusi-lab7-volume-init-1",
"status": "exited",
"health": null,
"started_at": "2026-11-30T05:50:01.522942219Z",
"image": "python:3.13.5-slim",
"image_id": "sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419",
"memory_bytes": 67108864,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_bao_data",
"mtusi-lab7_tempo_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "worker",
"container": "eb92aa316654eb66a1d6af56309ced89f1cc07c2dcf6537c9582a65c3380b85d",
"name": "mtusi-lab7-worker-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:49:40.111887126Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:5de48f3e0b4c1ed6967c8a390a0d03591ea421cb3a63e90a9b929d1bb2a2b947",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
}
],
"after": [
{
"service": "api",
"container": "f702f1490dee9897163a65acf7131783c6df35a078f213ea6d4486772c899c1b",
"name": "mtusi-lab7-api-10",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:45.500223045Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data",
"mtusi-lab7_front"
],
"http_status": 200,
"instance": "96d0dd77cf9746fe894406ea39ebc7e2",
"release": "lab7-db3a1be8"
},
{
"service": "api",
"container": "d49f5e45ed8dd945cad9d2e6c439b6a0471aecc81c46aeb0c417aab30d14e947",
"name": "mtusi-lab7-api-9",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:45.635612503Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data",
"mtusi-lab7_front"
],
"http_status": 200,
"instance": "a962916ecab44e4fa3050ed4522d91fe",
"release": "lab7-db3a1be8"
},
{
"service": "broker",
"container": "c128f35c22d105b94a0946e7cea13ebcfc33c3cb75ab3e1919900052beb2575b",
"name": "mtusi-lab7-broker-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:39.147270875Z",
"image": "redis:7.4.4-bookworm",
"image_id": "sha256:7b5ee51c14cf5febd4adde3a4b6cced72efdf154df7e9a0383163b13e16e9091",
"memory_bytes": 167772160,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_broker_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "broker-tls",
"container": "9eedfced5b64ea731e1210bf38c5402f0ad4dfdea369e60214d39cb662ab33f2",
"name": "mtusi-lab7-broker-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:41.888571377Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "collector",
"container": "7b20fe9c7fd98096933f3cf8a256e988df98794e5bf99115333b546eb38aaddf",
"name": "mtusi-lab7-collector-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:41.199239835Z",
"image": "otel/opentelemetry-collector-contrib:0.128.0",
"image_id": "sha256:1ab0baba0ee3695d823c46653d8a6e8894896e668ce8bd7ebe002e948d827bc7",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data",
"mtusi-lab7_observe"
]
},
{
"service": "collector-tls",
"container": "67888c667a398497ea7206c6fa04393e6ae77753509dd07b87ea86a151ca0f51",
"name": "mtusi-lab7-collector-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:44.930639836Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "grafana",
"container": "f48af18f481bf773c662a920288ddf549c70780ce18056d6ae9234d6f490f3a0",
"name": "mtusi-lab7-grafana-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:39.349721875Z",
"image": "grafana/grafana:12.0.1",
"image_id": "sha256:06dc8d60e184705e5dc00e051a6d92342a44010d7d5e538d0a36339e85abb9b7",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {
"3000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3000"
}
]
},
"volumes": [
"mtusi-lab7_grafana_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "lb",
"container": "bde68a3ccbf1498562bf014833f62e7ee57a7323b047428e56916b4444b351ca",
"name": "mtusi-lab7-lb-1",
"status": "running",
"health": "starting",
"started_at": "2026-11-30T05:51:48.626875171Z",
"image": "nginx:1.28.0-alpine",
"image_id": "sha256:30f1c0d78e0ad60901648be663a710bdadf19e4c10ac6782c235200619158284",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8443"
}
]
},
"volumes": [],
"networks": [
"mtusi-lab7_front"
]
},
{
"service": "loki",
"container": "ab7a3685b1a62b27ed338f4ede68fa726f5429a5ec8d9b8415ef4eda248e1cfe",
"name": "mtusi-lab7-loki-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:41.387287543Z",
"image": "grafana/loki:3.5.1",
"image_id": "sha256:a74594532eec4cc313401beedc4dd2708c43674c032084b1aeb87c14a5be1745",
"memory_bytes": 402653184,
"nano_cpus": 500000000,
"published_ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3100"
}
]
},
"volumes": [
"mtusi-lab7_loki_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "loki-tls",
"container": "e356601cd3b1928860c39b5b60c1b5785d0b9bccb3148175f43aba4e3158e51c",
"name": "mtusi-lab7-loki-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:44.933315878Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "migrate",
"container": "b5824ce688874d7716a59276fd2f5ce14061a654dfeb6e20d9fbf45ce30b959a",
"name": "mtusi-lab7-migrate-1",
"status": "exited",
"health": null,
"started_at": "2026-11-30T05:50:02.145670803Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "minio",
"container": "5e764d999c7ff4f752440039cd00ad420cbd9bf5fa3557784f388ced703ea3af",
"name": "mtusi-lab7-minio-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:39.201783917Z",
"image": "mtusi-lab7-minio:2025-04-22",
"image_id": "sha256:81a1e194f7ccc95eb250d815021a1b2196e6fb0d51e69fb4ed886243d28cd0c9",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_minio_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "minio-init",
"container": "c1a4484b41823d7746fa5de9dc6f5313886422e28164587d43140baa3dc58425",
"name": "mtusi-lab7-minio-init-1",
"status": "exited",
"health": null,
"started_at": "2026-11-30T05:50:02.03693722Z",
"image": "mtusi-lab7-mc:2025-04-16",
"image_id": "sha256:39bdefe42ef942ebc93a448f07a6eba9895a3a7d740693208d4db33865799efb",
"memory_bytes": 134217728,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "openbao",
"container": "ab080ae67c50bc4c5b7ee82245e6da9fae3d8a32791ec8fd357dd0afcff44842",
"name": "mtusi-lab7-openbao-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:39.761705376Z",
"image": "openbao/openbao:2.2.2",
"image_id": "sha256:d5d098f98f5ca7cae2e33d1e6dd9e2bea332275ad6bb7ff09032b48af3e1141e",
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"published_ports": {
"8200/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8200"
}
]
},
"volumes": [
"c94f0ce3a8a7735bfb5d9d3916af425bcbd2c67b871e72143122f71a452923e6",
"mtusi-lab7_bao_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_data"
]
},
{
"service": "postgres",
"container": "6243c8e298b2e41ab620421f3f97fa2aad7d5a01ed46c23bda4bcdb8f00f10a7",
"name": "mtusi-lab7-postgres-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:39.264848709Z",
"image": "postgres:17.5-bookworm",
"image_id": "sha256:fbcea1bd13b6a882cd6caa6b58db3ae5c102efe50ec625b3e2a5cbc50db5bfe4",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_postgres_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "prometheus",
"container": "62f36584701c1a7ea1c3baf10cd037ce73e2ea781fdbbc5976fb25d558f636c5",
"name": "mtusi-lab7-prometheus-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:39.411575792Z",
"image": "prom/prometheus:v3.4.1",
"image_id": "sha256:9abc6cf6aea7710d163dbb28d8eeb7dc5baef01e38fa4cd146a406dd9f07f70d",
"memory_bytes": 536870912,
"nano_cpus": 500000000,
"published_ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9090"
}
]
},
"volumes": [
"mtusi-lab7_prometheus_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "prometheus-tls",
"container": "108d2f140a0b273de4436aaf71bc6cddd3a6630eca7eced358b58733af1e01fa",
"name": "mtusi-lab7-prometheus-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:41.887993293Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "redis",
"container": "d4b1cc3a4e63bb59ba335c4caaf63d303a6dfa1d084b5d7e15132bbc5ec35bd4",
"name": "mtusi-lab7-redis-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:51:39.293127417Z",
"image": "redis:7.4.4-bookworm",
"image_id": "sha256:7b5ee51c14cf5febd4adde3a4b6cced72efdf154df7e9a0383163b13e16e9091",
"memory_bytes": 134217728,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_redis_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "redis-tls",
"container": "9b38712f8e171d0b8588b710b25cd7b03b674147c9ec725b1040db870c7b6161",
"name": "mtusi-lab7-redis-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:41.889167252Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "relay",
"container": "e20303230205618b61087d44b6d3e2c671baffadc501d1c38d91f2563fb8a50d",
"name": "mtusi-lab7-relay-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:45.766696837Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 201326592,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "tempo",
"container": "1b7e0b1cb472f474d780cf0100ae404e4fbe6394f3719475c213c2f5fff1477c",
"name": "mtusi-lab7-tempo-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:39.433643167Z",
"image": "grafana/tempo:2.7.2",
"image_id": "sha256:4b0277a9b572a4b1fa43b01468e58911ec214dd69d033f2cd476596d14de9fe3",
"memory_bytes": 402653184,
"nano_cpus": 500000000,
"published_ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3200"
}
]
},
"volumes": [
"mtusi-lab7_tempo_data"
],
"networks": [
"mtusi-lab7_admin",
"mtusi-lab7_observe"
]
},
{
"service": "tempo-tls",
"container": "f6335b6d9684c303991e39f18a731be18a2d74153ee0836f844fbf2dfae8138d",
"name": "mtusi-lab7-tempo-tls-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:44.932774586Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [],
"networks": []
},
{
"service": "volume-init",
"container": "96e8282d8074e506814cd6d52c79f27e45237dc77f095f2329e225de7a8b2bde",
"name": "mtusi-lab7-volume-init-1",
"status": "exited",
"health": null,
"started_at": "2026-11-30T05:50:01.522942219Z",
"image": "python:3.13.5-slim",
"image_id": "sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419",
"memory_bytes": 67108864,
"nano_cpus": 250000000,
"published_ports": {},
"volumes": [
"mtusi-lab7_bao_data",
"mtusi-lab7_tempo_data"
],
"networks": [
"mtusi-lab7_data"
]
},
{
"service": "worker",
"container": "a092f6c54bf48986639f627ff1a59dd816fd87c67aeb51f387245ba876037677",
"name": "mtusi-lab7-worker-1",
"status": "running",
"health": null,
"started_at": "2026-11-30T05:51:45.39325942Z",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"published_ports": {},
"volumes": [],
"networks": [
"mtusi-lab7_data"
]
}
],
"public_test": "Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.\nPASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence."
}
+2
View File
@@ -0,0 +1,2 @@
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
+1
View File
@@ -0,0 +1 @@
PASS: persistence.json
+15
View File
@@ -0,0 +1,15 @@
{
"result": "PASS",
"public_test": "Executing explicit failover hook; hook output suppressed to avoid leaking secrets.\n{\"observed_instances_before\": 2, \"successful_writes\": 127, \"failed_attempts\": 0, \"first_recovery_seconds\": 0.931}\nPASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.",
"stopped": {
"container": "c1c9d8fc713aec83cc8e303fb777aa55dd694a8a675ba33534449f4bcdcf6936",
"name": "mtusi-lab7-api-8",
"instance": "373e29ff975e4b269a56f64789aee95d",
"release": "lab7-v1",
"image_id": "sha256:5de48f3e0b4c1ed6967c8a390a0d03591ea421cb3a63e90a9b929d1bb2a2b947",
"stopped_at_utc": "2026-11-30T05:49:46.938715+00:00",
"stop_seconds": 0.3882,
"exit_code": 0,
"left_stopped": true
}
}
+3
View File
@@ -0,0 +1,3 @@
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 127, "failed_attempts": 0, "first_recovery_seconds": 0.931}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+3
View File
@@ -0,0 +1,3 @@
PASS: git diff --exit-code HEAD -- README.md COURSE.md CONTRIBUTING.md tests contracts
PASS: no untracked files in public tests/contracts; no tracked secrets
Branch: solution/bpi2303-lukyanov
+2
View File
@@ -0,0 +1,2 @@
python3 tests/security.py --base-url "https://localhost:8443" --ca-file "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/secrets/trust/ca.crt"
PASS: trusted HTTPS works; untrusted CA rejected. This does NOT verify internal mTLS, OpenBao or hardening.
+15
View File
@@ -0,0 +1,15 @@
[
{
"labels": {
"alertname": "QueueLagGrowing",
"severity": "warning"
},
"annotations": {
"runbook": "Check worker capacity/busy, job outcomes and consumer spans. Restore worker and confirm queue drains.",
"summary": "Oldest unfinished attachment is older than 15 seconds"
},
"state": "firing",
"activeAt": "2026-11-30T05:30:48.478517494Z",
"value": "3.1973229e+01"
}
]
+1
View File
@@ -0,0 +1 @@
[]
+171
View File
@@ -0,0 +1,171 @@
{
"result": "PASS",
"before": [
{
"container": "8d0c20070ca334dfdd732b758346508c72be60ec36df8fd94be0f4997358ffb4",
"name": "mtusi-lab7-api-7",
"instance": "0aeb2e54f756482088e433160f0a2d47",
"release": "lab7-v1",
"image_id": "sha256:5de48f3e0b4c1ed6967c8a390a0d03591ea421cb3a63e90a9b929d1bb2a2b947"
},
{
"container": "c1c9d8fc713aec83cc8e303fb777aa55dd694a8a675ba33534449f4bcdcf6936",
"name": "mtusi-lab7-api-8",
"instance": "75dd18e358ca4d909cb2a1bb589515dc",
"release": "lab7-v1",
"image_id": "sha256:5de48f3e0b4c1ed6967c8a390a0d03591ea421cb3a63e90a9b929d1bb2a2b947"
}
],
"after": [
{
"container": "f702f1490dee9897163a65acf7131783c6df35a078f213ea6d4486772c899c1b",
"name": "mtusi-lab7-api-10",
"instance": "d79daeab2c2647aab850e6963ee3bb45",
"release": "lab7-db3a1be8",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43"
},
{
"container": "d49f5e45ed8dd945cad9d2e6c439b6a0471aecc81c46aeb0c417aab30d14e947",
"name": "mtusi-lab7-api-9",
"instance": "083e1353373d4d829a394729392f1d45",
"release": "lab7-db3a1be8",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43"
}
],
"target_release": "lab7-db3a1be8",
"lb_before": {
"service": "lb",
"container": "bde68a3ccbf1498562bf014833f62e7ee57a7323b047428e56916b4444b351ca",
"name": "mtusi-lab7-lb-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:49:43.308140711Z",
"image": "nginx:1.28.0-alpine",
"image_id": "sha256:30f1c0d78e0ad60901648be663a710bdadf19e4c10ac6782c235200619158284",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8443"
}
]
},
"volumes": [],
"networks": [
"mtusi-lab7_front"
]
},
"lb_after": {
"service": "lb",
"container": "bde68a3ccbf1498562bf014833f62e7ee57a7323b047428e56916b4444b351ca",
"name": "mtusi-lab7-lb-1",
"status": "running",
"health": "healthy",
"started_at": "2026-11-30T05:49:43.308140711Z",
"image": "nginx:1.28.0-alpine",
"image_id": "sha256:30f1c0d78e0ad60901648be663a710bdadf19e4c10ac6782c235200619158284",
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"published_ports": {
"8443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8443"
}
]
},
"volumes": [],
"networks": [
"mtusi-lab7_front"
]
},
"lb_not_restarted": true,
"build_seconds": 1.2754,
"migration_output": "Migrations up to date\nLeast privilege DB roles ready",
"replacements": [
{
"old_container": "8d0c20070ca334dfdd732b758346508c72be60ec36df8fd94be0f4997358ffb4",
"new_container": "d49f5e45ed8dd945cad9d2e6c439b6a0471aecc81c46aeb0c417aab30d14e947",
"old_ip": "192.168.0.3",
"new_ip": "192.168.0.5",
"dns_discovered_new_address": true,
"instances_during_start_first": [
"083e1353373d4d829a394729392f1d45",
"0aeb2e54f756482088e433160f0a2d47",
"75dd18e358ca4d909cb2a1bb589515dc"
],
"observed_instances": [
"083e1353373d4d829a394729392f1d45",
"75dd18e358ca4d909cb2a1bb589515dc"
],
"old_exit_code": 0,
"seconds": 6.0879
},
{
"old_container": "c1c9d8fc713aec83cc8e303fb777aa55dd694a8a675ba33534449f4bcdcf6936",
"new_container": "f702f1490dee9897163a65acf7131783c6df35a078f213ea6d4486772c899c1b",
"old_ip": "192.168.0.2",
"new_ip": "192.168.0.3",
"dns_discovered_new_address": true,
"instances_during_start_first": [
"083e1353373d4d829a394729392f1d45",
"75dd18e358ca4d909cb2a1bb589515dc",
"d79daeab2c2647aab850e6963ee3bb45"
],
"observed_instances": [
"083e1353373d4d829a394729392f1d45",
"d79daeab2c2647aab850e6963ee3bb45"
],
"old_exit_code": 0,
"seconds": 6.0685
}
],
"during_replacement": {
"seconds": 12.1563,
"concurrency": 4,
"successful_requests": 3837,
"failed_attempts": 0,
"successful_rps": 315.638,
"error_ratio": 0.0,
"successful_latency_ms": {
"p50": 10.617,
"p95": 22.093,
"p99": 61.165
},
"instances": [
"083e1353373d4d829a394729392f1d45",
"0aeb2e54f756482088e433160f0a2d47",
"75dd18e358ca4d909cb2a1bb589515dc",
"d79daeab2c2647aab850e6963ee3bb45"
]
},
"total": {
"seconds": 21.3174,
"concurrency": 4,
"successful_requests": 6533,
"failed_attempts": 0,
"successful_rps": 306.463,
"error_ratio": 0.0,
"successful_latency_ms": {
"p50": 11.047,
"p95": 21.702,
"p99": 62.766
},
"instances": [
"083e1353373d4d829a394729392f1d45",
"0aeb2e54f756482088e433160f0a2d47",
"75dd18e358ca4d909cb2a1bb589515dc",
"d79daeab2c2647aab850e6963ee3bb45"
]
},
"data": {
"confirmed_unique_messages": 6533,
"history_messages": 6533,
"confirmed_preserved": true,
"duplicate_ids": 0,
"duplicate_texts": 0
},
"change": "New image with a distinct release header; API code and schema remain compatible. Start-first: scale to3, prove new IP in DNS/LB, stop/remove one old container, return to2 with --no-recreate."
}
+648
View File
@@ -0,0 +1,648 @@
{
"result": "PASS",
"root_operator_material_not_mounted_in_workloads": true,
"no_tracked_secrets": true,
"containers": [
{
"service": "api",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "api",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "broker",
"image": "redis:7.4.4-bookworm",
"image_id": "sha256:7b5ee51c14cf5febd4adde3a4b6cced72efdf154df7e9a0383163b13e16e9091",
"state": "running",
"user": "999:999",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 167772160,
"nano_cpus": 500000000,
"ports": {},
"mount_targets": [
"/data",
"/etc/redis/server.conf",
"/etc/redis/users.acl"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "broker-tls",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust",
"/etc/gateway.json"
],
"network_mode": "container:c128f35c22d105b94a0946e7cea13ebcfc33c3cb75ab3e1919900052beb2575b"
},
{
"service": "collector",
"image": "otel/opentelemetry-collector-contrib:0.128.0",
"image_id": "sha256:1ab0baba0ee3695d823c46653d8a6e8894896e668ce8bd7ebe002e948d827bc7",
"state": "running",
"user": "10001:10001",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust",
"/etc/otelcol/config.yaml"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "collector-tls",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust",
"/etc/gateway.json"
],
"network_mode": "container:7b20fe9c7fd98096933f3cf8a256e988df98794e5bf99115333b546eb38aaddf"
},
{
"service": "grafana",
"image": "grafana/grafana:12.0.1",
"image_id": "sha256:06dc8d60e184705e5dc00e051a6d92342a44010d7d5e538d0a36339e85abb9b7",
"state": "running",
"user": "472",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"ports": {
"3000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3000"
}
]
},
"mount_targets": [
"/pki",
"/run/secrets/grafana_password",
"/var/lib/grafana",
"/etc/grafana/provisioning/dashboards",
"/var/lib/grafana/dashboards",
"/etc/grafana/provisioning/datasources/local.yaml"
],
"network_mode": "mtusi-lab7_admin"
},
{
"service": "lb",
"image": "nginx:1.28.0-alpine",
"image_id": "sha256:30f1c0d78e0ad60901648be663a710bdadf19e4c10ac6782c235200619158284",
"state": "running",
"user": "101:101",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 134217728,
"nano_cpus": 500000000,
"ports": {
"8443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8443"
}
]
},
"mount_targets": [
"/pki",
"/trust",
"/etc/nginx/nginx.conf"
],
"network_mode": "mtusi-lab7_front"
},
{
"service": "loki",
"image": "grafana/loki:3.5.1",
"image_id": "sha256:a74594532eec4cc313401beedc4dd2708c43674c032084b1aeb87c14a5be1745",
"state": "running",
"user": "10001",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 402653184,
"nano_cpus": 500000000,
"ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3100"
}
]
},
"mount_targets": [
"/loki",
"/etc/loki/local.yaml"
],
"network_mode": "mtusi-lab7_admin"
},
{
"service": "loki-tls",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust",
"/etc/gateway.json"
],
"network_mode": "container:ab7a3685b1a62b27ed338f4ede68fa726f5429a5ec8d9b8415ef4eda248e1cfe"
},
{
"service": "migrate",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:2aa1749fd187f8b1a0ebbb3aa3745fa1b3b54c0e12c624f0fdbee166f6bcdbe4",
"state": "exited",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"ports": {},
"mount_targets": [
"/trust",
"/operator/db-roles.json",
"/run/secrets/database_url"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "minio",
"image": "mtusi-lab7-minio:2025-04-22",
"image_id": "sha256:81a1e194f7ccc95eb250d815021a1b2196e6fb0d51e69fb4ed886243d28cd0c9",
"state": "running",
"user": "10002",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"mount_targets": [
"/data",
"/trust",
"/certs/private.key",
"/certs/public.crt",
"/run/secrets/minio_root_password",
"/run/secrets/minio_root_user"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "minio-init",
"image": "mtusi-lab7-mc:2025-04-16",
"image_id": "sha256:39bdefe42ef942ebc93a448f07a6eba9895a3a7d740693208d4db33865799efb",
"state": "exited",
"user": "10002:10002",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 134217728,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/policies",
"/trust",
"/config/bootstrap.sh",
"/run/secrets/minio_root_password",
"/run/secrets/minio_root_user",
"/run/secrets/s3_api_id",
"/run/secrets/s3_api_secret",
"/run/secrets/s3_relay_id",
"/run/secrets/s3_relay_secret",
"/run/secrets/s3_test_id",
"/run/secrets/s3_test_secret",
"/run/secrets/s3_worker_id",
"/run/secrets/s3_worker_secret"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "openbao",
"image": "openbao/openbao:2.2.2",
"image_id": "sha256:d5d098f98f5ca7cae2e33d1e6dd9e2bea332275ad6bb7ff09032b48af3e1141e",
"state": "running",
"user": "100:1000",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 268435456,
"nano_cpus": 500000000,
"ports": {
"8200/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8200"
}
]
},
"mount_targets": [
"/pki",
"/trust",
"/openbao/file",
"/openbao/logs",
"/openbao/config/server.hcl"
],
"network_mode": "mtusi-lab7_admin"
},
{
"service": "postgres",
"image": "postgres:17.5-bookworm",
"image_id": "sha256:fbcea1bd13b6a882cd6caa6b58db3ae5c102efe50ec625b3e2a5cbc50db5bfe4",
"state": "running",
"user": "",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": [
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FOWNER",
"CAP_SETGID",
"CAP_SETUID"
],
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"mount_targets": [
"/pki",
"/config/pg_hba.conf",
"/config/postgres.sh",
"/run/secrets/postgres_password",
"/var/lib/postgresql/data"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "prometheus",
"image": "prom/prometheus:v3.4.1",
"image_id": "sha256:9abc6cf6aea7710d163dbb28d8eeb7dc5baef01e38fa4cd146a406dd9f07f70d",
"state": "running",
"user": "nobody",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 536870912,
"nano_cpus": 500000000,
"ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "9090"
}
]
},
"mount_targets": [
"/pki",
"/prometheus",
"/trust",
"/etc/prometheus/alerts.yaml",
"/etc/prometheus/prometheus.yaml"
],
"network_mode": "mtusi-lab7_admin"
},
{
"service": "prometheus-tls",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust",
"/etc/gateway.json"
],
"network_mode": "container:62f36584701c1a7ea1c3baf10cd037ce73e2ea781fdbbc5976fb25d558f636c5"
},
{
"service": "redis",
"image": "redis:7.4.4-bookworm",
"image_id": "sha256:7b5ee51c14cf5febd4adde3a4b6cced72efdf154df7e9a0383163b13e16e9091",
"state": "running",
"user": "999:999",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 134217728,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/data",
"/etc/redis/server.conf",
"/etc/redis/users.acl"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "redis-tls",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust",
"/etc/gateway.json"
],
"network_mode": "container:d4b1cc3a4e63bb59ba335c4caaf63d303a6dfa1d084b5d7e15132bbc5ec35bd4"
},
{
"service": "relay",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 201326592,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "tempo",
"image": "grafana/tempo:2.7.2",
"image_id": "sha256:4b0277a9b572a4b1fa43b01468e58911ec214dd69d033f2cd476596d14de9fe3",
"state": "running",
"user": "10001:10001",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"ports": {
"9443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "3200"
}
]
},
"mount_targets": [
"/var/tempo",
"/etc/tempo/local.yaml"
],
"network_mode": "mtusi-lab7_admin"
},
{
"service": "tempo-tls",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 100663296,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust",
"/etc/gateway.json"
],
"network_mode": "container:6a23563d1b29abe512915123f3c2af1ea785c8a1b801bcaa3112017250fab99d"
},
{
"service": "volume-init",
"image": "python:3.13.5-slim",
"image_id": "sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419",
"state": "exited",
"user": "0:0",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": [
"CAP_CHOWN"
],
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 67108864,
"nano_cpus": 250000000,
"ports": {},
"mount_targets": [
"/bao",
"/tempo"
],
"network_mode": "mtusi-lab7_data"
},
{
"service": "worker",
"image": "mtusi-lab7-api:lab7",
"image_id": "sha256:f03a27af02c1a2335c9e47d91260b947b6083a028b1330df52c8a9289e045e43",
"state": "running",
"user": "messenger",
"read_only": true,
"cap_drop": [
"ALL"
],
"cap_add": null,
"security_opt": [
"no-new-privileges:true"
],
"memory_bytes": 536870912,
"nano_cpus": 1000000000,
"ports": {},
"mount_targets": [
"/pki",
"/trust"
],
"network_mode": "mtusi-lab7_data"
}
]
}
+2
View File
@@ -0,0 +1,2 @@
python3 scripts/runtime_audit.py
PASS: runtime-hardening.json
+1
View File
@@ -0,0 +1 @@
Docker Scout v1.27.0 refused unauthenticated local image scanning: Docker login required. No account credentials were requested or used. Dependency scanning uses pip-audit; image scanning falls back to Trivy over a local image archive.
+216
View File
@@ -0,0 +1,216 @@
{
"status": "success",
"data": {
"resultType": "streams",
"result": [
{
"stream": {
"code_file_path": "",
"code_function_name": "",
"code_line_number": "0",
"deployment_environment_name": "lab",
"detected_level": "INFO",
"flags": "3",
"observed_timestamp": "1796018214122139799",
"scope_name": "messenger.events",
"service_instance_id": "29e3ae7e54154a6cb725296e0505a20a",
"service_name": "messenger-api",
"service_version": "lab7-v1",
"severity_number": "9",
"severity_text": "INFO",
"span_id": "ba4754b0402458f5",
"telemetry_sdk_language": "python",
"telemetry_sdk_name": "opentelemetry",
"telemetry_sdk_version": "1.45.2",
"trace_id": "f9bb0f7c4d18102298383ce3fa9964d3"
},
"values": [
[
"1796018214122120960",
"{\"event\":\"http_completed\",\"method\":\"POST\",\"request_id\":\"f5bc7798-6978-4a78-8994-4e4d63a3717b\",\"route\":\"/api/v1/chats/{chat_id}/attachments\",\"service_name\":\"messenger-api\",\"severity\":\"INFO\",\"span_id\":\"ba4754b0402458f5\",\"status_class\":\"2xx\",\"timestamp\":1796018214.122117,\"trace_id\":\"f9bb0f7c4d18102298383ce3fa9964d3\"}"
]
]
},
{
"stream": {
"code_file_path": "",
"code_function_name": "",
"code_line_number": "0",
"deployment_environment_name": "lab",
"detected_level": "INFO",
"flags": "3",
"observed_timestamp": "1796018215021451883",
"scope_name": "messenger.events",
"service_instance_id": "f0e1df81b80043af98761b473ef25a21",
"service_name": "messenger-worker",
"service_version": "lab7-v1",
"severity_number": "9",
"severity_text": "INFO",
"span_id": "4d04641253a26583",
"telemetry_sdk_language": "python",
"telemetry_sdk_name": "opentelemetry",
"telemetry_sdk_version": "1.45.2",
"trace_id": "f9bb0f7c4d18102298383ce3fa9964d3"
},
"values": [
[
"1796018215021421824",
"{\"attempt\":1,\"event\":\"job_attempt\",\"outcome\":\"ready\",\"service_name\":\"messenger-worker\",\"severity\":\"INFO\",\"span_id\":\"4d04641253a26583\",\"timestamp\":1796018215.021416,\"trace_id\":\"f9bb0f7c4d18102298383ce3fa9964d3\"}"
]
]
}
],
"stats": {
"summary": {
"bytesProcessedPerSecond": 57970835,
"linesProcessedPerSecond": 93558,
"totalBytesProcessed": 38128515,
"totalLinesProcessed": 61535,
"execTime": 0.657719,
"queueTime": 0.000143,
"subqueries": 0,
"totalEntriesReturned": 2,
"splits": 0,
"shards": 1,
"totalPostFilterLines": 2,
"totalStructuredMetadataBytesProcessed": 17828310
},
"querier": {
"store": {
"totalChunksRef": 0,
"totalChunksDownloaded": 0,
"chunksDownloadTime": 0,
"queryReferencedStructuredMetadata": false,
"chunk": {
"headChunkBytes": 0,
"headChunkLines": 0,
"decompressedBytes": 0,
"decompressedLines": 0,
"compressedBytes": 0,
"totalDuplicates": 0,
"postFilterLines": 0,
"headChunkStructuredMetadataBytes": 0,
"decompressedStructuredMetadataBytes": 0
},
"chunkRefsFetchTime": 0,
"congestionControlLatency": 0,
"pipelineWrapperFilteredLines": 0
}
},
"ingester": {
"totalReached": 1,
"totalChunksMatched": 27,
"totalBatches": 2,
"totalLinesSent": 2,
"store": {
"totalChunksRef": 2,
"totalChunksDownloaded": 2,
"chunksDownloadTime": 4754000,
"queryReferencedStructuredMetadata": false,
"chunk": {
"headChunkBytes": 2811912,
"headChunkLines": 6566,
"decompressedBytes": 35316603,
"decompressedLines": 54969,
"compressedBytes": 4325584,
"totalDuplicates": 0,
"postFilterLines": 2,
"headChunkStructuredMetadataBytes": 787920,
"decompressedStructuredMetadataBytes": 17040390
},
"chunkRefsFetchTime": 444875,
"congestionControlLatency": 0,
"pipelineWrapperFilteredLines": 0
}
},
"cache": {
"chunk": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"index": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"result": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"statsResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"volumeResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"seriesResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"labelResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"instantMetricResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
}
},
"index": {
"totalChunks": 0,
"postFilterChunks": 0,
"shardsDuration": 0,
"usedBloomFilters": false
}
}
}
}
File diff suppressed because it is too large Load Diff
+268
View File
@@ -0,0 +1,268 @@
{
"result": "PASS",
"rehash": {
"argon2id": true,
"current_parameters": true
},
"session_hash": {
"sha256_server_session": true
},
"shared_login_limit": {
"attempts": [
{
"status": 401,
"instance": "a962916ecab44e4fa3050ed4522d91fe",
"retry_after": null
},
{
"status": 401,
"instance": "96d0dd77cf9746fe894406ea39ebc7e2",
"retry_after": null
},
{
"status": 401,
"instance": "a962916ecab44e4fa3050ed4522d91fe",
"retry_after": null
},
{
"status": 401,
"instance": "96d0dd77cf9746fe894406ea39ebc7e2",
"retry_after": null
},
{
"status": 401,
"instance": "a962916ecab44e4fa3050ed4522d91fe",
"retry_after": null
},
{
"status": 429,
"instance": "a962916ecab44e4fa3050ed4522d91fe",
"retry_after": "10"
},
{
"status": 401,
"instance": "96d0dd77cf9746fe894406ea39ebc7e2",
"retry_after": null
},
{
"status": 401,
"instance": "96d0dd77cf9746fe894406ea39ebc7e2",
"retry_after": null
},
{
"status": 401,
"instance": "a962916ecab44e4fa3050ed4522d91fe",
"retry_after": null
},
{
"status": 401,
"instance": "96d0dd77cf9746fe894406ea39ebc7e2",
"retry_after": null
},
{
"status": 429,
"instance": "a962916ecab44e4fa3050ed4522d91fe",
"retry_after": "10"
},
{
"status": 429,
"instance": "96d0dd77cf9746fe894406ea39ebc7e2",
"retry_after": "10"
},
{
"status": 429,
"instance": "a962916ecab44e4fa3050ed4522d91fe",
"retry_after": "10"
},
{
"status": 429,
"instance": "a962916ecab44e4fa3050ed4522d91fe",
"retry_after": "10"
},
{
"status": 429,
"instance": "96d0dd77cf9746fe894406ea39ebc7e2",
"retry_after": "10"
},
{
"status": 429,
"instance": "96d0dd77cf9746fe894406ea39ebc7e2",
"retry_after": "10"
}
],
"replicas": 2,
"per_account": 10,
"window_seconds": 10,
"global_kdf": 120
},
"argon_budget": {
"m_kib": 19456,
"t": 2,
"p": 1,
"verify_ms": [
10.649542000010115,
10.625207999964914,
11.105582999789476,
9.822957999858772,
10.48658300032912,
10.08233399988967,
10.544916999606357,
10.329624999940279,
10.437874999752239,
9.796542000003683
],
"max_verify_ms": 11.105582999789476,
"peak_kib": 41980,
"local_slots_per_api": 2,
"replicas": 2
},
"wrong_hostname_rejected": true,
"leaf_rotation": {
"revoked_old_leaf_rejected": true,
"new_leaf_works": true,
"image_ids_unchanged": false
},
"secret_rotation": {
"old_new_connection_denied": true,
"new_connection_allowed": true,
"same_session_original_preserved": true,
"no_image_rebuild": true
},
"bao_sealed": {
"polls": [
{
"seconds": 0.02,
"status": 200
},
{
"seconds": 2.04,
"status": 200
},
{
"seconds": 4.07,
"status": 200
},
{
"seconds": 6.09,
"status": 200
},
{
"seconds": 8.1,
"status": 200
},
{
"seconds": 10.11,
"status": 200
},
{
"seconds": 12.13,
"status": 200
},
{
"seconds": 14.15,
"status": 200
},
{
"seconds": 16.16,
"status": 200
},
{
"seconds": 18.18,
"status": 200
},
{
"seconds": 20.21,
"status": 200
},
{
"seconds": 22.23,
"status": 200
},
{
"seconds": 24.25,
"status": 200
},
{
"seconds": 26.27,
"status": 200
},
{
"seconds": 28.29,
"status": 200
},
{
"seconds": 30.31,
"status": 200
},
{
"seconds": 32.33,
"status": 200
},
{
"seconds": 34.35,
"status": 200
},
{
"seconds": 36.38,
"status": 200
},
{
"seconds": 38.39,
"status": 200
},
{
"seconds": 40.41,
"status": 200
},
{
"seconds": 42.42,
"status": 200
},
{
"seconds": 44.44,
"status": 200
},
{
"seconds": 46.46,
"status": 200
},
{
"seconds": 48.48,
"status": 200
},
{
"seconds": 50.51,
"status": 200
},
{
"seconds": 52.52,
"status": 200
},
{
"seconds": 54.53,
"status": 200
},
{
"seconds": 56.54,
"status": 200
},
{
"seconds": 58.58,
"status": 503
}
],
"cache_budget_seconds_max": 60,
"liveness": 200,
"same_accepted_job_session_recovered": true
},
"telemetry_privacy": {
"trace_id": "f9bb0f7c4d18102298383ce3fa9964d3",
"api_worker_positive_control": true,
"body_canary_matches": 0
},
"acl_logout": {
"outsider_metadata_content_binding": 404,
"forged_header_ignored": true,
"logout": 401
}
}
+135
View File
@@ -0,0 +1,135 @@
{
"result": "PASS",
"baseline": {
"seconds": 3.0065,
"concurrency": 4,
"successful_requests": 889,
"failed_attempts": 0,
"successful_rps": 295.69,
"error_ratio": 0.0,
"successful_latency_ms": {
"p50": 11.384,
"p95": 25.959,
"p99": 65.484
},
"instances": [
"55bc876c29b645f6be3446165cd99383",
"6fc2ed0d62874c2a84e0fdaae42e94cf"
]
},
"phases": [
{
"stopped": {
"container": "8d0c20070ca334dfdd732b758346508c72be60ec36df8fd94be0f4997358ffb4",
"name": "mtusi-lab7-api-7",
"instance": "55bc876c29b645f6be3446165cd99383",
"release": "lab7-v1",
"image_id": "sha256:5de48f3e0b4c1ed6967c8a390a0d03591ea421cb3a63e90a9b929d1bb2a2b947",
"stopped_at_utc": "2026-11-30T05:50:13.728000+00:00",
"stop_seconds": 0.4025,
"exit_code": 0,
"left_stopped": true
},
"traffic": {
"seconds": 8.0026,
"concurrency": 4,
"successful_requests": 1600,
"failed_attempts": 0,
"successful_rps": 199.934,
"error_ratio": 0.0,
"successful_latency_ms": {
"p50": 15.249,
"p95": 43.649,
"p99": 75.953
},
"instances": [
"55bc876c29b645f6be3446165cd99383",
"6fc2ed0d62874c2a84e0fdaae42e94cf"
]
},
"post_stop_write_seconds_from_action_start": 1.2506,
"post_stop_write_seconds_from_stop_completion": 0.042,
"read_during_outage": {
"status": 200,
"confirmed_message_preserved": true,
"seconds_from_action_start": 1.2367,
"seconds_from_stop_completion": 0.0281
},
"new_connection_after_stop": {
"accepted": false,
"error_type": "TimeoutError"
},
"stopped_remains_stopped": true
},
{
"stopped": {
"container": "c1c9d8fc713aec83cc8e303fb777aa55dd694a8a675ba33534449f4bcdcf6936",
"name": "mtusi-lab7-api-8",
"instance": "6fc2ed0d62874c2a84e0fdaae42e94cf",
"release": "lab7-v1",
"image_id": "sha256:5de48f3e0b4c1ed6967c8a390a0d03591ea421cb3a63e90a9b929d1bb2a2b947",
"stopped_at_utc": "2026-11-30T05:50:28.647788+00:00",
"stop_seconds": 0.43,
"exit_code": 0,
"left_stopped": true
},
"traffic": {
"seconds": 8.0001,
"concurrency": 4,
"successful_requests": 1519,
"failed_attempts": 0,
"successful_rps": 189.873,
"error_ratio": 0.0,
"successful_latency_ms": {
"p50": 15.824,
"p95": 50.63,
"p99": 80.45
},
"instances": [
"2270a1857a6b4cd6affd685750c1bcb8",
"6fc2ed0d62874c2a84e0fdaae42e94cf"
]
},
"post_stop_write_seconds_from_action_start": 1.227,
"post_stop_write_seconds_from_stop_completion": 0.0324,
"read_during_outage": {
"status": 200,
"confirmed_message_preserved": true,
"seconds_from_action_start": 1.2213,
"seconds_from_stop_completion": 0.0267
},
"new_connection_after_stop": {
"accepted": false,
"error_type": "TimeoutError"
},
"stopped_remains_stopped": true
}
],
"total": {
"seconds": 31.8408,
"concurrency": 4,
"successful_requests": 7022,
"failed_attempts": 2,
"successful_rps": 220.535,
"error_ratio": 0.000285,
"successful_latency_ms": {
"p50": 13.678,
"p95": 45.661,
"p99": 75.117
},
"instances": [
"2270a1857a6b4cd6affd685750c1bcb8",
"55bc876c29b645f6be3446165cd99383",
"6fc2ed0d62874c2a84e0fdaae42e94cf",
"75dd18e358ca4d909cb2a1bb589515dc"
]
},
"data": {
"confirmed_unique_messages": 7022,
"history_messages": 7022,
"confirmed_preserved": true,
"duplicate_ids": 0,
"duplicate_texts": 0
},
"each_original_container_tested": true
}
+2
View File
@@ -0,0 +1,2 @@
python3 tests/smoke.py --base-url "https://localhost:8443" --ca-file "/Users/kostya/Desktop/mtuci/vp/mtusi2026lab7/secrets/trust/ca.crt"
PASS: lab7 public API scenario; infrastructure and grading evidence remain separate.
+21
View File
@@ -0,0 +1,21 @@
docker compose run --rm --no-deps student-tests
Container mtusi-lab7-student-tests-run-634410e14061 Creating
Container mtusi-lab7-student-tests-run-634410e14061 Created
........................................... [100%]
=============================== warnings summary ===============================
../usr/local/lib/python3.13/site-packages/fastapi/testclient.py:1
/usr/local/lib/python3.13/site-packages/fastapi/testclient.py:1: StarletteDeprecationWarning: Using `httpx` with `starlette.testclient` is deprecated; install `httpx2` instead.
from starlette.testclient import TestClient as TestClient # noqa
student-tests/test_attachments.py: 19 warnings
student-tests/test_idempotency.py: 1 warning
student-tests/test_jobs.py: 6 warnings
/usr/local/lib/python3.13/site-packages/botocore/auth.py:422: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
datetime_now = datetime.datetime.utcnow()
student-tests/test_attachments.py::test_invalid_media_corruption_limits_and_filename
/usr/local/lib/python3.13/site-packages/PIL/Image.py:3593: DecompressionBombWarning: Image size (40004000 pixels) exceeds limit of 40000000 pixels, could be decompression bomb DOS attack.
warnings.warn(
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
43 passed, 28 warnings in 13.52s
+7
View File
@@ -0,0 +1,7 @@
{
"exit_code": 137,
"oom_killed": true,
"finished_at": "2026-11-30T05:57:03.071438762Z",
"memory_limit_bytes": 402653184,
"context": "after3x30s load and successful lifecycle trace queries; OOM during block flush"
}
File diff suppressed because it is too large Load Diff
+69
View File
@@ -0,0 +1,69 @@
{
"api_mtls": {
"replicas": [
{
"allowed": 200,
"missing_foreign_wrong_identity": [
0,
0,
0
],
"plaintext_bypass": false
},
{
"allowed": 200,
"missing_foreign_wrong_identity": [
0,
0,
0
],
"plaintext_bypass": false
}
]
},
"collector_mtls": {
"allow": {
"api": 200,
"worker": 200,
"relay": 200
},
"deny": [
0,
0,
0
]
},
"broker_mtls_acl": {
"producer_consumer_ping": true,
"producer_consume_denied": true,
"consumer_publish_denied": true,
"cross_listener_auth_denied": true,
"missing_foreign_wrong_identity_denied": true
},
"cache_tls_acl": {
"allowed_profile": true,
"outside_prefix_denied": true,
"flushdb_denied": true
},
"telemetry_tls": {
"grafana_queries": true,
"grafana_post_denied": true,
"worker_queries_denied": true,
"scrape_identity_checked": true,
"plaintext_bypasses": false
},
"openbao": {
"cert_auth": true,
"token_ttl_seconds_max": 60,
"cross_path_policy_write_impersonation_denied": true
},
"postgres_s3": {
"verify_full_tls": true,
"pg_plaintext_rejected": true,
"worker_hash_read_denied": true,
"api_final_write_denied": true,
"worker_staging_write_denied": true,
"outside_prefix_anonymous_denied": true
},
"result": "PASS"
}
+272
View File
@@ -0,0 +1,272 @@
{
"status": "success",
"data": {
"resultType": "streams",
"result": [
{
"stream": {
"code_file_path": "",
"code_function_name": "",
"code_line_number": "0",
"deployment_environment_name": "lab",
"detected_level": "INFO",
"flags": "3",
"observed_timestamp": "1796016619716444964",
"scope_name": "messenger.events",
"service_instance_id": "dcc262fe6cf04621a32b0af8e03daa5f",
"service_name": "messenger-api",
"service_version": "lab7-v1",
"severity_number": "9",
"severity_text": "INFO",
"span_id": "f020b223bab5ea29",
"telemetry_sdk_language": "python",
"telemetry_sdk_name": "opentelemetry",
"telemetry_sdk_version": "1.45.2",
"trace_id": "0628221118a0c0036d21036b8ebc7bcf"
},
"values": [
[
"1796016619716292608",
"{\"event\":\"http_completed\",\"method\":\"POST\",\"request_id\":\"32beabaf-3454-4a73-8170-b507b2dd28a4\",\"route\":\"/api/v1/chats/{chat_id}/attachments\",\"service_name\":\"messenger-api\",\"severity\":\"INFO\",\"span_id\":\"f020b223bab5ea29\",\"status_class\":\"2xx\",\"timestamp\":1796016619.716279,\"trace_id\":\"0628221118a0c0036d21036b8ebc7bcf\"}"
]
]
},
{
"stream": {
"code_file_path": "",
"code_function_name": "",
"code_line_number": "0",
"deployment_environment_name": "lab",
"detected_level": "INFO",
"flags": "3",
"observed_timestamp": "1796016621457371673",
"scope_name": "messenger.events",
"service_instance_id": "9fa5c634bf454d3b9bea335ce777cb2d",
"service_name": "messenger-worker",
"service_version": "lab7-v1",
"severity_number": "9",
"severity_text": "INFO",
"span_id": "bddb24d3407900f3",
"telemetry_sdk_language": "python",
"telemetry_sdk_name": "opentelemetry",
"telemetry_sdk_version": "1.45.2",
"trace_id": "0628221118a0c0036d21036b8ebc7bcf"
},
"values": [
[
"1796016621457320960",
"{\"attempt\":1,\"event\":\"job_attempt\",\"outcome\":\"retry\",\"service_name\":\"messenger-worker\",\"severity\":\"INFO\",\"span_id\":\"bddb24d3407900f3\",\"timestamp\":1796016621.4573143,\"trace_id\":\"0628221118a0c0036d21036b8ebc7bcf\"}"
]
]
},
{
"stream": {
"code_file_path": "",
"code_function_name": "",
"code_line_number": "0",
"deployment_environment_name": "lab",
"detected_level": "INFO",
"flags": "3",
"observed_timestamp": "1796016623228691757",
"scope_name": "messenger.events",
"service_instance_id": "9fa5c634bf454d3b9bea335ce777cb2d",
"service_name": "messenger-worker",
"service_version": "lab7-v1",
"severity_number": "9",
"severity_text": "INFO",
"span_id": "9b9341843251bd6d",
"telemetry_sdk_language": "python",
"telemetry_sdk_name": "opentelemetry",
"telemetry_sdk_version": "1.45.2",
"trace_id": "0628221118a0c0036d21036b8ebc7bcf"
},
"values": [
[
"1796016623228667904",
"{\"attempt\":2,\"event\":\"job_attempt\",\"outcome\":\"retry\",\"service_name\":\"messenger-worker\",\"severity\":\"INFO\",\"span_id\":\"9b9341843251bd6d\",\"timestamp\":1796016623.2286625,\"trace_id\":\"0628221118a0c0036d21036b8ebc7bcf\"}"
]
]
},
{
"stream": {
"code_file_path": "",
"code_function_name": "",
"code_line_number": "0",
"deployment_environment_name": "lab",
"detected_level": "INFO",
"flags": "3",
"observed_timestamp": "1796016625209270466",
"scope_name": "messenger.events",
"service_instance_id": "9fa5c634bf454d3b9bea335ce777cb2d",
"service_name": "messenger-worker",
"service_version": "lab7-v1",
"severity_number": "9",
"severity_text": "INFO",
"span_id": "99bec6d11586ce67",
"telemetry_sdk_language": "python",
"telemetry_sdk_name": "opentelemetry",
"telemetry_sdk_version": "1.45.2",
"trace_id": "0628221118a0c0036d21036b8ebc7bcf"
},
"values": [
[
"1796016625209251840",
"{\"attempt\":3,\"event\":\"job_attempt\",\"outcome\":\"ready\",\"service_name\":\"messenger-worker\",\"severity\":\"INFO\",\"span_id\":\"99bec6d11586ce67\",\"timestamp\":1796016625.2092469,\"trace_id\":\"0628221118a0c0036d21036b8ebc7bcf\"}"
]
]
}
],
"stats": {
"summary": {
"bytesProcessedPerSecond": 42943969,
"linesProcessedPerSecond": 104473,
"totalBytesProcessed": 501072,
"totalLinesProcessed": 1219,
"execTime": 0.011668,
"queueTime": 8.4e-05,
"subqueries": 0,
"totalEntriesReturned": 4,
"splits": 0,
"shards": 1,
"totalPostFilterLines": 4,
"totalStructuredMetadataBytesProcessed": 146280
},
"querier": {
"store": {
"totalChunksRef": 0,
"totalChunksDownloaded": 0,
"chunksDownloadTime": 0,
"queryReferencedStructuredMetadata": false,
"chunk": {
"headChunkBytes": 0,
"headChunkLines": 0,
"decompressedBytes": 0,
"decompressedLines": 0,
"compressedBytes": 0,
"totalDuplicates": 0,
"postFilterLines": 0,
"headChunkStructuredMetadataBytes": 0,
"decompressedStructuredMetadataBytes": 0
},
"chunkRefsFetchTime": 0,
"congestionControlLatency": 0,
"pipelineWrapperFilteredLines": 0
}
},
"ingester": {
"totalReached": 1,
"totalChunksMatched": 11,
"totalBatches": 2,
"totalLinesSent": 4,
"store": {
"totalChunksRef": 0,
"totalChunksDownloaded": 0,
"chunksDownloadTime": 0,
"queryReferencedStructuredMetadata": false,
"chunk": {
"headChunkBytes": 501072,
"headChunkLines": 1219,
"decompressedBytes": 0,
"decompressedLines": 0,
"compressedBytes": 0,
"totalDuplicates": 0,
"postFilterLines": 4,
"headChunkStructuredMetadataBytes": 146280,
"decompressedStructuredMetadataBytes": 0
},
"chunkRefsFetchTime": 137333,
"congestionControlLatency": 0,
"pipelineWrapperFilteredLines": 0
}
},
"cache": {
"chunk": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"index": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"result": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"statsResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"volumeResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"seriesResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"labelResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
},
"instantMetricResult": {
"entriesFound": 0,
"entriesRequested": 0,
"entriesStored": 0,
"bytesReceived": 0,
"bytesSent": 0,
"requests": 0,
"downloadTime": 0,
"queryLengthServed": 0
}
},
"index": {
"totalChunks": 0,
"postFilterChunks": 0,
"shardsDuration": 0,
"usedBloomFilters": false
}
}
}
}
File diff suppressed because it is too large Load Diff
+28
View File
@@ -0,0 +1,28 @@
# Official public images/binaries were removed upstream; build fixed release sources.
FROM golang:1.24.2-bookworm AS minio-build
ENV CGO_ENABLED=0 GOMAXPROCS=2 GOTOOLCHAIN=local
RUN git clone --depth 1 --branch RELEASE.2025-04-22T22-12-26Z https://github.com/minio/minio.git /src
WORKDIR /src
RUN go build -p 2 -trimpath -ldflags='-s -w' -o /out/minio .
RUN test "$(git rev-parse HEAD)" = 0d7408fc9969caf07de6a8c3a84f9fbb10a6739e && go build -p 2 -trimpath -ldflags='-s -w -X github.com/minio/minio/cmd.Version=2025-04-22T22:12:26Z -X github.com/minio/minio/cmd.ReleaseTag=RELEASE.2025-04-22T22-12-26Z -X github.com/minio/minio/cmd.CommitID=0d7408fc9969caf07de6a8c3a84f9fbb10a6739e' -o /out/minio .
FROM golang:1.24.2-bookworm AS mc-build
ENV CGO_ENABLED=0 GOMAXPROCS=2 GOTOOLCHAIN=local
RUN git clone --depth 1 --branch RELEASE.2025-04-16T18-13-26Z https://github.com/minio/mc.git /src
WORKDIR /src
RUN go build -p 2 -trimpath -ldflags='-s -w' -o /out/mc .
RUN test "$(git rev-parse HEAD)" = b00526b153a31b36767991a4f5ce2cced435ee8e && go build -p 2 -trimpath -ldflags='-s -w -X github.com/minio/mc/cmd.Version=2025-04-16T18:13:26Z -X github.com/minio/mc/cmd.ReleaseTag=RELEASE.2025-04-16T18-13-26Z -X github.com/minio/mc/cmd.CommitID=b00526b153a31b36767991a4f5ce2cced435ee8e' -o /out/mc .
FROM python:3.13.5-slim AS minio
LABEL org.opencontainers.image.source="https://github.com/minio/minio" org.opencontainers.image.version="RELEASE.2025-04-22T22-12-26Z"
RUN useradd --uid 10002 --create-home minio && mkdir /data && chown 10002:10002 /data
COPY --from=minio-build /out/minio /usr/local/bin/minio
COPY infra/minio/server.sh /server.sh
USER 10002
ENTRYPOINT ["/bin/sh", "/server.sh"]
CMD ["server", "/data", "--address", ":9000", "--console-address", "127.0.0.1:9001"]
FROM debian:bookworm-slim AS mc
LABEL org.opencontainers.image.source="https://github.com/minio/mc" org.opencontainers.image.version="RELEASE.2025-04-16T18-13-26Z"
COPY --from=mc-build /out/mc /usr/local/bin/mc
ENTRYPOINT ["/bin/sh", "/config/bootstrap.sh"]
+45
View File
@@ -0,0 +1,45 @@
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::messenger-attachments"
]
},
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::messenger-attachments"
],
"Condition": {
"StringLike": {
"s3:prefix": [
"originals/*",
"staging/*",
"variants/*"
]
}
}
},
{
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:DeleteObject"
],
"Resource": [
"arn:aws:s3:::messenger-attachments/originals/*",
"arn:aws:s3:::messenger-attachments/staging/*",
"arn:aws:s3:::messenger-attachments/variants/*"
]
}
]
}
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh
set -eu
export MC_CONFIG_DIR=/tmp/mc
export SSL_CERT_FILE=/trust/ca.crt
root_user=$(cat /run/secrets/minio_root_user)
root_password=$(cat /run/secrets/minio_root_password)
mc alias set local https://minio:9000 "$root_user" "$root_password" >/dev/null
mc mb --ignore-existing local/messenger-attachments >/dev/null
mc anonymous set none local/messenger-attachments >/dev/null
for role in api worker relay test; do
access=$(cat "/run/secrets/s3_${role}_id")
password=$(cat "/run/secrets/s3_${role}_secret")
mc admin user add local "$access" "$password" >/dev/null
mc admin policy create local "lab7-$role" "/policies/$role.json" >/dev/null
mc admin policy attach local "lab7-$role" --user "$access" >/dev/null
done
printf '%s\n' 'Private S3 bootstrap and scoped identities ready.'
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
set -eu
export MINIO_ROOT_USER="$(cat /run/secrets/minio_root_user)"
export MINIO_ROOT_PASSWORD="$(cat /run/secrets/minio_root_password)"
exec minio "$@"
+73
View File
@@ -0,0 +1,73 @@
worker_processes 1;
error_log /dev/stderr warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
access_log off;
server_tokens off;
limit_conn_zone $server_name zone=uploads:64k;
# Docker DNS; resolve updates the upstream when replicas get new IPs.
resolver 127.0.0.11 valid=1s ipv6=off;
resolver_timeout 1s;
upstream messenger {
zone messenger 64k;
# All A records of api participate in the default round-robin balancing.
server api:9443 resolve max_fails=1 fail_timeout=2s;
}
server {
listen 8443 ssl;
ssl_certificate /pki/tls.crt;
ssl_certificate_key /pki/tls.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_tickets off;
client_max_body_size 32k;
proxy_ssl_trusted_certificate /trust/ca.crt;
proxy_ssl_verify on;
proxy_ssl_server_name on;
proxy_ssl_name api;
proxy_ssl_certificate /pki/tls.crt;
proxy_ssl_certificate_key /pki/tls.key;
server_name messenger;
location ~ ^/api/v1/chats/[^/]+/attachments$ {
limit_conn uploads 16;
client_max_body_size 11m;
client_body_buffer_size 64k;
client_body_timeout 10s;
proxy_request_buffering on;
proxy_pass https://messenger;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Connection "";
proxy_connect_timeout 1s;
proxy_read_timeout 30s;
proxy_send_timeout 30s;
proxy_next_upstream error timeout http_503;
proxy_next_upstream_tries 2;
}
location / {
proxy_pass https://messenger;
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Connection "";
proxy_connect_timeout 1s;
proxy_read_timeout 5s;
proxy_send_timeout 5s;
# Passive checks. Do NOT enable non_idempotent: an already-sent POST
# must not be resent by Nginx after an ambiguous response.
proxy_next_upstream error timeout http_503;
proxy_next_upstream_tries 2;
proxy_next_upstream_timeout 6s;
}
}
}
+17
View File
@@ -0,0 +1,17 @@
groups:
- name: messenger
rules:
- alert: HighApiErrorRate
expr: sum(rate(http_requests_total{status_class="5xx"}[1m])) / clamp_min(sum(rate(http_requests_total[1m])),0.001) > 0.05
for: 15s
labels: {severity: warning}
annotations:
summary: Business API 5xx exceeds 5% in 1 minute
runbook: Check postgres.query error spans, DB pool and request logs. Restore DB and confirm resolved.
- alert: QueueLagGrowing
expr: max(queue_oldest_age_seconds) > 15
for: 15s
labels: {severity: warning}
annotations:
summary: Oldest unfinished attachment is older than 15 seconds
runbook: Check worker capacity/busy, job outcomes and consumer spans. Restore worker and confirm queue drains.
+88
View File
@@ -0,0 +1,88 @@
receivers:
otlp:
protocols:
http:
endpoint: 127.0.0.1:4318
processors:
memory_limiter:
check_interval: 1s
limit_mib: 192
spike_limit_mib: 48
batch:
timeout: 1s
send_batch_size: 128
send_batch_max_size: 256
exporters:
prometheus:
endpoint: 127.0.0.1:9464
resource_to_telemetry_conversion:
enabled: true
metric_expiration: 10s
otlp/tempo:
endpoint: tempo:4319
tls:
ca_file: /trust/ca.crt
cert_file: /pki/tls.crt
key_file: /pki/tls.key
insecure: false
timeout: 2s
sending_queue:
enabled: true
queue_size: 256
num_consumers: 2
retry_on_failure:
enabled: true
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 20s
otlphttp/loki:
endpoint: https://loki:9443/otlp
timeout: 2s
sending_queue:
enabled: true
queue_size: 256
num_consumers: 2
retry_on_failure:
enabled: true
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 20s
tls:
ca_file: /trust/ca.crt
cert_file: /pki/tls.crt
key_file: /pki/tls.key
insecure: false
service:
telemetry:
metrics:
readers:
- pull:
exporter:
prometheus:
host: 127.0.0.1
port: 8888
pipelines:
metrics:
receivers:
- otlp
processors:
- memory_limiter
- batch
exporters:
- prometheus
logs:
receivers:
- otlp
processors:
- memory_limiter
- batch
exporters:
- otlphttp/loki
traces:
receivers:
- otlp
processors:
- memory_limiter
- batch
exporters:
- otlp/tempo
@@ -0,0 +1,436 @@
{
"uid": "messenger-lab6",
"title": "Messenger \u2014 API and pipeline",
"schemaVersion": 41,
"version": 1,
"refresh": "5s",
"time": {
"from": "now-15m",
"to": "now"
},
"tags": [
"lab6"
],
"panels": [
{
"id": 1,
"type": "timeseries",
"title": "Business RPS",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(rate(http_requests_total[1m]))",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps"
},
"overrides": []
}
},
{
"id": 2,
"type": "timeseries",
"title": "5xx ratio",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(rate(http_requests_total{status_class=\"5xx\"}[1m])) / clamp_min(sum(rate(http_requests_total[1m])),0.001)",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit"
},
"overrides": []
}
},
{
"id": 3,
"type": "timeseries",
"title": "HTTP p50",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.5,sum by(le)(rate(http_server_duration_seconds_bucket[1m])))",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 4,
"type": "timeseries",
"title": "HTTP p95",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.95,sum by(le)(rate(http_server_duration_seconds_bucket[1m])))",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 5,
"type": "timeseries",
"title": "HTTP p99",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 16,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.99,sum by(le)(rate(http_server_duration_seconds_bucket[1m])))",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 6,
"type": "timeseries",
"title": "Jobs by outcome",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 16,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum by(outcome)(rate(jobs_processed_total[1m]))",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "ops"
},
"overrides": []
}
},
{
"id": 7,
"type": "timeseries",
"title": "Job p95",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 24,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.95,sum by(le)(rate(job_processing_duration_seconds_bucket[1m])))",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 8,
"type": "timeseries",
"title": "Accepted to ready p95",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 24,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "histogram_quantile(0.95,sum by(le)(rate(attachment_ready_seconds_bucket[1m])))",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 9,
"type": "timeseries",
"title": "Queue depth",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 32,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "max(queue_depth)",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 10,
"type": "timeseries",
"title": "Oldest unfinished job",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 32,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "max(queue_oldest_age_seconds)",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
}
},
{
"id": 11,
"type": "timeseries",
"title": "DB pool used / waiting",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 40,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum by(service_name)(db_pool_used)",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 12,
"type": "timeseries",
"title": "DB pool waiting",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 40,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum by(service_name)(db_pool_waiting)",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 13,
"type": "timeseries",
"title": "Worker busy / capacity",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 48,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "sum(worker_busy{service_name=\"messenger-worker\"}) / clamp_min(sum(worker_capacity{service_name=\"messenger-worker\"}),1)",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit"
},
"overrides": []
}
},
{
"id": 14,
"type": "timeseries",
"title": "Process RSS",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 48,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "process_memory_bytes",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes"
},
"overrides": []
}
},
{
"id": 15,
"type": "timeseries",
"title": "Process CPU cores",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 56,
"w": 12,
"h": 8
},
"targets": [
{
"expr": "rate(process_cpu_seconds_total[1m])",
"refId": "A",
"legendFormat": "{{service_name}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
}
]
}
@@ -0,0 +1,7 @@
apiVersion: 1
providers:
- name: messenger
folder: Messenger
type: file
options:
path: /var/lib/grafana/dashboards
@@ -0,0 +1,28 @@
apiVersion: 1
datasources:
- name: Prometheus
uid: prometheus
type: prometheus
url: http://prometheus:9090
isDefault: true
access: proxy
- name: Loki
uid: loki
type: loki
url: http://loki:3100
access: proxy
jsonData:
derivedFields:
- name: TraceID
matcherRegex: '"trace_id":\s*"([0-9a-f]{32})"'
datasourceUid: tempo
url: '$${__value.raw}'
- name: Tempo
uid: tempo
type: tempo
url: http://tempo:3200
access: proxy
jsonData:
tracesToLogsV2:
datasourceUid: loki
filterByTraceID: true
+34
View File
@@ -0,0 +1,34 @@
auth_enabled: false
server:
http_listen_port: 3100
http_listen_address: 127.0.0.1
grpc_listen_address: 127.0.0.1
common:
path_prefix: /loki
replication_factor: 1
ring:
kvstore:
store: inmemory
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
instance_addr: 127.0.0.1
schema_config:
configs:
- from: 2024-01-01
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h
limits_config:
allow_structured_metadata: true
retention_period: 168h
compactor:
working_directory: /loki/compactor
retention_enabled: true
delete_request_store: filesystem
analytics:
reporting_enabled: false
+26
View File
@@ -0,0 +1,26 @@
global:
scrape_interval: 2s
evaluation_interval: 2s
rule_files:
- /etc/prometheus/alerts.yaml
scrape_configs:
- job_name: messenger
static_configs:
- targets:
- collector:9465
scheme: https
tls_config:
ca_file: /trust/ca.crt
cert_file: /pki/tls.crt
key_file: /pki/tls.key
server_name: collector
- job_name: collector
static_configs:
- targets:
- collector:8889
scheme: https
tls_config:
ca_file: /trust/ca.crt
cert_file: /pki/tls.crt
key_file: /pki/tls.key
server_name: collector
+33
View File
@@ -0,0 +1,33 @@
server:
http_listen_port: 3200
http_listen_address: 127.0.0.1
grpc_listen_address: 127.0.0.1
distributor:
receivers:
otlp:
protocols:
grpc:
endpoint: 127.0.0.1:4317
ingester:
trace_idle_period: 2s
max_block_duration: 10s
max_block_bytes: 8388608
concurrent_flushes: 1
flush_check_period: 2s
complete_block_timeout: 30s
compactor:
compaction:
block_retention: 168h
storage:
trace:
backend: local
blocklist_poll: 10s
search:
read_buffer_count: 4
read_buffer_size_bytes: 262144
wal:
path: /var/tempo/wal
local:
path: /var/tempo/blocks
usage_report:
reporting_enabled: false
+3
View File
@@ -0,0 +1,3 @@
FROM python:3.13.5-slim
RUN pip install --no-cache-dir pip-audit==2.9.0
ENTRYPOINT ["python", "-m", "pip_audit", "--cache-dir", "/tmp/pip-audit", "--disable-pip", "--no-deps", "-r", "/requirements.lock", "--format", "json", "--output", "/out/dependency-scan.json"]
+37
View File
@@ -0,0 +1,37 @@
[
{
"port": 6380,
"upstream_port": 6379,
"allowed_clients": [
"api",
"relay"
],
"protocol": "redis",
"redis_user": "producer",
"commands": [
"AUTH",
"PING",
"CLIENT",
"XADD"
]
},
{
"port": 6381,
"upstream_port": 6379,
"allowed_clients": [
"worker"
],
"protocol": "redis",
"redis_user": "consumer",
"commands": [
"AUTH",
"PING",
"CLIENT",
"XGROUP",
"XREADGROUP",
"XAUTOCLAIM",
"XACK",
"XDEL"
]
}
]
+8
View File
@@ -0,0 +1,8 @@
bind 127.0.0.1
port 6379
appendonly yes
appendfsync always
dir /data
aclfile /etc/redis/users.acl
maxmemory 96mb
maxmemory-policy noeviction
+7
View File
@@ -0,0 +1,7 @@
bind 127.0.0.1
port 6379
appendonly yes
dir /data
aclfile /etc/redis/users.acl
maxmemory 64mb
maxmemory-policy allkeys-lru
+40
View File
@@ -0,0 +1,40 @@
[
{
"port": 4319,
"upstream_port": 4318,
"allowed_clients": [
"api",
"worker",
"relay"
],
"protocol": "http"
},
{
"port": 9465,
"upstream_port": 9464,
"allowed_clients": [
"prometheus"
],
"protocol": "http",
"read_only_clients": [
"prometheus"
],
"read_prefixes": [
"/metrics"
]
},
{
"port": 8889,
"upstream_port": 8888,
"allowed_clients": [
"prometheus"
],
"protocol": "http",
"read_only_clients": [
"prometheus"
],
"read_prefixes": [
"/metrics"
]
}
]
+25
View File
@@ -0,0 +1,25 @@
[
{
"port": 9443,
"upstream_port": 3100,
"allowed_clients": [
"collector",
"grafana",
"operator"
],
"read_only_clients": [
"grafana",
"operator"
],
"protocol": "http",
"read_prefixes": [
"/ready",
"/loki/api/v1/query",
"/loki/api/v1/labels",
"/loki/api/v1/label/",
"/loki/api/v1/series",
"/loki/api/v1/index/",
"/loki/api/v1/volume"
]
}
]
+16
View File
@@ -0,0 +1,16 @@
ui = true
disable_mlock = true
api_addr = "https://openbao:8200"
cluster_addr = "https://127.0.0.1:8201"
listener "tcp" {
address = "0.0.0.0:8200"
cluster_address = "127.0.0.1:8201"
tls_cert_file = "/pki/tls.crt"
tls_key_file = "/pki/tls.key"
tls_client_ca_file = "/trust/ca.crt"
tls_require_and_verify_client_cert = true
tls_min_version = "tls12"
}
storage "file" {
path = "/openbao/file"
}
+5
View File
@@ -0,0 +1,5 @@
local all all trust
hostnossl all all 0.0.0.0/0 reject
hostnossl all all ::/0 reject
hostssl all all 0.0.0.0/0 scram-sha-256
hostssl all all ::/0 scram-sha-256
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
set -eu
cp /pki/tls.key /tmp/postgres-tls.key
chown postgres:postgres /tmp/postgres-tls.key
chmod 600 /tmp/postgres-tls.key
exec /usr/local/bin/docker-entrypoint.sh postgres -c hba_file=/config/pg_hba.conf -c ssl=on -c ssl_cert_file=/pki/tls.crt -c ssl_key_file=/tmp/postgres-tls.key -c ssl_min_protocol_version=TLSv1.2 -c log_parameter_max_length_on_error=0
+27
View File
@@ -0,0 +1,27 @@
[
{
"port": 9443,
"upstream_port": 9090,
"allowed_clients": [
"grafana",
"operator"
],
"read_only_clients": [
"grafana",
"operator"
],
"protocol": "http",
"read_prefixes": [
"/-/ready",
"/api/v1/query",
"/api/v1/labels",
"/api/v1/label/",
"/api/v1/series",
"/api/v1/metadata",
"/api/v1/status/",
"/api/v1/alerts",
"/api/v1/rules",
"/api/v1/targets"
]
}
]
+37
View File
@@ -0,0 +1,37 @@
[
{
"port": 6380,
"upstream_port": 6379,
"allowed_clients": [
"api"
],
"protocol": "redis",
"redis_user": "profile",
"commands": [
"AUTH",
"PING",
"CLIENT",
"GET",
"SET"
]
},
{
"port": 6382,
"upstream_port": 6379,
"allowed_clients": [
"operator"
],
"protocol": "redis",
"redis_user": "tester",
"commands": [
"AUTH",
"PING",
"CLIENT",
"GET",
"SET",
"FLUSHDB",
"DEL",
"TTL"
]
}
]
+33
View File
@@ -0,0 +1,33 @@
[
{
"port": 9443,
"upstream_port": 3200,
"allowed_clients": [
"grafana",
"operator"
],
"read_only_clients": [
"grafana",
"operator"
],
"protocol": "http",
"read_prefixes": [
"/ready",
"/api/traces/",
"/api/search",
"/api/v2/search",
"/api/echo",
"/api/status/"
]
},
{
"port": 4319,
"upstream_port": 4317,
"allowed_clients": [
"collector"
],
"alpn": [
"h2"
]
}
]
+34
View File
@@ -0,0 +1,34 @@
CREATE TABLE users (
id uuid PRIMARY KEY,
username text NOT NULL UNIQUE CHECK (username ~ '^[a-z0-9_]{3,32}$'),
display_name text NOT NULL CHECK (char_length(display_name) BETWEEN 1 AND 100),
password_hash text NOT NULL,
created_at timestamptz NOT NULL DEFAULT clock_timestamp()
);
CREATE TABLE chats (
id uuid PRIMARY KEY,
title text NOT NULL CHECK (char_length(title) BETWEEN 1 AND 100),
created_at timestamptz NOT NULL DEFAULT clock_timestamp()
);
CREATE TABLE chat_members (
chat_id uuid NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
user_id uuid NOT NULL REFERENCES users(id),
PRIMARY KEY (chat_id, user_id)
);
CREATE INDEX chat_members_user_idx ON chat_members(user_id, chat_id);
CREATE INDEX chats_history_idx ON chats(created_at, id);
CREATE TABLE messages (
id uuid PRIMARY KEY,
chat_id uuid NOT NULL REFERENCES chats(id),
sender_id uuid NOT NULL,
text text NOT NULL CHECK (char_length(text) BETWEEN 1 AND 4000),
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
FOREIGN KEY (chat_id, sender_id) REFERENCES chat_members(chat_id, user_id)
);
CREATE INDEX messages_history_idx ON messages(chat_id, created_at, id);
CREATE TABLE sessions (
token_hash text PRIMARY KEY,
user_id uuid NOT NULL REFERENCES users(id),
expires_at timestamptz NOT NULL
);
CREATE INDEX sessions_expiry_idx ON sessions(expires_at);
+11
View File
@@ -0,0 +1,11 @@
-- Additive: old lab2 tables and messages remain valid.
CREATE TABLE idempotency_records (
user_id uuid NOT NULL REFERENCES users(id),
chat_id uuid NOT NULL REFERENCES chats(id),
key text NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
request_hash text NOT NULL,
message_id uuid REFERENCES messages(id),
expires_at timestamptz NOT NULL,
PRIMARY KEY (user_id, chat_id, key)
);
CREATE INDEX idempotency_expiry_idx ON idempotency_records(expires_at);
+23
View File
@@ -0,0 +1,23 @@
CREATE TABLE attachments (
id uuid PRIMARY KEY,
chat_id uuid NOT NULL REFERENCES chats(id),
owner_id uuid NOT NULL REFERENCES users(id),
filename text NOT NULL CHECK (char_length(filename) BETWEEN 1 AND 255),
content_type text NOT NULL CHECK (content_type IN ('image/png','image/jpeg')),
size_bytes bigint NOT NULL CHECK (size_bytes BETWEEN 1 AND 10485760),
sha256 text NOT NULL CHECK (sha256 ~ '^[a-f0-9]{64}$'),
object_key text NOT NULL UNIQUE,
created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
updated_at timestamptz NOT NULL DEFAULT clock_timestamp(),
FOREIGN KEY (chat_id,owner_id) REFERENCES chat_members(chat_id,user_id)
);
CREATE INDEX attachments_chat_idx ON attachments(chat_id,id);
ALTER TABLE messages DROP CONSTRAINT messages_text_check;
ALTER TABLE messages ADD CONSTRAINT messages_text_check CHECK (char_length(text) <= 4000);
CREATE TABLE message_attachments (
message_id uuid NOT NULL REFERENCES messages(id),
attachment_id uuid NOT NULL REFERENCES attachments(id),
position smallint NOT NULL CHECK (position BETWEEN 0 AND 9),
PRIMARY KEY (message_id,attachment_id),
UNIQUE (message_id,position)
);
+19
View File
@@ -0,0 +1,19 @@
ALTER TABLE attachments ADD COLUMN status text NOT NULL DEFAULT 'ready' CHECK (status IN ('queued','processing','ready','failed'));
ALTER TABLE attachments ADD COLUMN error_code text;
ALTER TABLE attachments ADD COLUMN staging_key text UNIQUE;
ALTER TABLE attachments ADD COLUMN variants jsonb NOT NULL DEFAULT '[]';
CREATE TABLE attachment_jobs (
id uuid PRIMARY KEY, attachment_id uuid NOT NULL UNIQUE REFERENCES attachments(id),
pipeline_version integer NOT NULL DEFAULT 1 CHECK (pipeline_version=1),
attempt integer NOT NULL DEFAULT 0, replay_count integer NOT NULL DEFAULT 0,
lease_until timestamptz, next_at timestamptz NOT NULL DEFAULT clock_timestamp(),
created_at timestamptz NOT NULL DEFAULT clock_timestamp(), traceparent text, tracestate text
);
CREATE TABLE job_outbox (
job_id uuid PRIMARY KEY REFERENCES attachment_jobs(id), dispatched_at timestamptz
);
CREATE TABLE job_replays (
id bigserial PRIMARY KEY, job_id uuid NOT NULL REFERENCES attachment_jobs(id),
created_at timestamptz NOT NULL DEFAULT clock_timestamp(), reason text NOT NULL
);
CREATE INDEX jobs_due ON attachment_jobs(next_at);

Some files were not shown because too many files have changed in this diff Show More