ЛР 7 — БПИ2303 — Поликарпов — на 5 #22

Open
Grbisba wants to merge 1 commits from Grbisba/mtusi2026lab7:solution/polikarpov-bpi2303 into main
255 changed files with 21516 additions and 124 deletions
+5
View File
@@ -18,3 +18,8 @@ __pycache__
node_modules
evidence
.DS_Store
.lab7-faults
bin
.cache
+13 -41
View File
@@ -1,41 +1,13 @@
# 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
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
# No secret values. compose.yaml contains the default local synthetic profile.
# Export these only when running an additional isolated source snapshot:
# LAB7_PROJECT=mtusi2026lab7
# LAB7_BASE_URL=https://localhost:8443
# LAB7_BAO_OPERATOR_ADDR=https://localhost:18200
# Service environment settings are configured in compose.yaml, not in a secret .env:
# SESSION_TTL_SECONDS=3600
# ARGON2_MEMORY_KIB=65536
# ARGON2_ITERATIONS=3
# ARGON2_PARALLELISM=1
# API/worker/dispatcher receive DB, S3 and Redis credentials via OpenBao.
# Their TLS identity is mounted at /run/identity; generated runtime secrets
# live in /run/credentials (tmpfs). Operator material stays outside containers.
+8 -15
View File
@@ -1,18 +1,11 @@
## Лабораторная 7
## Лабораторная 7 — Поликарпов Даниил Александрович, БПИ2303
Автор / группа: TODO
Целевая оценка (3/4/5): TODO
Трек 5, если заявлен: TODO
Целевая оценка: 5. Трек: «Компрометация worker».
Что реализовано и что перенесено: TODO
Команды запуска из чистого clone: TODO
Результаты проверок и ссылка на REPORT.md: TODO
Ограничения / известные ошибки: TODO
Источники и использование ИИ: TODO
Перенесена собственная реализация lab6. Добавлены TLS/mTLS с проверкой service identity, scoped OpenBao policies и DB leases, ограничение login/KDF, rehash, минимальные DB/S3/broker права и воспроизводимые сценарии отзыва/восстановления.
- [ ] Весь обязательный минимум текущей и предыдущих работ сохранён с объявленными переходами.
- [ ] Контракт и публичные тесты не ослаблены.
- [ ] make check и make test выполнены; приложен реальный вывод.
- [ ] Сценарии отказов/безопасности своего уровня воспроизведены.
- [ ] Все секреты и приватные ключи находятся вне Git; отчёт не содержит tokens.
- [ ] README задания сохранён, REPORT.md содержит инструкцию именно моего решения.
Запуск: `make up`; HTTPS smoke: `make test test-security`; последовательная приёмка: `./scripts/final-checks.sh`. Методика, фактические результаты и ограничения находятся в [REPORT.md](../REPORT.md), [evidence](../evidence/) и [модели угроз](../security/THREAT_MODEL.md).
Обязательные контракты и публичные tests не ослаблены. Secrets/CA key/unseal material создаются локально вне Git и image. Single-host стенд не обеспечивает HA DB/LB/host; законные worker privileges всё ещё позволяют повредить его разрешённые данные. Source/image scan относится к явно указанному scope.
Источники и использование ИИ Codex раскрыты в отчёте. Публикация PR самим агентом не выполнялась.
+20
View File
@@ -0,0 +1,20 @@
name: Application HTTPS smoke
on: [push, pull_request]
permissions:
contents: read
jobs:
application:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Build and bootstrap isolated synthetic stand
run: make up
- name: Verify HTTPS API and external trust
run: make test test-security
- name: Stop stand
if: always()
run: ./scripts/compose.sh down -v
+4
View File
@@ -30,3 +30,7 @@ coverage/
.vscode/
# Keep small, sanitized evidence summaries in evidence/ under version control.
# Inspect git diff --cached: ignore rules are not a secret scanner.
.lab7-faults/
.cache/
+38
View File
@@ -0,0 +1,38 @@
FROM --platform=$BUILDPLATFORM golang:1.27.2-alpine3.23@sha256:9e45f0eb4a63ed37ad6e604950407558b7c738e34e015ae77a5d4ad369cde079 AS build
ENV GOTOOLCHAIN=go1.27.4
RUN attempt=0; until go version; do attempt=$((attempt + 1)); [ "$attempt" -lt 3 ] || exit 1; sleep 2; done
WORKDIR /src
COPY service/go.mod service/go.sum ./
RUN attempt=0; until go mod download; do attempt=$((attempt + 1)); [ "$attempt" -lt 3 ] || exit 1; sleep 2; done
COPY service/ ./
ARG TARGETOS
ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build -mod=readonly -trimpath -ldflags="-s -w" -o /out/messenger ./cmd/app
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -mod=readonly -trimpath -ldflags="-s -w" -o /out/securityprobe ./cmd/securityprobe
FROM alpine:3.23.6@sha256:85fe1e81d6758c208f3e1eed4338a1997e19d4be002d4dd32d3100c9a8c010a0
RUN apk add --no-cache musl=1.2.5-r24 musl-utils=1.2.5-r24 zlib=1.4-r0 imagemagick=7.1.2.35-r0 imagemagick-webp=7.1.2.35-r0 imagemagick-jpeg=7.1.2.35-r0
COPY infra/imagemagick-policy.xml /etc/ImageMagick-7/policy.xml
COPY --from=build --chmod=0555 /out/messenger /usr/local/bin/messenger
COPY --from=build --chmod=0555 /out/securityprobe /usr/local/bin/securityprobe
ENV APP_HOST=0.0.0.0 \
APP_PORT=8080 \
APP_SHUTDOWN_TIMEOUT=8s
USER 65532:65532
EXPOSE 8080
STOPSIGNAL SIGTERM
HEALTHCHECK --interval=10s --timeout=3s --start-period=5s --retries=3 \
CMD wget -q -O /dev/null "http://127.0.0.1:8081/health/ready" || exit 1
ENTRYPOINT ["/usr/local/bin/messenger"]
+25 -1
View File
@@ -1,6 +1,6 @@
PYTHON ?= python3
BASE_URL ?= https://localhost:8443
CA_FILE ?=
CA_FILE ?= $(CURDIR)/secrets/lab7/lb/ca.crt
ACTION_SCRIPT ?=
TLS_ARGS = $(if $(CA_FILE),--ca-file "$(CA_FILE)",)
@@ -31,3 +31,27 @@ test-failover:
test-security:
$(PYTHON) tests/security.py --base-url "$(BASE_URL)" $(TLS_ARGS)
.PHONY: up down build vet test-go test-internal-security prove-worker
up:
./scripts/up.sh
down:
./scripts/compose.sh down
build:
cd service && go build ./...
vet:
cd service && go vet ./...
test-go:
cd service && go test ./internal/...
test-internal-security:
$(PYTHON) scripts/security.py
prove-worker:
$(PYTHON) scripts/experiment-worker.py
.PHONY: scan-dependencies scan-image
scan-dependencies:
mkdir -p bin
GOBIN="$(CURDIR)/bin" go install golang.org/x/vuln/cmd/govulncheck@v1.1.4
cd service && ../bin/govulncheck ./... > ../evidence/govulncheck.txt
scan-image:
$(PYTHON) scripts/scan-images.py
+4
View File
@@ -110,3 +110,7 @@ Threat model, заполненная trust matrix, TLS/mTLS конфигурац
- [OpenBao policies](https://openbao.org/docs/concepts/policies/)
- [OpenBao production hardening](https://openbao.org/docs/internals/security/)
- [Docker security](https://docs.docker.com/engine/security/)
## Реализация Поликарпова Даниила Александровича, БПИ2303
Инструкция реализации — [REPORT.md](REPORT.md), целевой результат — «5», трек «Компрометация worker». Старт: `make up`; проверка HTTPS: `make test test-security`. Фактические результаты перечислены в [evidence/verification-summary.md](evidence/verification-summary.md). Исходное задание и публичный контракт сохранены.
+122 -23
View File
@@ -1,37 +1,136 @@
# Отчёт — лабораторная 7
# Отчёт — лабораторная работа №7
- Автор, группа: TODO
- Целевая оценка; выбранный трек 5, если нужен: TODO
- Commit/PR: TODO после публикации
- Использованные источники, библиотеки и помощь ИИ: TODO
Автор: **Поликарпов Даниил Александрович**. Группа: **БПИ2303**.
Целевая оценка: **5**, трек **«Компрометация worker»**. Commit/PR не публиковались; доказательства относятся к рабочему дереву и идентификаторам образов из `evidence/`.
## Запуск из чистого clone
TODO: версии runtime/образов, prerequisites, команды создания локальных secrets/.env, build, миграций, запуска, ожидания готовности, тестов и остановки. Указать необходимые действия оператора. Не вставлять секреты. Отдельно указать безопасную остановку и команду намеренного удаления учебных данных.
Для локальных Go build/vet и source scanner нужен Go с поддержкой загрузки toolchain 1.27.4; Docker-сборка не зависит от host Go. Нужны Docker Engine/Desktop с Compose v2+, Python 3.9+, OpenSSL с поддержкой `req -addext`, доступ к container/module registries и свободные localhost-порты 8443, 13443, 18200. Для полного стенда рекомендуется выделить Docker не менее 8 GiB RAM. Приложение собирается из `service/`; Go toolchain 1.27.4 скачивается и проверяется штатным Go checksum mechanism. Базовый build image содержит Go 1.27.2, но `GOTOOLCHAIN=go1.27.4` закрепляет фактически используемый компилятор. Сетевые загрузки имеют не более трёх попыток. Для публичных base images build использует временную Docker CLI config без keychain helper; пользовательские credentials/config не изменяются.
## Архитектура и решения
```sh
make up
make test test-security
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements-dev.txt
make check validate PYTHON=.venv/bin/python
make build vet test-go
make scan-dependencies scan-image
make test-internal-security
```
TODO: схема процессов/хранилищ, источник истины, транзакционные границы, ограничения. Что перенесено из lab6, что изменено в этой работе. Соответствие переменных из .env.example реальной конфигурации.
`make up` создаёт локальную CA и synthetic secrets, запускает persistent non-dev OpenBao, делает init/unseal, устанавливает policies и database engine, запускает миграции отдельным процессом, выдаёт DB privileges, создаёт приватный bucket и запускает две API-реплики, dispatcher и worker. `.env` с секретами не нужен. Реальные настройки находятся в `compose.yaml`; `.env.example` объясняет их соответствие. Повторный bootstrap сохраняет ключи, credentials и volumes; он не является автоматической ротацией.
## Доказательства критериев
HTTPS API: `https://localhost:8443`; Grafana: `https://localhost:13443`; OpenBao operator endpoint: `https://localhost:18200`. Публичный CA находится в `secrets/lab7/lb/ca.crt`. Не отключать проверку сертификатов. Пользователь Grafana — `admin`; пароль оператор читает из локального `secrets/lab7/operator/grafana_password`, не прикладывая его к отчёту.
| Критерий README | Команда/сценарий | Наблюдаемый результат | Файл доказательства |
| --- | --- | --- | --- |
| Публичный smoke | make test | TODO | TODO |
| Остальные пункты уровня 3 | TODO | TODO | TODO |
| Все пункты уровня 4, если заявлен | TODO | TODO | TODO |
| Выбранный трек 5, если заявлен | TODO | TODO | TODO |
```sh
# Остановка с сохранением данных:
make down
# После обычного рестарта sealed OpenBao оператор выполняет:
python3 scripts/bao.py unseal
# Полная последовательная приёмка на synthetic stand:
./scripts/final-checks.sh
# Проверка отдельного source-only snapshot с новыми CA/secrets/volumes:
python3 scripts/prove-clean-clone.py
# Намеренное удаление ВСЕХ учебных данных именно этого проекта:
./scripts/compose.sh down -v
```
TODO: добавить отдельную строку для каждого заявленного критерия. PASS без команды и наблюдения не является доказательством. Проверка инфраструктурного hook требует подтверждения, какие реальные процессы/хранилища перезапущены.
Последняя команда разрушает учебные volumes. После неё старые operator unseal shares не подходят новому storage OpenBao: для полностью нового стенда также нужен новый локальный secrets-каталог; сохранённые secrets и storage должны восстанавливаться согласованно. Lab6 не затрагивается.
## Эксперименты и отказы
## Архитектура и границы ответственности
TODO: гипотеза, hardware/лимиты, версии, объём данных, профиль нагрузки, concurrency/arrival rate, длительность/прогрев, повторы, успешные RPS, ошибки, p50/p95/p99, CPU/RAM. Сохранить raw summary без tokens и объяснить ограничения измерения.
Перенесены собственный Go-сервис, миграции 001–011, PostgreSQL/Redis, durable S3 staging, RabbitMQ/outbox, обработка изображений, сигналы OTel и Grafana provisioning. Публичные контракты и проверки lab7 сохранены. Исходные доказательства lab6 не переносились как результаты lab7.
| Воздействие | Что ожидаем | Что наблюдали | Время восстановления / потеря данных |
| --- | --- | --- | --- |
| TODO | TODO | TODO | TODO |
Путь запроса: клиент → TLS → HAProxy → обязательное mTLS → API. Handler разбирает/валидирует вход; service проверяет доступ, выполняет use case и определяет транзакционные переходы; repository делает параметризованные SQL-операции и сохраняет результат. Новые transport/OpenBao/rate-limit интеграции находятся в `internal/pkg`. В PostgreSQL не добавлены HTTP processing, бизнес-процедуры или функции авторизации: DB roles и GRANT — инфраструктурное ограничение привилегий.
## Ограничения и следующие шаги
PostgreSQL остаётся источником истины. До upload 202 исходник записан в durable staging и зафиксированы metadata/job/outbox. Dispatcher публикует с confirm; worker подтверждает доставку после durable результата. At-least-once delivery компенсируется существующей идемпотентностью эффекта. Сессии и message idempotency хранятся в PostgreSQL, Redis используется как cache и общий rate limiter.
TODO: какие отказы выдерживаются и какие нет; что не реализовано; где учебное упрощение; какое улучшение подтверждено, а какое пока гипотеза.
| Роль | Service / storage | Проверка / сеть / credentials |
| --- | --- | --- |
| API ×2 | api, без локального persistent state | Health через закрытый loopback; LB readiness по mTLS; DB dynamic lease, scoped KV |
| Worker / dispatcher | отдельные worker/dispatcher процессы | Разные DB roles и broker identities; worker CPU 1, RAM 1 GiB, concurrency 2, job timeout 60 s |
| DB | postgres, postgres_data | TLS verify-full :5432; migrator отдельно от app; pg_isready |
| Cache/limit | redis, redis_data | TLS :6380; ACL user api; AOF, noeviction; default user off |
| S3 | SeaweedFS s3, s3_data | mTLS Envoy :9443; backend loopback :9000; разные SigV4 prefixes |
| Broker | RabbitMQ broker, broker_data | Native mTLS :5671, EXTERNAL → CN user; producer/consumer ACL |
| Telemetry | Collector + Prometheus/Loki/Tempo и их volumes | mTLS boundaries, bounded SDK/Collector queues, native storage |
| UI | grafana, grafana_data | Только localhost HTTPS; anonymous off; TLS datasource provisioning создаётся локально |
| Secrets | openbao, bao_data | Non-dev, TLS, cert auth, scoped policies, audit в persistent volume |
Точные версии/digests, CPU/RAM limits, user, capabilities, mounts и ports закреплены в Compose; фактический запуск сохранён в `evidence/environment.json`. Сеть зависимостей internal; только LB, Grafana и OpenBao имеют дополнительные ingress connections с localhost port mappings. Подробная матрица: [contracts/trust-matrix.md](contracts/trust-matrix.md).
App/worker/dispatcher работают как UID 65532, с read-only rootfs, drop ALL capabilities, no-new-privileges и tmpfs. OpenBao работает как UID 100:1000 с read-only rootfs; отдельный одноразовый helper меняет владельца только его data volume, не имеет сети и получает CHOWN/DAC_OVERRIDE. Collector и telemetry backends также используют read-only rootfs и выделенные writable volumes/tmpfs. PostgreSQL, Redis, RabbitMQ и SeaweedFS сохраняют writable stateful filesystem/штатный entrypoint: это исключение для инициализации, data/log paths и восстановления; privileged, host network и Docker socket не используются.
## Пароли, сессии и lifecycle
Argon2id хранит version, memory/time/parallelism, случайную 16-byte salt и 32-byte результат в PHC-подобной строке. Текущий профиль — 64 MiB, t=3, p=1; сохранённые параметры ограничены до выделения памяти. Существующий профиль lab6 p=4 проверяется и заменяется при успешном входе через compare-and-swap UPDATE. Для отсутствующего пользователя выполняется dummy KDF. На процесс допускаются два вычисления KDF, включая регистрацию; очередь ограничивается request deadline. Общая RAM для двух одновременных KDF — около 128 MiB без учёта runtime, при API limit 512 MiB.
Login limit общий для реплик: 10/min по hash username и 60/min по hash IP. LB заменяет X-Forwarded-For; API доверяет ему только после проверки LB identity. При превышении — 429/Retry-After; при недоступности Redis login fail-closed с 503. JSON ограничен 1 MiB, upload — 10 MiB, decoded image — 40 млн pixels. Ошибки credentials одинаковые. Session fingerprints — SHA-256 высокоэнтропийных токенов, а не password hashes; logout/expiry проверяются по серверной записи.
Operator bootstrap создаёт CA и leaf certificates на 24 часа. Закрытый каталог оператора 0700 не монтируется ни одному приложению. Каждый сервис получает только свою identity. Root token после начального provisioning отзывается и удаляется из init.json. Unseal требует 2 из 3 shares; в учебном варианте shares хранятся вместе на защищённом operator host. Это доверие к операторскому компьютеру, не распределённое хранение custodians.
API/worker/dispatcher получают Bao token с TTL 300 s и max TTL 1800 s, DB lease 600 s/max 1800 s. Renewal выполняется раз в 15 s; независимый watchdog отменяет общий lifecycle context за 3 s до ближайшего token/DB/cert expiry, даже если HTTP renewal завис. Отмена останавливает HTTP/dependency операции и приём задач; рестарт требует новой успешной аутентификации. Изменение рабочего KV вызывает безопасный restart процесса без пересборки image. DB lease rotation ограничивает lifetime отдельных LOGIN roles.
```sh
# Новый leaf LB с отзывом старого serial, без пересборки:
python3 scripts/renew-leaf.py lb
# Полный incident response worker:
python3 scripts/rotate-worker.py
# Измерение password/expiry и sealed behavior:
python3 scripts/prove-auth.py
python3 scripts/prove-sealed.py
```
Ротация worker отзывает Bao auth/tokens/DB leases, закрывает DB sessions, удаляет старого broker CN user, заменяет S3 key и leaf, обновляет CRL и пересоздаёт proxies. Новая worker identity получает новый CN; восстановление нового пользователя не возвращает права старому сертификату. Static S3 key сам по себе не истекает: его фактический отзыв на S3 обязателен и проверяется отдельно.
## Доказательства и методика
Фактические результаты и даты находятся в `evidence/`. Наличие скрипта не считается выполненным сценарием. Итоговый перечень проверок приведён в `evidence/verification-summary.md`; файлы с ошибками диагностических запусков не выдаются за PASS.
| Критерий | Команда | Доказательство |
| --- | --- | --- |
| Контракты, JSON Schema, build/vet, перенесённые Go checks | make check validate; make build vet test-go | contracts.txt, go-checks.txt, govulncheck.txt |
| HTTPS API и внешний недоверенный CA | make test test-security | public-checks.txt, final-smoke.txt |
| Каждая API replica, SAN/CA/no-cert, broker/Collector, backend matrix и Redis ACL | make test-internal-security | security.json, security-run.txt |
| Password rehash, измеренный KDF/login budget, logout/expiry, 429, body limit | prove-auth.py; security.py | auth.json, security.json |
| OpenBao policy allow/deny и bounded sealed behavior | security.py; prove-sealed.py | security.json, sealed.json |
| Leaf/secret rotation и старые identities | renew-leaf.py; experiment-worker.py | leaf-rotation.json, worker-experiment.json |
| Реальные три сигнала и отсутствие canary credentials/body | prove-telemetry.py | telemetry.json |
| Форматы/геометрия, EXIF/alpha, ACL и oversized image | student-tests/images.py | images.json |
| Staging/retention/restore/replay и broker volume | student-tests/storage.py; broker_persistence.py | storage.json, broker-persistence.json |
| Реальный restart stores и прежняя сессия | test-persistence с restart.sh | persistence-run.txt, restart-evidence.json |
| Последовательный отказ обеих API-реплик | test-failover с stop-one.sh, restore между запусками | failover-first.txt, failover-second.txt |
| Source/image scan и applicability | govulncheck; scan-images.py | image-scan.json; security/SCAN_TRIAGE.md |
| Независимый запуск без lab6/secrets/volumes | prove-clean-clone.py | clean-clone.json |
### Фактический итог 17 ноября 2026
Все строки итоговой сводки имеют выполненные команды и PASS. Source scan и scan OS/Go binaries application image дали 0 findings. Удалённый GitHub workflow только настроен; его запуск не заявляется.
Argon2id (12 samples, 64 MiB/t=3/p=1): p50 103,545 ms, p95/max 181,749 ms. Login probe: 24 заведомо неверных входа, concurrency 8, 1,490 s, p95 536,995 ms; все ответы — ожидаемые 401, без 5xx. Это примерно 16,1 negative authentication responses/s, не измерение максимальной пропускной способности. Отдельная brute-force проверка получила 429/Retry-After через общий limiter.
Sealed OpenBao с сокращённым token TTL 30 s привёл к fail-closed за 28,546 s; после operator unseal API восстановился. Публичные failover запуски подтвердили 122/123 успешных записей, по одному переходному отказу и first recovery 1,804/1,338 s. Дополнительный сценарий остановил каждый из двух физических контейнеров по очереди и проверил старую сессию и retry без дубля. Restart evidence подтвердил смену StartedAt всех девяти stores с сохранёнными volumes.
Worker incident response: три повтора по пять файлов; recovery 40,323 / 39,502 / 43,285 s. Во всех повторах: 5 accepted → 5 ready, потеря 0, duplicate jobs 0, ровно 20 manifest records, оригинальные SHA-256 совпали. Старые S3 key, broker CN и Bao leaf отклонены. Resource snapshots и scope широкого/restricted профиля находятся в JSON.
Source-only snapshot поднялся в отдельном проекте с новыми secrets/CA/volumes и отдельным image tag, прошёл HTTPS API/external trust. Независимая сборка дала побайтно одинаковые messenger/securityprobe binaries; Docker image manifest/provenance может иметь другой ID. Это зафиксировано отдельно в `image-equivalence.json`.
### Исследовательский трек «Компрометация worker»
Гипотеза: отдельные worker credentials ограничивают доступ к DB/S3/broker, а последовательный отзыв и замена identity восстанавливают обработку устойчиво принятых доброкачественных задач без потерь и дублей.
Методика: synthetic stand, 3 повтора; в каждом worker остановлен, приняты пять PNG 320×200 из публичного fixture, проверены durable jobs. Одноразовые изолированные operator probes воспроизводят широкие права исходной lab6 и сравнивают их с restricted worker: DB password/session tables и DDL; S3 bucket-wide против prefix scope; broker configure/publish против consume. Широкие credentials не выдаются основным app/worker процессам. После incident response проверяются старый Bao leaf, broker CN, S3 key и новый mTLS access; worker восстанавливается. Сверяются IDs, пять ready, SHA-256 оригиналов и ровно 20 variant-manifest rows (original + три производных на файл).
Профиль — пять последовательных acceptance requests при остановленном consumer, worker concurrency 2, без прогрева и без заявления максимального RPS. Сохраняются acceptance latency, recovery seconds, observation errors и Docker CPU/RAM snapshot. Сценарий исследует recovery и permissions, а не производительность под production нагрузкой. Результаты всех повторов — `worker-experiment.json`; measured login concurrency/RPS/latency — `auth.json`.
Во время разработки обнаружен stale network namespace у Envoy после restart parent. Исправление: после рестарта родителя sidecar пересоздаётся. Диагностические попытки до исправления могли довести synthetic jobs до failed; они не включаются в успешные исследовательские повторы. Исправленный restart/rotation проходит отдельные проверки. Дополнительно для loopback GRPC listeners Loki/Tempo явно задан loopback advertised ring address; иначе их внутренний scheduler/ingester пытался обращаться к закрытому bridge address.
Проверка локальных generated secrets, private keys и unseal shares против файлов сдачи: `python3 scripts/audit-secrets.py`, результат — `evidence/secret-audit.json`. Она дополняет canary-проверку telemetry.
## Ограничения и источники
Один Docker host, одна DB, один LB и один broker не защищают от потери host/storage. Worker с его законными правами способен испортить разрешённые job metadata и S3 prefixes; эксперимент не доказывает сохранность после произвольной злонамеренной порчи этих ресурсов. Leaf renewal в этом треке выполняет оператор; автоматический CA rollover не заявляется. Canaries проверяют записанные logs и выборочные backend signals, а не все возможные будущие потоки. Scan scope и остаточные findings явно перечислены в triage.
Собственная база перенесена из lab6. Использованы Go, pgx, AWS SDK for Go v2, amqp091-go, go-redis, OTel SDK, ImageMagick и закреплённые Docker images. Реализация, скрипты и документация подготовлены с помощью ИИ Codex; результаты должны быть объяснимы автором на защите.
Первичные источники: [Argon2id и OWASP](https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html), [OpenBao cert auth](https://openbao.org/docs/auth/cert/), [OpenBao audit configuration](https://openbao.org/docs/configuration/audit/), [RabbitMQ TLS](https://www.rabbitmq.com/docs/ssl), [RabbitMQ access control](https://www.rabbitmq.com/docs/access-control), [SeaweedFS S3](https://github.com/seaweedfs/seaweedfs/wiki/S3-Configuration), [OTel Collector configuration](https://opentelemetry.io/docs/collector/configuration/).
+22
View File
@@ -0,0 +1,22 @@
# Explicit isolated experiment profile. Never enabled by make up.
services:
api:
environment:
LAB5_FAULTS: "1"
volumes:
- ./.lab7-faults:/faults
worker:
environment:
LAB5_FAULTS: "1"
JOB_TIMEOUT: 5s
JOB_LEASE: 8s
volumes:
- ./.lab7-faults:/faults
dispatcher:
environment:
LAB5_FAULTS: "1"
volumes:
- ./.lab7-faults:/faults
operator:
environment:
LAB5_FAULTS: "1"
+1030
View File
File diff suppressed because it is too large Load Diff
+26 -33
View File
@@ -1,37 +1,30 @@
# Матрица доверия — заполнить в решении lab7
# Матрица доверия lab7
Это обязательная матрица покрытия. Для каждой строки укажите реальный порт, endpoint, CA, service identity, проверку SAN/ACL, срок жизни credentials и команду положительного/отрицательного теста. TLS шифрует и подтверждает сервер; mTLS также проверяет клиента. При доверенном CA всё равно нужно ограничивать разрешённую identity. Plaintext hop допустим только внутри закрытого локального transport/proxy boundary, без опубликованного обхода; границу и rationale нужно доказать.
CA — локальная `lab7-local-ca`, создаётся `scripts/bootstrap.py`. SAN перечислены ниже; ключ CA и Shamir shares находятся в закрытом каталоге оператора, который не монтируется сервисам. Leaf certificates действуют 24 часа, CA — 365 дней. Клиентская и серверная EKU заданы явно. Все серверные проверки включают CA и hostname; app не включает `InsecureSkipVerify`.
| Связь | Минимум на 3 | Дополнительно на 4 | Доказательство / конфиг |
| --- | --- | --- | --- |
| Клиент → ingress/LB | TLS, CA + hostname, Bearer | Проверка expiry/revocation сессии и общего login rate limit | TODO |
| LB → API (все реплики) | mTLS + allowlist LB identity | Ротация leaf без обхода проверки | TODO |
| API/worker → PostgreSQL | TLS verify-full + раздельные ограниченные DB roles | Ротация credentials; mTLS — допустимое усиление | TODO |
| API/worker → S3 | TLS + разные scoped credentials/prefix rights | Проверка denied prefix и ротация | TODO |
| API/worker → broker | TLS + разные producer/consumer identities и ACL | mTLS + ограничение допустимых SAN/ролей | TODO |
| API/worker → Collector | TLS; сеть/аутентификация запрещает произвольный ingest | mTLS с раздельными identities | TODO |
| Collector → telemetry backends | TLS + scoped backend credentials или mTLS | Ротация и проверка least privilege | TODO |
| Grafana → data sources | TLS с проверкой сервера, ограниченная identity | Отрицательные проверки доступа | TODO |
| API/worker/agent → OpenBao | TLS + сервисный auth + scoped policy | Renewal/expiry/revocation | TODO |
| Оператор → OpenBao/Grafana/S3 admin | TLS + authentication, доступ локальный/через защищённый канал | Разделение operator/application roles | TODO |
| API → Redis/Valkey, если используется | TLS + ACL/пароль с минимальными правами | Ротация; mTLS по возможности | TODO |
| Replication/кластерные каналы, если добавлены | TLS/mTLS либо подтверждённый шифрованный transport | Проверка заявленной модели отказа | TODO |
| Связь | Endpoint / транспорт | Identity и авторизация | Lifecycle | Проверка |
| --- | --- | --- | --- | --- |
| Клиент → LB | localhost:8443, TLS | SAN localhost/127.0.0.1; бизнес-API требует Bearer | Сессия 3600 s, logout/expiry | `make test test-security`, `scripts/prove-auth.py` |
| LB → API ×2 | api:8080, mTLS | SAN api; клиент только DNS SAN lb, CRL; TLS tickets выключены | Leaf 24 h; `renew-leaf.py lb` | `scripts/security.py`, `scripts/renew-leaf.py lb` |
| API/worker/dispatcher → PostgreSQL | postgres:5432, TLS verify-full | Сервер SAN postgres; разные динамические LOGIN roles, наследующие api_role/worker_role/dispatcher_role | DB lease 600 s, max 1800 s, renewal; отзыв закрывает DB sessions | `securityprobe` db; `experiment-worker.py` |
| API/worker → S3 | s3:9443, mTLS + SigV4 | SAN s3; Envoy допускает SAN api/worker/operator-client; S3 отдельно проверяет scoped access key и prefix | KV key живёт до ротации; token grant ограничивает время его использования приложением | `securityprobe` s3; incident rotation |
| Dispatcher/worker → broker | broker:5671, mTLS + EXTERNAL | SAN broker; CN клиента → отдельный RabbitMQ user; producer и consumer permissions различаются | Leaf 24 h; при инциденте старый CN user удаляется вместе с соединением | `securityprobe` amqp/amqp-tls; worker experiment |
| API/worker/dispatcher → Collector | otel-collector:9443, mTLS | Только DNS SAN api/worker/dispatcher; CRL в Envoy | Leaf 24 h; обновление CRL требует пересоздания proxy | `scripts/security.py` |
| Collector → Loki/Tempo | loki:9443/otlp, tempo:9444, mTLS | SAN otel-collector; Loki разрешает только POST /otlp/v1/logs; Tempo ingest отделён от query | Leaf 24 h | `scripts/prove-telemetry.py`, Envoy RBAC |
| Prometheus → Collector metrics | otel-collector:9444 и :9445, mTLS | Только SAN prometheus; backend listeners loopback :8889/:8888 | Leaf 24 h | `up` в TLS query, `prove-telemetry.py` |
| Grafana → data sources | prometheus/loki/tempo:9443, mTLS | Только SAN grafana на query-пути; Loki write закрыт; Tempo ingest недоступен Grafana; Prometheus write API не включён | Generated provisioning вне Git; leaf 24 h | `prove-telemetry.py`, Envoy policies |
| API/worker/dispatcher → OpenBao | openbao:8200, TLS + cert auth | Каждая auth role доверяет конкретному leaf; policy разрешает только собственный KV и DB role | Token 300 s, max 1800 s; renewal/re-auth; DB lease отдельно | `security.py`, `prove-sealed.py`, `experiment-worker.py` |
| Оператор → OpenBao | localhost:18200, TLS + operator cert auth | SAN localhost; scoped operator policy; первоначальный root token отзывается после bootstrap | Operator token 300 s, max 1800 s; unseal — 2 из 3 shares | `bao.py`, `bao.py unseal` |
| Оператор → Grafana | localhost:13443, HTTPS + пароль | SAN localhost; anonymous выключен | Пароль генерируется локально, не хранится в Compose environment | HTTPS login; generated provisioning |
| Оператор → S3 | s3:9443 через Compose tools, mTLS + admin SigV4 | SAN operator-client; отдельный admin key; административного внешнего S3-порта нет | Operator-only files | `compose.sh run --rm -T operator storage bootstrap` |
| API → Redis | redis:6380, TLS + Redis ACL | SAN redis; user api, только chat:* и ratelimit:*; default off; admin commands запрещены | Секрет выдаётся API через OpenBao; noeviction и AOF | Общий rate limit в `security.py` |
| Replication / cluster | N/A | Реплик DB/broker/SeaweedFS между контейнерами нет | Один Docker host | Ограничение модели отказов |
Нет выбранного компонента — отметьте N/A с причиной, а не оставляйте пустую строку. Внутренний публичный health listener, если нужен, минимален и изолирован; через него нельзя обращаться к бизнес-API без mTLS. Отдельно задокументируйте scrape/health/bootstrap каналы: они тоже не должны создавать обход.
## Локальные границы и административные действия
## Обязательные отрицательные проверки
1. HTTPS с правильным CA/hostname проходит; с пустым/чужим CA и неправильным hostname — ошибка верификации, не «сервер недоступен».
2. LB→API: без client cert, с cert чужого CA, с запрещённой identity от доверенного CA — отказ; с разрешённой LB identity — успех.
3. На 4 повторите набор для broker и Collector; ограничение на network policy не заменяет проверку identity.
4. Пользователь вне чата не читает metadata/content и не прикрепляет чужой файл; поддельный X-User-Id не меняет Bearer identity.
5. OpenBao app policy читает только свой secret/path; запись policy и чтение чужого path запрещены. Worker не получает admin credentials API/БД/S3.
6. На 4 отзовите secret/cert и дождитесь контролируемого эффекта с учётом действующих соединений, TLS resumption и cache/TTL. Покажите новое подключение, иначе тест отзыва может ничего не проверить.
## Bootstrap и эксплуатация
В репозитории только открытые конфиги, policy templates и scripts. CA private key, leaf keys, root token, unseal shares и SecretID не коммитятся, не запекаются в образ и не печатаются в отчёте. Для локального стенда оператор создаёт их вне Git и передаёт через files/secrets с ограниченными правами. Опишите, кто имеет доступ к CA/unseal, что нужно после рестарта OpenBao и как восстановить работу.
OpenBao не использует dev-mode. Выберите persistent storage и auth метод (например AppRole с короткоживущим SecretID/response wrapping, cert auth или иная обоснованная identity). Не подменяйте root token постоянной переменной BAO_TOKEN в приложении. Рабочие tokens имеют policy, TTL и renewal/re-auth сценарий. Статические KV secrets на 3 допустимы при реальном чтении через сервисную identity; динамические DB credentials — хорошее расширение, но не обязательное название технологии.
Разрешённый компромисс учебного стенда: ручной operator init/unseal, если он безопасно документирован и не нужен при каждом обычном рестарте API. Автоматическое хранение всех unseal shares рядом с OpenBao без защиты не считается решённым bootstrap.
- Envoy использует общий network namespace только со своим backend. Backend слушает loopback; его plaintext port с bridge недоступен. SeaweedFS master/filer/volume/S3 работают внутри одного контейнера и используют loopback.
- API health listener :8081 привязан к 127.0.0.1 и принимает только `/health/live` и `/health/ready`. Бизнес-маршруты на нём возвращают 404. LB проверяет readiness через основной mTLS listener.
- Bootstrap/migrations выполняются одноразовыми operator tools. PostgreSQL Unix socket доступен только внутри его контейнера; эти действия требуют доступа оператора к Docker host.
- После restart/recreate родителя Envoy пересоздаётся, чтобы войти в актуальный namespace. Обычный restart sidecar недостаточен для надёжного восстановления этой границы.
- Worker certificate CN получает новую версию при каждом отзыве. Старый RabbitMQ user удаляется; новый CN не восстанавливает права старому сертификату. Envoy использует CRL, OpenBao — привязку к новому leaf и отзыв выданных tokens/leases.
- Обычные рабочие процессы не получают root token, unseal shares, CA key, migrator password или чужую identity. Scoped KV credentials сами по себе не становятся автоматически истекающими: украденный S3 key необходимо отозвать на S3, что делает incident script.
+1
View File
@@ -0,0 +1 @@
PASS: Grafana HTTPS operator authentication and anonymous denial
+5
View File
@@ -0,0 +1,5 @@
{
"grafana_verified_https": true,
"anonymous_user_api_denied": true,
"operator_authenticated": true
}
+1
View File
@@ -0,0 +1 @@
PASS: each physical API container stopped sequentially; session/write/idempotency preserved
+14
View File
@@ -0,0 +1,14 @@
[
{
"stopped_container": "1292b6fbbd2a01262923490e3dd18bd64e253c326aa0834f9db53ae247fb18a9",
"recovery_seconds": 0.13170712487772107,
"original_session_valid": true,
"no_duplicate": true
},
{
"stopped_container": "55c1a619dba179163f075c9a50e72eaf37bb9a87bb4a2b4ae968621c13108b3f",
"recovery_seconds": 1.378536291886121,
"original_session_valid": true,
"no_duplicate": true
}
]
+1
View File
@@ -0,0 +1 @@
PASS: legacy rehash, KDF measurements and session expiry
+26
View File
@@ -0,0 +1,26 @@
{
"rehash_lab6_profile_on_login": true,
"kdf": {
"iterations": 3,
"max_ms": 181.749,
"max_parallel_kdf": 2,
"memory_kib": 65536,
"p50_ms": 103.545,
"p95_ms": 181.749,
"parallelism": 1,
"samples": 12
},
"login_dos_budget": {
"requests": 24,
"concurrency": 8,
"duration_seconds": 1.490289583336562,
"statuses": {
"401": 24
},
"p95_all_ms": 536.9945000857115,
"api_memory_limit_mib": 512,
"max_kdf_memory_mib_per_process": 128,
"max_kdf_parallel_per_process": 2
},
"session_ttl_2_seconds_expires": true
}
+10
View File
@@ -0,0 +1,10 @@
{
"result": "PASS",
"attachment_id": "e969c5c6-9e00-489e-b0c9-8fcfb739c8c5",
"broker_hostname": "broker",
"old_container_id": "3a55196a154c99581deaa314187bcefc09d31d6a01a9f80c0659cd43fae9ef00",
"new_container_id": "be47e533bc90852ec009a15c8f2e9d8bfaed3dfeaa73e80e8a03191e2e3370c1",
"message_present_before_and_after": true,
"outbox_published_before_replacement": true,
"dispatcher_stopped_during_replacement": true
}
+1
View File
@@ -0,0 +1 @@
PASS: confirmed message survived broker container replacement with the same volume and stable node identity
+1
View File
@@ -0,0 +1 @@
PASS: expired leaf with trusted CA and allowed LB SAN rejected
+5
View File
@@ -0,0 +1,5 @@
{
"trusted_ca": true,
"allowed_lb_san": true,
"expired_leaf_rejected": true
}
+1
View File
@@ -0,0 +1 @@
PASS: fresh source-only snapshot with new secrets/volumes passes HTTPS smoke
+9
View File
@@ -0,0 +1,9 @@
{
"fresh_source_snapshot": true,
"new_ca_and_secrets": true,
"new_project_and_volumes": true,
"separate_application_image_tag": true,
"no_lab6_access": true,
"verified_https_smoke": "PASS: lab7 public API scenario; infrastructure and grading evidence remain separate.",
"duration_seconds": 21.36097679194063
}
+4
View File
@@ -0,0 +1,4 @@
.venv/bin/python scripts/check_contract.py
PASS: offline skeleton structure, local refs and Python syntax; application NOT tested.
.venv/bin/python scripts/validate_openapi.py
PASS: full OpenAPI 3.1 and JSON Schema validation; application NOT tested.
+346
View File
@@ -0,0 +1,346 @@
{
"timestamp": "2026-11-17T14:23:20.326528+00:00",
"base_commit": "20afc2c790d3e72f6b7666376c9834c1ced1a405",
"working_tree_changes": true,
"system": "macOS-26.5.1-arm64-arm-64bit-Mach-O",
"architecture": "arm64",
"docker": "29.7.2",
"compose": "5.3.1",
"containers": [
{
"name": "/mtusi2026lab7-api-1",
"image_id": "sha256:c207d41316af63e9dd59e8f6794c59664ea2257c120c12f4663699a6015f941f",
"started_at": "2026-11-17T14:21:21.899518257Z",
"user": "65532:65532",
"memory_limit": 536870912,
"nano_cpus": 1000000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-api-2",
"image_id": "sha256:c207d41316af63e9dd59e8f6794c59664ea2257c120c12f4663699a6015f941f",
"started_at": "2026-11-17T14:21:22.03496334Z",
"user": "65532:65532",
"memory_limit": 536870912,
"nano_cpus": 1000000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-broker-1",
"image_id": "sha256:32962eea9bf99928c2fc541a7defb78c7feca9df0434c5dfb7b539d61e1af524",
"started_at": "2026-11-17T14:09:35.819957347Z",
"user": "",
"memory_limit": 536870912,
"nano_cpus": 500000000,
"read_only": false,
"cap_drop": null,
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-dispatcher-1",
"image_id": "sha256:c207d41316af63e9dd59e8f6794c59664ea2257c120c12f4663699a6015f941f",
"started_at": "2026-11-17T14:21:21.895641548Z",
"user": "65532:65532",
"memory_limit": 536870912,
"nano_cpus": 250000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-grafana-1",
"image_id": "sha256:0615ec4fbd4072004b7d86b46ded63013a74b7d6eb1119273dd89e8fa25c13cf",
"started_at": "2026-11-17T14:09:32.193343262Z",
"user": "472",
"memory_limit": 402653184,
"nano_cpus": 500000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {
"3000/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "13443"
}
]
}
},
{
"name": "/mtusi2026lab7-lb-1",
"image_id": "sha256:96ec3c75a9264ba94e733eeacb44051ed6e7b79bb77a73c2c36f236b6423f1f0",
"started_at": "2026-11-17T14:09:38.225323208Z",
"user": "haproxy",
"memory_limit": 134217728,
"nano_cpus": 500000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {
"8443/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "8443"
}
]
}
},
{
"name": "/mtusi2026lab7-loki-1",
"image_id": "sha256:b43c257ccfc925d4a50b8717cac61a3b51df8c48d01847936057e5c4075a24a7",
"started_at": "2026-11-17T14:09:31.680025386Z",
"user": "10001",
"memory_limit": 402653184,
"nano_cpus": 500000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-loki-tls-1",
"image_id": "sha256:08acc53db6f4ac46e77e36b203c5254b4a2549869314bb54cf97aab81baa4566",
"started_at": "2026-11-17T14:09:37.32076875Z",
"user": "65532:65532",
"memory_limit": 134217728,
"nano_cpus": 250000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-openbao-1",
"image_id": "sha256:595c83b42614a4d2b044608e4593c05b019c5db25bc9c185d8fff3ac96c03ddd",
"started_at": "2026-11-17T14:09:31.746126136Z",
"user": "100:1000",
"memory_limit": 268435456,
"nano_cpus": 500000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {
"8200/tcp": [
{
"HostIp": "127.0.0.1",
"HostPort": "18200"
}
]
}
},
{
"name": "/mtusi2026lab7-otel-collector-1",
"image_id": "sha256:ffc818ee108d0b934fd14207fd87ff247c9b64f344ed349d0b66c166c18a2312",
"started_at": "2026-11-17T14:09:31.295292678Z",
"user": "10001:10001",
"memory_limit": 268435456,
"nano_cpus": 500000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-otel-collector-tls-1",
"image_id": "sha256:08acc53db6f4ac46e77e36b203c5254b4a2549869314bb54cf97aab81baa4566",
"started_at": "2026-11-17T14:17:14.918988212Z",
"user": "65532:65532",
"memory_limit": 134217728,
"nano_cpus": 250000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-postgres-1",
"image_id": "sha256:05aa77262db9277fde6374bb2f901c9604b8a9373029e1a7993440c6aae48736",
"started_at": "2026-11-17T14:09:31.375696886Z",
"user": "",
"memory_limit": 1073741824,
"nano_cpus": 2000000000,
"read_only": false,
"cap_drop": null,
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-prometheus-1",
"image_id": "sha256:e04987641b57704f408e31f6373ba4138ecf27cb4a165d24aabb6c38fddd0f06",
"started_at": "2026-11-17T14:09:31.215812844Z",
"user": "nobody",
"memory_limit": 402653184,
"nano_cpus": 500000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-prometheus-tls-1",
"image_id": "sha256:08acc53db6f4ac46e77e36b203c5254b4a2549869314bb54cf97aab81baa4566",
"started_at": "2026-11-17T14:09:37.25840775Z",
"user": "65532:65532",
"memory_limit": 134217728,
"nano_cpus": 250000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-redis-1",
"image_id": "sha256:489a769e0a54dc245896132a15c72d2bc7296719954da99398f43a3877e5f8eb",
"started_at": "2026-11-17T14:09:31.388634636Z",
"user": "",
"memory_limit": 134217728,
"nano_cpus": 250000000,
"read_only": false,
"cap_drop": null,
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-s3-1",
"image_id": "sha256:57877e32bb90073b37dc109b438ba66e84fd5ed9ced5f5c04f56444ef243ce59",
"started_at": "2026-11-17T14:17:14.280459003Z",
"user": "",
"memory_limit": 536870912,
"nano_cpus": 1000000000,
"read_only": false,
"cap_drop": null,
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-s3-tls-1",
"image_id": "sha256:08acc53db6f4ac46e77e36b203c5254b4a2549869314bb54cf97aab81baa4566",
"started_at": "2026-11-17T14:17:14.883127462Z",
"user": "65532:65532",
"memory_limit": 134217728,
"nano_cpus": 250000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-tempo-1",
"image_id": "sha256:65a5789759435f1ef696f1953258b9bbdb18eb571d5ce711ff812d2e128288a4",
"started_at": "2026-11-17T14:09:31.447828553Z",
"user": "10001:10001",
"memory_limit": 402653184,
"nano_cpus": 500000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-tempo-tls-1",
"image_id": "sha256:08acc53db6f4ac46e77e36b203c5254b4a2549869314bb54cf97aab81baa4566",
"started_at": "2026-11-17T14:09:37.338702Z",
"user": "65532:65532",
"memory_limit": 134217728,
"nano_cpus": 250000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
},
{
"name": "/mtusi2026lab7-worker-1",
"image_id": "sha256:c207d41316af63e9dd59e8f6794c59664ea2257c120c12f4663699a6015f941f",
"started_at": "2026-11-17T14:21:21.870546215Z",
"user": "65532:65532",
"memory_limit": 1073741824,
"nano_cpus": 1000000000,
"read_only": true,
"cap_drop": [
"ALL"
],
"security_opt": [
"no-new-privileges:true"
],
"port_bindings": {}
}
],
"docker_cpus": 14,
"docker_memory_bytes": 8320954368
}
+4
View File
@@ -0,0 +1,4 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "https://localhost:8443" --ca-file "/Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab7/secrets/lab7/lb/ca.crt"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 122, "failed_attempts": 1, "first_recovery_seconds": 1.804}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+4
View File
@@ -0,0 +1,4 @@
python3 tests/resilience.py --mode failover --action-script "scripts/stop-one.sh" --base-url "https://localhost:8443" --ca-file "/Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab7/secrets/lab7/lb/ca.crt"
Executing explicit failover hook; hook output suppressed to avoid leaking secrets.
{"observed_instances_before": 2, "successful_writes": 123, "failed_attempts": 1, "first_recovery_seconds": 1.338}
PASS: failover preserved confirmed data and existing session. Hook scope needs operator evidence.
+10
View File
@@ -0,0 +1,10 @@
[
{
"instance_alias": "bca289fa-980d-4efa-b168-85176e3c952b",
"container_id": "d6fda7f70c3273d02dc57c920ab696da50e151e22af44ed8a285ea6913902da1"
},
{
"instance_alias": "fb217a37-a62d-47f8-90a2-f6e5a7340541",
"container_id": "d6fda7f70c3273d02dc57c920ab696da50e151e22af44ed8a285ea6913902da1"
}
]
+4
View File
@@ -0,0 +1,4 @@
python3 tests/smoke.py --base-url "https://localhost:8443" --ca-file "/Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab7/secrets/lab7/lb/ca.crt"
PASS: lab7 public API scenario; infrastructure and grading evidence remain separate.
python3 tests/security.py --base-url "https://localhost:8443" --ca-file "/Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab7/secrets/lab7/lb/ca.crt"
PASS: trusted HTTPS works; untrusted CA rejected. This does NOT verify internal mTLS, OpenBao or hardening.
+39
View File
@@ -0,0 +1,39 @@
cd service && go build ./...
cd service && go vet ./...
cd service && go test ./internal/...
? gitea.privcloud.tech/mtusi2026/internal/adapter/controller/http [no test files]
? gitea.privcloud.tech/mtusi2026/internal/adapter/repository/cache/outside [no test files]
ok gitea.privcloud.tech/mtusi2026/internal/adapter/repository/storage 0.478s
? gitea.privcloud.tech/mtusi2026/internal/config [no test files]
? gitea.privcloud.tech/mtusi2026/internal/dto [no test files]
? gitea.privcloud.tech/mtusi2026/internal/gen/contracts [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/apperr [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/auth/jwtprovider [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/broker [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/cache [no test files]
ok gitea.privcloud.tech/mtusi2026/internal/pkg/encrypting (cached)
? gitea.privcloud.tech/mtusi2026/internal/pkg/fault [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/imageprocessor [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/migrator [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/objectstore [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/openbao [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/postgres [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/postgres/txmanager [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/ratelimit [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/rest/framework [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/rest/headers [no test files]
ok gitea.privcloud.tech/mtusi2026/internal/pkg/rest/middleware (cached)
? gitea.privcloud.tech/mtusi2026/internal/pkg/rest/router [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/telemetry [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/transportsecurity [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types/authprovider [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types/environment [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types/role [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/validator [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/attachment [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/auth [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/chat [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/observation [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/outbox [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/user [no test files]
+36
View File
@@ -0,0 +1,36 @@
? gitea.privcloud.tech/mtusi2026/internal/adapter/controller/http [no test files]
? gitea.privcloud.tech/mtusi2026/internal/adapter/repository/cache/outside [no test files]
ok gitea.privcloud.tech/mtusi2026/internal/adapter/repository/storage 0.790s
? gitea.privcloud.tech/mtusi2026/internal/config [no test files]
? gitea.privcloud.tech/mtusi2026/internal/dto [no test files]
? gitea.privcloud.tech/mtusi2026/internal/gen/contracts [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/apperr [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/auth/jwtprovider [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/broker [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/cache [no test files]
ok gitea.privcloud.tech/mtusi2026/internal/pkg/encrypting 1.049s
? gitea.privcloud.tech/mtusi2026/internal/pkg/fault [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/imageprocessor [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/migrator [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/objectstore [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/openbao [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/postgres [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/postgres/txmanager [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/ratelimit [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/rest/framework [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/rest/headers [no test files]
ok gitea.privcloud.tech/mtusi2026/internal/pkg/rest/middleware 0.437s
? gitea.privcloud.tech/mtusi2026/internal/pkg/rest/router [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/telemetry [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/transportsecurity [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types/authprovider [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types/environment [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/types/role [no test files]
? gitea.privcloud.tech/mtusi2026/internal/pkg/validator [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/attachment [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/auth [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/chat [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/observation [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/outbox [no test files]
? gitea.privcloud.tech/mtusi2026/internal/service/user [no test files]
+510
View File
@@ -0,0 +1,510 @@
=== Symbol Results ===
Vulnerability #1: GO-2026-6859
HTTP/1 server crash due to MaxBytesReader header race in net/http
More info: https://pkg.go.dev/vuln/GO-2026-6859
Standard library
Found in: net/http@go1.27
Fixed in: net/http@go1.27.4
Example traces found:
#1: internal/pkg/telemetry/http.go:6:2: telemetry.init calls middleware.init, which calls http.CanonicalHeaderKey
#2: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do
#3: cmd/app/storage.go:64:24: app.runStorage calls http.Client.Get
#4: internal/pkg/auth/jwtprovider/manager.go:42:8: jwtprovider.NewCookieManager calls http.Cookie.Valid
#5: internal/pkg/telemetry/http.go:6:2: telemetry.init calls middleware.init, which eventually calls http.HandleFunc
#6: internal/pkg/rest/router/router.go:73:15: router.router.ServeHTTP calls chi.Mux.ServeHTTP, which calls http.HandlerFunc.ServeHTTP
#7: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls middleware.compressResponseWriter.WriteHeader, which calls http.Header.Add
#8: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls middleware.compressResponseWriter.WriteHeader, which calls http.Header.Del
#9: internal/pkg/rest/framework/framework.go:220:29: framework.ParseToken calls http.Header.Get
#10: internal/adapter/controller/http/attachmentHandler.go:103:16: http.AttachmentHandler.Get calls http.Header.Set
#11: internal/adapter/controller/http/chat.go:184:30: http.ChatHandler.SendMessage calls http.Header.Values
#12: cmd/benchmark/main.go:76:27: benchmark.client.setup calls http.NewRequest
#13: internal/pkg/openbao/client.go:39:40: openbao.client.call calls http.NewRequestWithContext
#14: internal/pkg/telemetry/telemetry.go:93:112: telemetry.Init calls metric.NewPeriodicReader, which eventually calls http.ParseTime
#15: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.ReadRequest
#16: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close, which eventually calls http.ReadResponse
#17: internal/adapter/controller/http/auth.go:38:39: http.AuthHandler.Login calls http.Request.BasicAuth
#18: internal/pkg/auth/jwtprovider/manager.go:111:20: jwtprovider.manager.RefreshToken calls http.Request.Cookie
#19: cmd/benchmark/main.go:77:18: benchmark.client.setup calls http.Request.SetBasicAuth
#20: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close, which eventually calls http.Request.Write
#21: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.Response.Write
#22: internal/adapter/controller/http/controller.go:89:21: http.server.Stop calls http.Server.Close
#23: cmd/app/main.go:156:44: app.run calls http.Server.ListenAndServe
#24: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve
#25: internal/adapter/controller/http/controller.go:87:29: http.server.Stop calls http.Server.Shutdown
#26: internal/pkg/auth/jwtprovider/manager.go:87:17: jwtprovider.manager.Clear calls http.SetCookie
#27: internal/pkg/telemetry/telemetry.go:84:28: telemetry.Init calls otlptracehttp.New, which eventually calls http.Transport.Clone
#28: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.Transport.CloseIdleConnections
#29: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.Transport.RoundTrip
#30: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.body.Close
#31: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.body.Read
#32: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.bodyEOFSignal.Close
#33: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.bodyEOFSignal.Read
#34: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.bodyLocked.Read
#35: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.bufioFlushWriter.Write
#36: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.cancelTimerBody.Close
#37: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.cancelTimerBody.Read
#38: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close, which eventually calls http.checkConnErrorWriter.Write
#39: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close, which eventually calls http.chunkWriter.Write
#40: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.connReader.Read
#41: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.expectContinueReader.Close
#42: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.expectContinueReader.Read
#43: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.gzipReader.Close
#44: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.gzipReader.Read
#45: internal/pkg/encrypting/argon2id.go:70:23: encrypting.encryptor.EncryptSecretUsingArgon2id calls rand.Read, which eventually calls http.loggingConn.Read
#46: internal/pkg/apperr/error.go:79:21: apperr.AppError.Error calls time.parseErrors.Error, which eventually calls http.loggingConn.Write
#47: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.maxBytesReader.Close
#48: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.maxBytesReader.Read
#49: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close, which eventually calls http.onceCloseListener.Close
#50: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.persistConn.Read
#51: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.persistConnWriter.ReadFrom
#52: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close, which eventually calls http.persistConnWriter.Write
#53: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.readTrackingBody.Close
#54: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.readTrackingBody.Read
#55: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.readWriteCloserBody.Read
#56: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.response.ReadFrom
#57: cmd/benchmark/main.go:234:15: benchmark.main calls fmt.Fprintln, which calls http.response.Write
#58: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader
#59: internal/pkg/ratelimit/redis.go:14:29: ratelimit.init calls redis.NewScript, which eventually calls http.response.WriteString
#60: internal/pkg/apperr/error.go:79:21: apperr.AppError.Error calls http.transportReadFromServerError.Error
Vulnerability #2: GO-2026-6809
Distrust compromised intermediate certificates in crypto/x509
More info: https://pkg.go.dev/vuln/GO-2026-6809
Standard library
Found in: crypto/x509@go1.27
Fixed in: crypto/x509@go1.27.3
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig, which eventually calls x509.Certificate.Verify
Vulnerability #3: GO-2026-6700
Pre-negotiation frame limit is not enforced to 4KB in
github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6700
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.14.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig
Vulnerability #4: GO-2026-6617
HTTP/2 server crash due to HPACK encoder race in net/http
More info: https://pkg.go.dev/vuln/GO-2026-6617
Standard library
Found in: net/http/internal/http2@go1.27
Fixed in: net/http/internal/http2@go1.27.2
Example traces found:
#1: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.Close
#2: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.Close
#3: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.RoundTrip
#4: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.RoundTrip
#5: internal/adapter/controller/http/controller.go:87:29: http.server.Stop calls http.Server.Shutdown, which calls http2.Server.GracefulShutdown
#6: internal/adapter/controller/http/controller.go:87:29: http.server.Stop calls http.Server.Shutdown, which calls http2.Server.GracefulShutdown
#7: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve, which eventually calls http2.Server.ServeConn
#8: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve, which eventually calls http2.Server.ServeConn
#9: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.AddConn
#10: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.AddConn
#11: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http2.Transport.CloseIdleConnections
#12: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http2.Transport.CloseIdleConnections
#13: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.NewClientConn
#14: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.NewClientConn
#15: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.RoundTrip
#16: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.RoundTrip
#17: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.bufferedWriterTimeoutWriter.Write
#18: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.bufferedWriterTimeoutWriter.Write
#19: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.chunkWriter.Write
#20: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.chunkWriter.Write
#21: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.gzipReader.Close
#22: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.gzipReader.Close
#23: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.gzipReader.Read
#24: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.gzipReader.Read
#25: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close
#26: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close
#27: cmd/benchmark/main.go:234:15: benchmark.main calls fmt.Fprintln, which calls http2.responseWriter.Write
#28: cmd/benchmark/main.go:234:15: benchmark.main calls fmt.Fprintln, which calls http2.responseWriter.Write
#29: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http2.responseWriter.WriteHeader
#30: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http2.responseWriter.WriteHeader
#31: internal/pkg/ratelimit/redis.go:14:29: ratelimit.init calls redis.NewScript, which eventually calls http2.responseWriter.WriteString
#32: internal/pkg/ratelimit/redis.go:14:29: ratelimit.init calls redis.NewScript, which eventually calls http2.responseWriter.WriteString
#33: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.stickyErrWriter.Write
#34: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.stickyErrWriter.Write
#35: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close
#36: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close
#37: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.transportResponseBody.Read
#38: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.transportResponseBody.Read
Vulnerability #5: GO-2026-6613
HTTP/1 server connection desynchronization after 2xx CONNECT response in
net/http
More info: https://pkg.go.dev/vuln/GO-2026-6613
Standard library
Found in: net/http@go1.27
Fixed in: net/http@go1.27.2
Example traces found:
#1: internal/pkg/telemetry/http.go:6:2: telemetry.init calls middleware.init, which calls http.CanonicalHeaderKey
#2: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do
#3: cmd/app/storage.go:64:24: app.runStorage calls http.Client.Get
#4: internal/pkg/auth/jwtprovider/manager.go:42:8: jwtprovider.NewCookieManager calls http.Cookie.Valid
#5: internal/pkg/telemetry/http.go:6:2: telemetry.init calls middleware.init, which eventually calls http.HandleFunc
#6: internal/pkg/rest/router/router.go:73:15: router.router.ServeHTTP calls chi.Mux.ServeHTTP, which calls http.HandlerFunc.ServeHTTP
#7: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls middleware.compressResponseWriter.WriteHeader, which calls http.Header.Add
#8: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls middleware.compressResponseWriter.WriteHeader, which calls http.Header.Del
#9: internal/pkg/rest/framework/framework.go:220:29: framework.ParseToken calls http.Header.Get
#10: internal/adapter/controller/http/attachmentHandler.go:103:16: http.AttachmentHandler.Get calls http.Header.Set
#11: internal/adapter/controller/http/chat.go:184:30: http.ChatHandler.SendMessage calls http.Header.Values
#12: cmd/benchmark/main.go:76:27: benchmark.client.setup calls http.NewRequest
#13: internal/pkg/openbao/client.go:39:40: openbao.client.call calls http.NewRequestWithContext
#14: internal/pkg/telemetry/telemetry.go:93:112: telemetry.Init calls metric.NewPeriodicReader, which eventually calls http.ParseTime
#15: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.ReadRequest
#16: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close, which eventually calls http.ReadResponse
#17: internal/adapter/controller/http/auth.go:38:39: http.AuthHandler.Login calls http.Request.BasicAuth
#18: internal/pkg/auth/jwtprovider/manager.go:111:20: jwtprovider.manager.RefreshToken calls http.Request.Cookie
#19: cmd/benchmark/main.go:77:18: benchmark.client.setup calls http.Request.SetBasicAuth
#20: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close, which eventually calls http.Request.Write
#21: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.Response.Write
#22: internal/adapter/controller/http/controller.go:89:21: http.server.Stop calls http.Server.Close
#23: cmd/app/main.go:156:44: app.run calls http.Server.ListenAndServe
#24: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve
#25: internal/adapter/controller/http/controller.go:87:29: http.server.Stop calls http.Server.Shutdown
#26: internal/pkg/auth/jwtprovider/manager.go:87:17: jwtprovider.manager.Clear calls http.SetCookie
#27: internal/pkg/telemetry/telemetry.go:84:28: telemetry.Init calls otlptracehttp.New, which eventually calls http.Transport.Clone
#28: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.Transport.CloseIdleConnections
#29: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.Transport.RoundTrip
#30: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.body.Close
#31: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.body.Read
#32: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.bodyEOFSignal.Close
#33: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.bodyEOFSignal.Read
#34: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.bodyLocked.Read
#35: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.bufioFlushWriter.Write
#36: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.cancelTimerBody.Close
#37: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.cancelTimerBody.Read
#38: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close, which eventually calls http.checkConnErrorWriter.Write
#39: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close, which eventually calls http.chunkWriter.Write
#40: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.connReader.Read
#41: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.expectContinueReader.Close
#42: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.expectContinueReader.Read
#43: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.gzipReader.Close
#44: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.gzipReader.Read
#45: internal/pkg/encrypting/argon2id.go:70:23: encrypting.encryptor.EncryptSecretUsingArgon2id calls rand.Read, which eventually calls http.loggingConn.Read
#46: internal/pkg/apperr/error.go:79:21: apperr.AppError.Error calls time.parseErrors.Error, which eventually calls http.loggingConn.Write
#47: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.maxBytesReader.Close
#48: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.maxBytesReader.Read
#49: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close, which eventually calls http.onceCloseListener.Close
#50: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.persistConn.Read
#51: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.persistConnWriter.ReadFrom
#52: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close, which eventually calls http.persistConnWriter.Write
#53: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http.readTrackingBody.Close
#54: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.readTrackingBody.Read
#55: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.readWriteCloserBody.Read
#56: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http.response.ReadFrom
#57: cmd/benchmark/main.go:234:15: benchmark.main calls fmt.Fprintln, which calls http.response.Write
#58: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader
#59: internal/pkg/ratelimit/redis.go:14:29: ratelimit.init calls redis.NewScript, which eventually calls http.response.WriteString
#60: internal/pkg/apperr/error.go:79:21: apperr.AppError.Error calls http.transportReadFromServerError.Error
Vulnerability #6: GO-2026-6612
Double flow control refund on HTTP/2 server streams in net/http
More info: https://pkg.go.dev/vuln/GO-2026-6612
Standard library
Found in: net/http/internal/http2@go1.27
Fixed in: net/http/internal/http2@go1.27.2
Example traces found:
#1: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve, which eventually calls http2.Server.ServeConn
#2: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve, which eventually calls http2.Server.ServeConn
#3: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close
#4: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close
#5: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.requestBody.Read
#6: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.requestBody.Read
Vulnerability #7: GO-2026-6611
Excessive CPU consumption from repeated initial window changes in net/http
More info: https://pkg.go.dev/vuln/GO-2026-6611
Standard library
Found in: net/http/internal/http2@go1.27
Fixed in: net/http/internal/http2@go1.27.2
Example traces found:
#1: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.Close
#2: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.Close
#3: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.RoundTrip
#4: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.RoundTrip
#5: internal/adapter/controller/http/controller.go:87:29: http.server.Stop calls http.Server.Shutdown, which calls http2.Server.GracefulShutdown
#6: internal/adapter/controller/http/controller.go:87:29: http.server.Stop calls http.Server.Shutdown, which calls http2.Server.GracefulShutdown
#7: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve, which eventually calls http2.Server.ServeConn
#8: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve, which eventually calls http2.Server.ServeConn
#9: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.AddConn
#10: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.AddConn
#11: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http2.Transport.CloseIdleConnections
#12: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http2.Transport.CloseIdleConnections
#13: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.NewClientConn
#14: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.NewClientConn
#15: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.RoundTrip
#16: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.RoundTrip
#17: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.bufferedWriterTimeoutWriter.Write
#18: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.bufferedWriterTimeoutWriter.Write
#19: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.chunkWriter.Write
#20: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.chunkWriter.Write
#21: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.gzipReader.Close
#22: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.gzipReader.Close
#23: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.gzipReader.Read
#24: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.gzipReader.Read
#25: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close
#26: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close
#27: cmd/benchmark/main.go:234:15: benchmark.main calls fmt.Fprintln, which calls http2.responseWriter.Write
#28: cmd/benchmark/main.go:234:15: benchmark.main calls fmt.Fprintln, which calls http2.responseWriter.Write
#29: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http2.responseWriter.WriteHeader
#30: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http2.responseWriter.WriteHeader
#31: internal/pkg/ratelimit/redis.go:14:29: ratelimit.init calls redis.NewScript, which eventually calls http2.responseWriter.WriteString
#32: internal/pkg/ratelimit/redis.go:14:29: ratelimit.init calls redis.NewScript, which eventually calls http2.responseWriter.WriteString
#33: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.stickyErrWriter.Write
#34: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.stickyErrWriter.Write
#35: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close
#36: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close
#37: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.transportResponseBody.Read
#38: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.transportResponseBody.Read
Vulnerability #8: GO-2026-6610
HTTP/2 transport accepts malformed framing-related headers in net/http
More info: https://pkg.go.dev/vuln/GO-2026-6610
Standard library
Found in: net/http/internal/http2@go1.27
Fixed in: net/http/internal/http2@go1.27.2
Example traces found:
#1: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.AddConn
#2: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.AddConn
#3: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.NewClientConn
#4: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.NewClientConn
#5: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.RoundTrip
#6: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.RoundTrip
Vulnerability #9: GO-2026-6608
Memory limit bypass when parsing MIME headers in net/textproto,
mime/multipart
More info: https://pkg.go.dev/vuln/GO-2026-6608
Standard library
Found in: net/textproto@go1.27
Fixed in: net/textproto@go1.27.2
Example traces found:
#1: internal/pkg/rest/router/router.go:73:15: router.router.ServeHTTP calls chi.Mux.ServeHTTP, which eventually calls multipart.Reader.ReadForm
#2: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls textproto.Reader.ReadMIMEHeader
Vulnerability #10: GO-2026-6607
Reject malformed ECH outer extension references in crypto/tls
More info: https://pkg.go.dev/vuln/GO-2026-6607
Standard library
Found in: crypto/tls@go1.27
Fixed in: crypto/tls@go1.27.2
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig, which calls tls.Conn.Handshake
#2: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve, which eventually calls tls.Conn.HandshakeContext
#3: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls tls.Conn.Read
#4: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls tls.Conn.Write
#5: internal/pkg/cache/redis.go:27:26: cache.New calls redis.NewClient, which eventually calls tls.DialWithDialer
#6: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls tls.Dialer.DialContext
Vulnerability #11: GO-2026-6605
HTTP/1 client connection desynchronization after CONNECT rejection in
net/http
More info: https://pkg.go.dev/vuln/GO-2026-6605
Standard library
Found in: net/http@go1.27
Fixed in: net/http@go1.27.2
Example traces found:
#1: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do
#2: cmd/app/storage.go:64:24: app.runStorage calls http.Client.Get
#3: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.Transport.CloseIdleConnections
#4: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http.Transport.RoundTrip
#5: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls httputil.DumpRequestOut
Vulnerability #12: GO-2026-6603
HTTP/2 server memory exhaustion due to Trailer headers in net/http
More info: https://pkg.go.dev/vuln/GO-2026-6603
Standard library
Found in: net/http/internal/http2@go1.27
Fixed in: net/http/internal/http2@go1.27.2
Example traces found:
#1: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.Close
#2: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.Close
#3: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.RoundTrip
#4: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.NetHTTPClientConn.RoundTrip
#5: internal/adapter/controller/http/controller.go:87:29: http.server.Stop calls http.Server.Shutdown, which calls http2.Server.GracefulShutdown
#6: internal/adapter/controller/http/controller.go:87:29: http.server.Stop calls http.Server.Shutdown, which calls http2.Server.GracefulShutdown
#7: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve, which eventually calls http2.Server.ServeConn
#8: internal/adapter/controller/http/controller.go:71:27: http.Start calls http.Server.Serve, which eventually calls http2.Server.ServeConn
#9: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.AddConn
#10: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.AddConn
#11: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http2.Transport.CloseIdleConnections
#12: internal/pkg/objectstore/s3.go:66:27: objectstore.Store.Get calls s3.Client.GetObject, which eventually calls http2.Transport.CloseIdleConnections
#13: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.NewClientConn
#14: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.NewClientConn
#15: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.RoundTrip
#16: cmd/benchmark/main.go:78:22: benchmark.client.setup calls http.Client.Do, which eventually calls http2.Transport.RoundTrip
#17: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.bufferedWriterTimeoutWriter.Write
#18: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.bufferedWriterTimeoutWriter.Write
#19: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.chunkWriter.Write
#20: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.chunkWriter.Write
#21: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.gzipReader.Close
#22: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.gzipReader.Close
#23: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.gzipReader.Read
#24: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.gzipReader.Read
#25: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close
#26: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close
#27: cmd/benchmark/main.go:234:15: benchmark.main calls fmt.Fprintln, which calls http2.responseWriter.Write
#28: cmd/benchmark/main.go:234:15: benchmark.main calls fmt.Fprintln, which calls http2.responseWriter.Write
#29: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http2.responseWriter.WriteHeader
#30: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http2.responseWriter.WriteHeader
#31: internal/pkg/ratelimit/redis.go:14:29: ratelimit.init calls redis.NewScript, which eventually calls http2.responseWriter.WriteString
#32: internal/pkg/ratelimit/redis.go:14:29: ratelimit.init calls redis.NewScript, which eventually calls http2.responseWriter.WriteString
#33: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.stickyErrWriter.Write
#34: internal/pkg/rest/framework/framework.go:49:15: framework.JSONResponse calls http.response.WriteHeader, which eventually calls http2.stickyErrWriter.Write
#35: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close
#36: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.transportResponseBody.Close
#37: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.transportResponseBody.Read
#38: internal/service/attachment/reconcile.go:178:20: attachment.Service.Restore calls io.Copy, which eventually calls http2.transportResponseBody.Read
Vulnerability #13: GO-2026-6600
Recognize yield as regexp preceder keyword in html/template
More info: https://pkg.go.dev/vuln/GO-2026-6600
Standard library
Found in: html/template@go1.27
Fixed in: html/template@go1.27.2
Example traces found:
#1: internal/pkg/rest/router/router.go:73:15: router.router.ServeHTTP calls chi.Mux.ServeHTTP, which eventually calls template.Template.Execute
#2: internal/pkg/rest/router/router.go:73:15: router.router.ServeHTTP calls chi.Mux.ServeHTTP, which eventually calls template.Template.ExecuteTemplate
Vulnerability #14: GO-2026-6599
Reset context tracking on consecutive template expressions in html/template
More info: https://pkg.go.dev/vuln/GO-2026-6599
Standard library
Found in: html/template@go1.27
Fixed in: html/template@go1.27.2
Example traces found:
#1: internal/pkg/rest/router/router.go:73:15: router.router.ServeHTTP calls chi.Mux.ServeHTTP, which eventually calls template.Template.Execute
#2: internal/pkg/rest/router/router.go:73:15: router.router.ServeHTTP calls chi.Mux.ServeHTTP, which eventually calls template.Template.ExecuteTemplate
Vulnerability #15: GO-2026-6503
RabbitMQ amqp091-go: Denial of Service via Sub-Spec Frame Size Negotiation
in github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6503
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.13.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig
Vulnerability #16: GO-2026-6502
RabbitMQ amqp091-go: Consumer Message Flooding via Signed-to-Unsigned
Integer Casting in Qos Configuration in github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6502
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.13.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:120:15: broker.Rabbit.Consume calls amqp091.Channel.Qos
Vulnerability #17: GO-2026-6500
RabbitMQ amqp091-go: Resource Exhaustion (OOM) via Unbounded Body Buffer
Allocation in github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6500
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.13.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig
Vulnerability #18: GO-2026-6498
RabbitMQ amqp091-go: Silent Data Truncation and State Corruption via
Shortstr Integer Overflow in github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6498
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.13.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:190:2: broker.Rabbit.Depth calls amqp091.Channel.Close
#2: internal/pkg/broker/rabbitmq.go:86:19: broker.Rabbit.Publish calls amqp091.Channel.Confirm
#3: internal/pkg/broker/rabbitmq.go:123:29: broker.Rabbit.Consume calls amqp091.Channel.Consume
#4: internal/pkg/broker/rabbitmq.go:92:30: broker.Rabbit.Publish calls amqp091.Channel.PublishWithContext
#5: internal/pkg/broker/rabbitmq.go:120:15: broker.Rabbit.Consume calls amqp091.Channel.Qos
#6: cmd/securityprobe/main.go:154:25: securityprobe.run calls amqp091.Channel.QueueDeclare
#7: internal/pkg/broker/rabbitmq.go:191:25: broker.Rabbit.Depth calls amqp091.Channel.QueueInspect
#8: cmd/securityprobe/main.go:153:23: securityprobe.run calls amqp091.Connection.Channel
#9: internal/pkg/broker/rabbitmq.go:189:2: broker.Rabbit.Depth calls amqp091.Connection.Close
#10: internal/pkg/broker/rabbitmq.go:164:14: broker.Consume calls amqp091.Delivery.Ack
#11: internal/pkg/broker/rabbitmq.go:160:16: broker.Consume calls amqp091.Delivery.Nack
#12: internal/pkg/broker/rabbitmq.go:147:18: broker.Consume calls amqp091.Delivery.Reject
#13: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig
Vulnerability #19: GO-2026-6496
RabbitMQ amqp091-go: Protocol Desynchronization and Frame Injection via
Integer Overflow in readLongstr in github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6496
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.13.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig
Vulnerability #20: GO-2026-6494
RabbitMQ amqp091-go: Denial of Service via Malicious Field Length in AMQP
Client in github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6494
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.13.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig
Vulnerability #21: GO-2026-6492
RabbitMQ amqp091-go: Missing Explicit TLS Minimum Version Configuration In
URI Parser in github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6492
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.13.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig
Vulnerability #22: GO-2026-6491
RabbitMQ amqp091-go: Plaintext Credential Exposure via Exported PLAIN
Authentication Struct Fields in github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6491
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.13.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig
Vulnerability #23: GO-2026-6372
Potential Memory Exhaustion/Protocol Violation via Broker-Controlled
Oversized Payload in github.com/rabbitmq/amqp091-go
More info: https://pkg.go.dev/vuln/GO-2026-6372
Module: github.com/rabbitmq/amqp091-go
Found in: github.com/rabbitmq/amqp091-go@v1.10.0
Fixed in: github.com/rabbitmq/amqp091-go@v1.13.0
Example traces found:
#1: internal/pkg/broker/rabbitmq.go:190:2: broker.Rabbit.Depth calls amqp091.Channel.Close
#2: internal/pkg/broker/rabbitmq.go:86:19: broker.Rabbit.Publish calls amqp091.Channel.Confirm
#3: internal/pkg/broker/rabbitmq.go:123:29: broker.Rabbit.Consume calls amqp091.Channel.Consume
#4: cmd/securityprobe/main.go:161:29: securityprobe.run calls amqp091.Channel.IsClosed
#5: internal/pkg/broker/rabbitmq.go:89:30: broker.Rabbit.Publish calls amqp091.Channel.NotifyPublish
#6: internal/pkg/broker/rabbitmq.go:90:28: broker.Rabbit.Publish calls amqp091.Channel.NotifyReturn
#7: internal/pkg/broker/rabbitmq.go:92:30: broker.Rabbit.Publish calls amqp091.Channel.PublishWithContext
#8: internal/pkg/broker/rabbitmq.go:120:15: broker.Rabbit.Consume calls amqp091.Channel.Qos
#9: cmd/securityprobe/main.go:154:25: securityprobe.run calls amqp091.Channel.QueueDeclare
#10: internal/pkg/broker/rabbitmq.go:191:25: broker.Rabbit.Depth calls amqp091.Channel.QueueInspect
#11: cmd/securityprobe/main.go:153:23: securityprobe.run calls amqp091.Connection.Channel
#12: internal/pkg/broker/rabbitmq.go:189:2: broker.Rabbit.Depth calls amqp091.Connection.Close
#13: internal/pkg/broker/rabbitmq.go:30:26: broker.Rabbit.connect calls amqp091.DefaultDial
#14: internal/pkg/broker/rabbitmq.go:164:14: broker.Consume calls amqp091.Delivery.Ack
#15: internal/pkg/broker/rabbitmq.go:160:16: broker.Consume calls amqp091.Delivery.Nack
#16: internal/pkg/broker/rabbitmq.go:147:18: broker.Consume calls amqp091.Delivery.Reject
#17: internal/pkg/broker/rabbitmq.go:56:28: broker.Rabbit.connect calls amqp091.DialConfig
#18: internal/pkg/apperr/error.go:79:21: apperr.AppError.Error calls amqp091.Error.Error
#19: internal/pkg/broker/rabbitmq.go:14:2: broker.init calls amqp091.init
#20: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close, which eventually calls amqp091.shutdown
#21: internal/service/attachment/reconcile.go:203:2: attachment.Service.Restore calls http2.requestBody.Close, which eventually calls amqp091.shutdown
Your code is affected by 23 vulnerabilities from 1 module and the Go standard library.
This scan also found 3 vulnerabilities in packages you import and 3
vulnerabilities in modules you require, but your code doesn't appear to call
these vulnerabilities.
Use '-show verbose' for more details.
+1
View File
@@ -0,0 +1 @@
No vulnerabilities found.
+9
View File
@@ -0,0 +1,9 @@
{
"running_container_image": "sha256:50791f115882c3476e7a9ee5b113a60c4ff5c4b2e8f5a7d8820f18695c4f02d2",
"tag_after_independent_build": "sha256:c207d41316af63e9dd59e8f6794c59664ea2257c120c12f4663699a6015f941f",
"binary_sha256_identical": true,
"binaries": [
"c8147e057feae2b500866e4f9de7b9e585d8d42a153c26215ecb59893c837dd2 /usr/local/bin/messenger",
"8dda90c95a12292a85a52464ba46c6a826c14eff80369874b0ed62e778fbf785 /usr/local/bin/securityprobe"
]
}
+21
View File
@@ -0,0 +1,21 @@
{
"scanner": "aquasec/trivy:0.67.2",
"image_id": "sha256:c207d41316af63e9dd59e8f6794c59664ea2257c120c12f4663699a6015f941f",
"results": [
{
"target": "/scan/image.tar (alpine 3.23.6)",
"counts": {},
"findings": []
},
{
"target": "usr/local/bin/messenger",
"counts": {},
"findings": []
},
{
"target": "usr/local/bin/securityprobe",
"counts": {},
"findings": []
}
]
}
+1
View File
@@ -0,0 +1 @@
PASS: image geometry, EXIF, alpha, real formats, checksums, ACL and negative inputs
+53
View File
@@ -0,0 +1,53 @@
{
"results": [
{
"case": "small",
"result": "PASS",
"thumbnail": [
16,
8
]
},
{
"case": "floor",
"result": "PASS",
"thumbnail": [
256,
76
]
},
{
"case": "alpha",
"result": "PASS",
"thumbnail": [
40,
20
]
},
{
"case": "orientation",
"result": "PASS",
"thumbnail": [
128,
256
]
},
{
"case": "thin",
"result": "PASS",
"thumbnail": [
1,
256
]
},
{
"case": "center_crop",
"result": "PASS",
"thumbnail": [
256,
85
]
}
],
"negative_cases": 4
}
+6
View File
@@ -0,0 +1,6 @@
{
"image_unchanged": true,
"old_leaf_rejected": true,
"new_leaf_accepted": true,
"verified_https_ready": true
}
+4
View File
@@ -0,0 +1,4 @@
Local lab7 CA, identities and synthetic secrets prepared. No credentials printed.
Leaf replaced and old serial revoked without rebuilding the image: lb
PASS: verified HTTPS readiness
PASS: leaf rotation without image rebuild and old-serial revocation
+3
View File
@@ -0,0 +1,3 @@
python3 tests/resilience.py --mode persistence --action-script "scripts/restart.sh" --base-url "https://localhost:8443" --ca-file "/Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab7/secrets/lab7/lb/ca.crt"
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
+4
View File
@@ -0,0 +1,4 @@
python3 tests/smoke.py --base-url "https://localhost:8443" --ca-file "/Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab7/secrets/lab7/lb/ca.crt"
PASS: lab7 public API scenario; infrastructure and grading evidence remain separate.
python3 tests/security.py --base-url "https://localhost:8443" --ca-file "/Users/a7tech173/development/gitea.privcloud.tech/mtusi2026/mtusi2026lab7/secrets/lab7/lb/ca.crt"
PASS: trusted HTTPS works; untrusted CA rejected. This does NOT verify internal mTLS, OpenBao or hardening.
+313
View File
@@ -0,0 +1,313 @@
{
"before": {
"/mtusi2026lab7-api-1": {
"id": "d6fda7f70c3273d02dc57c920ab696da50e151e22af44ed8a285ea6913902da1",
"started_at": "2026-11-17T14:04:13.474204128Z",
"volumes": []
},
"/mtusi2026lab7-api-2": {
"id": "54a760b9c39b7f9b65c217df4b5ea83a4350a578579cd001de82a50604c648d4",
"started_at": "2026-11-17T14:04:13.475004044Z",
"volumes": []
},
"/mtusi2026lab7-broker-1": {
"id": "be47e533bc90852ec009a15c8f2e9d8bfaed3dfeaa73e80e8a03191e2e3370c1",
"started_at": "2026-11-17T14:09:15.50756267Z",
"volumes": [
{
"name": "mtusi2026lab7_broker_data",
"destination": "/var/lib/rabbitmq"
}
]
},
"/mtusi2026lab7-dispatcher-1": {
"id": "dc137b22d3e6c75277f348537103a5cef6b8099cca45f2a2f2c11115fae202df",
"started_at": "2026-11-17T14:09:28.751998385Z",
"volumes": []
},
"/mtusi2026lab7-grafana-1": {
"id": "adeb6ec904706c78545c39ed621c7484b74a1b277a02d6f88e989b5100a66262",
"started_at": "2026-11-17T10:51:01.37820772Z",
"volumes": [
{
"name": "mtusi2026lab7_grafana_data",
"destination": "/var/lib/grafana"
}
]
},
"/mtusi2026lab7-lb-1": {
"id": "bcdeea3ec62786e76b0226e58fd1184fe120855a02732090f0b05771a352a7d6",
"started_at": "2026-11-17T14:03:42.774457377Z",
"volumes": []
},
"/mtusi2026lab7-loki-1": {
"id": "e4e27b3ae65375241ad7f192aa0f82759e7929702cf9cff8082c3560d0366252",
"started_at": "2026-11-17T14:06:30.454375136Z",
"volumes": [
{
"name": "mtusi2026lab7_loki_data",
"destination": "/loki"
}
]
},
"/mtusi2026lab7-loki-tls-1": {
"id": "3fdda65b7eb7c05f278e2ae68428189d707957e7bdf8b62271c51682c9292c4e",
"started_at": "2026-11-17T14:06:31.257750678Z",
"volumes": []
},
"/mtusi2026lab7-openbao-1": {
"id": "56dc536779db92bf8a1841c4b7e235a028c85a1a3b98f6227c28e2d8d847f6a7",
"started_at": "2026-11-17T10:51:01.376433887Z",
"volumes": [
{
"name": "1d1ea9e4a43d16c79452b101c377c8b20382d0b104219dd18ed19518510c7236",
"destination": "/openbao/file"
},
{
"name": "a4fdd6b41d15d5198e1577cb10314d870ef1e3898b26c4dfe0912278760ed48b",
"destination": "/openbao/logs"
},
{
"name": "mtusi2026lab7_bao_data",
"destination": "/openbao/data"
}
]
},
"/mtusi2026lab7-otel-collector-1": {
"id": "29e8dc4c7eec171bcd572b91d52653fb10dd398f0693ec3903a14c02371cb88f",
"started_at": "2026-11-17T10:51:01.29778072Z",
"volumes": []
},
"/mtusi2026lab7-otel-collector-tls-1": {
"id": "915b6ea1291e3d8f2e7cda13f3d92eb99fb6222b199f40650673e8d0134cb2c9",
"started_at": "2026-11-17T10:51:02.868115263Z",
"volumes": []
},
"/mtusi2026lab7-postgres-1": {
"id": "ef7ea1912bec58bd1f62c767c4321e5ef98180a479ef9d0d5bd7288517ddcc3a",
"started_at": "2026-11-17T10:33:32.361978804Z",
"volumes": [
{
"name": "mtusi2026lab7_postgres_data",
"destination": "/var/lib/postgresql/data"
}
]
},
"/mtusi2026lab7-prometheus-1": {
"id": "26d14907a8d04095b62ae9b92073e9743526ad3d94e7fe58b89d2480b0a6baa8",
"started_at": "2026-11-17T10:51:01.373130512Z",
"volumes": [
{
"name": "mtusi2026lab7_prometheus_data",
"destination": "/prometheus"
}
]
},
"/mtusi2026lab7-prometheus-tls-1": {
"id": "9a71876af1662d245be27ac72ca89cdf1d1fe87604cff6bc9364edd30497939f",
"started_at": "2026-11-17T10:51:02.816800138Z",
"volumes": []
},
"/mtusi2026lab7-redis-1": {
"id": "e5835ee95c53224aed3870c331c7af04d11b209944a12a8694524b20b72acca5",
"started_at": "2026-11-17T10:33:32.355671846Z",
"volumes": [
{
"name": "mtusi2026lab7_redis_data",
"destination": "/data"
}
]
},
"/mtusi2026lab7-s3-1": {
"id": "79232cd23eb7cb0d401caffc771bdddf9d26925e069682c6fd89ec434b97b146",
"started_at": "2026-11-17T13:58:48.96820938Z",
"volumes": [
{
"name": "mtusi2026lab7_s3_data",
"destination": "/data"
}
]
},
"/mtusi2026lab7-s3-tls-1": {
"id": "72b8d5056992bcb5537c05c79a892d6a251e31952309b27b216e88c34d68a1c8",
"started_at": "2026-11-17T13:58:49.722560547Z",
"volumes": []
},
"/mtusi2026lab7-tempo-1": {
"id": "debd0f0fd4f810ed8edc27351a8d9c6926e8c2e036ed622e8eab21d7bdca0cfd",
"started_at": "2026-11-17T14:06:28.474408426Z",
"volumes": [
{
"name": "mtusi2026lab7_tempo_data",
"destination": "/var/tempo"
}
]
},
"/mtusi2026lab7-tempo-tls-1": {
"id": "cef5ce161fb4a5cae103c48bfbe47c1956a56c97362e5fe265eab0a521810da5",
"started_at": "2026-11-17T14:06:31.279364886Z",
"volumes": []
},
"/mtusi2026lab7-worker-1": {
"id": "a8027a54c01fff295bda985e12c10570612becc90b7120f45a49ce7b5f766839",
"started_at": "2026-11-17T14:09:27.92889876Z",
"volumes": []
}
},
"after": {
"/mtusi2026lab7-api-1": {
"id": "d6fda7f70c3273d02dc57c920ab696da50e151e22af44ed8a285ea6913902da1",
"started_at": "2026-11-17T14:09:37.9784245Z",
"volumes": []
},
"/mtusi2026lab7-api-2": {
"id": "54a760b9c39b7f9b65c217df4b5ea83a4350a578579cd001de82a50604c648d4",
"started_at": "2026-11-17T14:09:38.034661625Z",
"volumes": []
},
"/mtusi2026lab7-broker-1": {
"id": "be47e533bc90852ec009a15c8f2e9d8bfaed3dfeaa73e80e8a03191e2e3370c1",
"started_at": "2026-11-17T14:09:35.819957347Z",
"volumes": [
{
"name": "mtusi2026lab7_broker_data",
"destination": "/var/lib/rabbitmq"
}
]
},
"/mtusi2026lab7-dispatcher-1": {
"id": "dc137b22d3e6c75277f348537103a5cef6b8099cca45f2a2f2c11115fae202df",
"started_at": "2026-11-17T14:09:38.093570667Z",
"volumes": []
},
"/mtusi2026lab7-grafana-1": {
"id": "adeb6ec904706c78545c39ed621c7484b74a1b277a02d6f88e989b5100a66262",
"started_at": "2026-11-17T14:09:32.193343262Z",
"volumes": [
{
"name": "mtusi2026lab7_grafana_data",
"destination": "/var/lib/grafana"
}
]
},
"/mtusi2026lab7-lb-1": {
"id": "bcdeea3ec62786e76b0226e58fd1184fe120855a02732090f0b05771a352a7d6",
"started_at": "2026-11-17T14:09:38.225323208Z",
"volumes": []
},
"/mtusi2026lab7-loki-1": {
"id": "e4e27b3ae65375241ad7f192aa0f82759e7929702cf9cff8082c3560d0366252",
"started_at": "2026-11-17T14:09:31.680025386Z",
"volumes": [
{
"name": "mtusi2026lab7_loki_data",
"destination": "/loki"
}
]
},
"/mtusi2026lab7-loki-tls-1": {
"id": "9d289263bdf85dd8527aa2f2e5f712e288224d43cf263f933dc5b4b0ea7767c5",
"started_at": "2026-11-17T14:09:37.32076875Z",
"volumes": []
},
"/mtusi2026lab7-openbao-1": {
"id": "56dc536779db92bf8a1841c4b7e235a028c85a1a3b98f6227c28e2d8d847f6a7",
"started_at": "2026-11-17T14:09:31.746126136Z",
"volumes": [
{
"name": "mtusi2026lab7_bao_data",
"destination": "/openbao/data"
},
{
"name": "1d1ea9e4a43d16c79452b101c377c8b20382d0b104219dd18ed19518510c7236",
"destination": "/openbao/file"
},
{
"name": "a4fdd6b41d15d5198e1577cb10314d870ef1e3898b26c4dfe0912278760ed48b",
"destination": "/openbao/logs"
}
]
},
"/mtusi2026lab7-otel-collector-1": {
"id": "29e8dc4c7eec171bcd572b91d52653fb10dd398f0693ec3903a14c02371cb88f",
"started_at": "2026-11-17T14:09:31.295292678Z",
"volumes": []
},
"/mtusi2026lab7-otel-collector-tls-1": {
"id": "c47eae066f34b75500db188715818ce55b3e89c2bca4fc25e83bba3a6f0aa79c",
"started_at": "2026-11-17T14:09:37.33655425Z",
"volumes": []
},
"/mtusi2026lab7-postgres-1": {
"id": "ef7ea1912bec58bd1f62c767c4321e5ef98180a479ef9d0d5bd7288517ddcc3a",
"started_at": "2026-11-17T14:09:31.375696886Z",
"volumes": [
{
"name": "mtusi2026lab7_postgres_data",
"destination": "/var/lib/postgresql/data"
}
]
},
"/mtusi2026lab7-prometheus-1": {
"id": "26d14907a8d04095b62ae9b92073e9743526ad3d94e7fe58b89d2480b0a6baa8",
"started_at": "2026-11-17T14:09:31.215812844Z",
"volumes": [
{
"name": "mtusi2026lab7_prometheus_data",
"destination": "/prometheus"
}
]
},
"/mtusi2026lab7-prometheus-tls-1": {
"id": "6ce0529bded56716bb6f3df214263b6cc6bf62bdf0defeba7e1f31d5b798e261",
"started_at": "2026-11-17T14:09:37.25840775Z",
"volumes": []
},
"/mtusi2026lab7-redis-1": {
"id": "e5835ee95c53224aed3870c331c7af04d11b209944a12a8694524b20b72acca5",
"started_at": "2026-11-17T14:09:31.388634636Z",
"volumes": [
{
"name": "mtusi2026lab7_redis_data",
"destination": "/data"
}
]
},
"/mtusi2026lab7-s3-1": {
"id": "79232cd23eb7cb0d401caffc771bdddf9d26925e069682c6fd89ec434b97b146",
"started_at": "2026-11-17T14:09:34.173379429Z",
"volumes": [
{
"name": "mtusi2026lab7_s3_data",
"destination": "/data"
}
]
},
"/mtusi2026lab7-s3-tls-1": {
"id": "e69293ccadc868d3d2b6d63e55d7b4a9d15df9b08b95688cd809802deb703335",
"started_at": "2026-11-17T14:09:37.325704166Z",
"volumes": []
},
"/mtusi2026lab7-tempo-1": {
"id": "debd0f0fd4f810ed8edc27351a8d9c6926e8c2e036ed622e8eab21d7bdca0cfd",
"started_at": "2026-11-17T14:09:31.447828553Z",
"volumes": [
{
"name": "mtusi2026lab7_tempo_data",
"destination": "/var/tempo"
}
]
},
"/mtusi2026lab7-tempo-tls-1": {
"id": "08cf52574facd688fb2497bdd32dcc3cb55c83b9814ea215e0f3a2cd50170b5a",
"started_at": "2026-11-17T14:09:37.338702Z",
"volumes": []
},
"/mtusi2026lab7-worker-1": {
"id": "a8027a54c01fff295bda985e12c10570612becc90b7120f45a49ce7b5f766839",
"started_at": "2026-11-17T14:09:37.89173875Z",
"volumes": []
}
},
"all_stores_restarted": true
}
+1
View File
@@ -0,0 +1 @@
PASS: sealed OpenBao produces bounded fail-closed and recovers after operator unseal
+6
View File
@@ -0,0 +1,6 @@
{
"short_token_ttl_seconds": 30,
"fail_closed_seconds": 28.5457634171471,
"recovered_after_operator_unseal": true,
"plaintext_fallback": false
}
+8
View File
@@ -0,0 +1,8 @@
{
"versionable_files_checked": 285,
"generated_secrets_checked": 42,
"matches": 0,
"private_material_ignored": true,
"build_context_excludes_secrets": true,
"initial_root_token_removed": true
}
+50
View File
@@ -0,0 +1,50 @@
PASS: API replica 1 accepts LB
PASS: API replica 1 rejects no certificate
PASS: API replica 1 rejects same CA wrong identity
PASS: API replica 1 rejects foreign CA
PASS: API replica 2 accepts LB
PASS: API replica 2 rejects no certificate
PASS: API replica 2 rejects same CA wrong identity
PASS: API replica 2 rejects foreign CA
PASS: API server hostname checked
PASS: DB TLS verify-full
PASS: DB rejects wrong hostname
PASS: DB rejects untrusted server CA
PASS: Collector accepts api
PASS: Collector accepts worker
PASS: Collector accepts dispatcher
PASS: Collector denies stranger
PASS: Collector denies foreign
PASS: Collector denies worker no-cert
PASS: Broker denies stranger
PASS: Broker denies foreign
PASS: Broker denies worker no-cert
PASS: S3 denies unauthenticated identity stranger
PASS: S3 denies unauthenticated identity foreign
PASS: S3 denies unauthenticated identity worker
PASS: Worker least privilege db
PASS: Worker least privilege s3
PASS: Worker least privilege amqp
PASS: Redis scoped ACL
PASS: Matrix allowed https://otel-collector:9444/metrics
PASS: Matrix rejects unknown identity https://otel-collector:9444/metrics
PASS: Matrix allowed https://otel-collector:9445/metrics
PASS: Matrix rejects unknown identity https://otel-collector:9445/metrics
PASS: Matrix allowed https://prometheus:9443/api/v1/query?query=up
PASS: Matrix rejects unknown identity https://prometheus:9443/api/v1/query?query=up
PASS: Matrix allowed https://loki:9443/ready
PASS: Matrix rejects unknown identity https://loki:9443/ready
PASS: Matrix allowed https://tempo:9443/ready
PASS: Matrix rejects unknown identity https://tempo:9443/ready
PASS: Matrix allowed https://loki:9443/otlp/v1/logs
PASS: Matrix rejects unknown identity https://loki:9443/otlp/v1/logs
PASS: Matrix allowed https://tempo:9444/v1/traces
PASS: Matrix rejects unknown identity https://tempo:9444/v1/traces
PASS: Grafana cannot ingest Loki logs
PASS: Grafana cannot use Tempo ingest
PASS: Collector cannot query Loki
PASS: OpenBao worker policy allow/deny
PASS: Shared login rate limit returns 429 Retry-After
PASS: JSON body limit
PASS: Logout revocation
PASS: Plaintext backend bypasses unreachable
+443
View File
@@ -0,0 +1,443 @@
{
"timestamp": "2026-11-17T14:18:27Z",
"results": [
{
"scenario": "API replica 1 accepts LB",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "API replica 1 rejects no certificate",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "API replica 1 rejects same CA wrong identity",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "API replica 1 rejects foreign CA",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "API replica 2 accepts LB",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "API replica 2 rejects no certificate",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "API replica 2 rejects same CA wrong identity",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "API replica 2 rejects foreign CA",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "API server hostname checked",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "DB TLS verify-full",
"passed": true,
"details": {
"matched": true,
"mode": "db-tls"
}
},
{
"scenario": "DB rejects wrong hostname",
"passed": true,
"details": {
"matched": true,
"mode": "db-tls"
}
},
{
"scenario": "DB rejects untrusted server CA",
"passed": true,
"details": {
"matched": true,
"mode": "db-tls"
}
},
{
"scenario": "Collector accepts api",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Collector accepts worker",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Collector accepts dispatcher",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Collector denies stranger",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Collector denies foreign",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Collector denies worker no-cert",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Broker denies stranger",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "amqp-tls"
}
},
{
"scenario": "Broker denies foreign",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "amqp-tls"
}
},
{
"scenario": "Broker denies worker no-cert",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "amqp-tls"
}
},
{
"scenario": "S3 denies unauthenticated identity stranger",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "S3 denies unauthenticated identity foreign",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "S3 denies unauthenticated identity worker",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Worker least privilege db",
"passed": true,
"details": {
"ddl_denied": true,
"jobs_read": true,
"messages_read_denied": true,
"mode": "db",
"password_read_denied": true,
"role": "worker",
"session_read_denied": true
}
},
{
"scenario": "Worker least privilege s3",
"passed": true,
"details": {
"forbidden/security-denied": true,
"mode": "s3",
"originals/security-denied": true,
"results_read": true,
"results_write": true,
"role": "worker"
}
},
{
"scenario": "Worker least privilege amqp",
"passed": true,
"details": {
"configure_profile": true,
"mode": "amqp",
"publish_profile": true,
"queue_read": true,
"role": "worker"
}
},
{
"scenario": "Redis scoped ACL",
"passed": true,
"details": {
"config_denied": true,
"foreign_key_denied": true,
"mode": "redis",
"ping": true,
"role": "api"
}
},
{
"scenario": "Matrix allowed https://otel-collector:9444/metrics",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix rejects unknown identity https://otel-collector:9444/metrics",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix allowed https://otel-collector:9445/metrics",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix rejects unknown identity https://otel-collector:9445/metrics",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix allowed https://prometheus:9443/api/v1/query?query=up",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix rejects unknown identity https://prometheus:9443/api/v1/query?query=up",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix allowed https://loki:9443/ready",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix rejects unknown identity https://loki:9443/ready",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix allowed https://tempo:9443/ready",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix rejects unknown identity https://tempo:9443/ready",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix allowed https://loki:9443/otlp/v1/logs",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix rejects unknown identity https://loki:9443/otlp/v1/logs",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix allowed https://tempo:9444/v1/traces",
"passed": true,
"details": {
"expect": "allow",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Matrix rejects unknown identity https://tempo:9444/v1/traces",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Grafana cannot ingest Loki logs",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Grafana cannot use Tempo ingest",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "Collector cannot query Loki",
"passed": true,
"details": {
"expect": "deny",
"matched": true,
"mode": "tls"
}
},
{
"scenario": "OpenBao worker policy allow/deny",
"passed": true,
"details": true
},
{
"scenario": "Shared login rate limit returns 429 Retry-After",
"passed": true,
"details": true
},
{
"scenario": "JSON body limit",
"passed": true,
"details": true
},
{
"scenario": "Logout revocation",
"passed": true,
"details": true
},
{
"scenario": "Plaintext backend bypasses unreachable",
"passed": true,
"details": true
}
]
}
+242
View File
@@ -0,0 +1,242 @@
{
".dockerignore": "b97272d9afabe60343197865f06df5797e324ecbac6f9abc896680adc63efef8",
".env.example": "2b82450b1a8fb4e8ae8b2665bc66060e83780985d5d54b235b9c22773a22638f",
".github/pull_request_template.md": "43cf3184751513eac7fb36e17e42ba9c2f897b8b8bd1f98910d4622b513121d1",
".github/workflows/application.yml": "3fd928cbda2e51bc82129cde79da7cd686ab50e0e0099a78a42da62292d7befd",
".github/workflows/contracts.yml": "a45d7932ef14130aff8020bce79f043cccaf9692d697088a754d309a03f7d3e8",
".gitignore": "a8e1b288a5369fd02317c7fc6e67858c7341ebc62c665092a501e590bbc38136",
"CONTRIBUTING.md": "2c01dd698cc9653dece49a94c9fd3f58d36e84764aaa643b46e26d7e599dc12e",
"COURSE.md": "c34d53cd082d194aa4b58f504c4e0348d25b6afec3d6a9c0963dd01c9c81e971",
"Dockerfile": "52309424c0eb41f904e1e45e6b848add12c8a2e1414b31718f4efc133c71cfcf",
"Dockerfile.example": "fd7ac9491c0c3c663b083c41a762fb38bc2d212fa4a2ed3e6a0702af72108709",
"MAINTAINERS.md": "6e10c41ab1f287d3ef93cdeadbb22d49651a53e8b9d2578b279abed3931b20d1",
"Makefile": "b4bb788f68af4f12ed3b360bcd8a6e02b9c2c995e5679b9099dae10621a0943b",
"README.md": "7fd1e422bb069bb00351dfb7ebca14c3b112b1872f106f81c61a621c5ac35a39",
"REPORT.md": "6143098476828fec2c315a8110c65d2b59a86f700a7b1e1c0725f825d825d2a5",
"compose.example.yaml": "abcd9e7cfb57d3854a8362550cf36a0030cd417eac2a342abb5cb6c72c0e1896",
"compose.faults.yaml": "3a045ad5532c8f7e5ddb10e15562f83c69e884d2e5a8418de4571ede31356278",
"compose.yaml": "7294aba715e2f4b130e3cf14c84aab3babf590ce05fa1d50cf4b6d633c2635fa",
"contracts/README.md": "72df27a559f88ffa3fd8c3c79d3c32f6db2c5986a0602677c51994c434a3fc4f",
"contracts/attachment-states.md": "cf0519e137410e4b34ab632aadb8ad8a381d4b73033e27b354c58eeacbdf86d6",
"contracts/examples.json": "381cc18c03789e935b391d007fb5843964be9cfd9f7530cb6b1996ed4a1c4c37",
"contracts/infrastructure.json": "90b706e85ee2fcaa54e1113e98206555e0cd678caf03204c9ac363a6f1323d30",
"contracts/jobs.schema.json": "9ccf9b11466c0c3a26a941520ac5ff543241fc4935e3a6eebb01ef303779b10d",
"contracts/observability.md": "882c120c0e153a06c9cc824a802e317c58eb6590bc3d3a576f2e0a96f8597b62",
"contracts/openapi.json": "51dd0b8199aee7be81437056144c5fca9d82c2b4387dae62585cadf230ee749a",
"contracts/trust-matrix.md": "3402b5ff28d1fa559d1b960423fb264a0552a74da0725f63eeaf94a9295f7d80",
"examples/requests.http": "e69880f740f1e346354b519f14487d2bfcf1a41cbaa8cbedc61d258e7592fd3a",
"infra/README.md": "436e16ec36e58ff53fa10c3e3d0e40cc0133d909e417ca35cf88a27cd2e5f6a5",
"infra/envoy/loki.json": "f4995cbd4bb5f192c771d7e85ef76b60cd54a16a3e7755c18abf672db04216bc",
"infra/envoy/otel-collector.json": "e294440309c7a46f6e721dbaed411525f9542f553e0e4bf21414d791b4fb3a1e",
"infra/envoy/prometheus.json": "9a5ec99fc64672271967e1c886d0fd9ca4a780dfe0a69e22acd8430f711a44f2",
"infra/envoy/s3.json": "5b1eddd549bb193ec2e6c3c020b78efd4d52075af75fc95ccd1fe86c500a259c",
"infra/envoy/tempo.json": "2c0761b93c1132460e2592daf416fb7e6803af324a49134b02a5bf827be99558",
"infra/generate.py": "43d10607e754a0ec8d816d857f74606765cc9ec865dac650be5445cd6c482aec",
"infra/haproxy.cfg": "759ab33fcaedf0fe1ea7119bf583b5286c25aed22f846654326828e0cad81be3",
"infra/imagemagick-policy.xml": "c362e5c794f9e700e429a39f734371fcbc79aef529f8a59384f602d36fdd37c8",
"infra/openbao/README.md": "394889bdd5fc06069d362eddea88bdf177bac898f30d7625adc9ddabffe0f21a",
"infra/openbao/api.hcl": "7c5fc792543ebe72c98aa45a337ed6ec9808783f6cc398a3bdd78ba1a3a14da3",
"infra/openbao/dispatcher.hcl": "a4af4534de533bdd3c10e0b8169d01aae42e264ae5f38582565bf86ef518f981",
"infra/openbao/server.hcl": "89de14644ba8579324e532a0fb9822c1f87d88604512063c721bc686932b699c",
"infra/openbao/worker.hcl": "72418eb4c7c2e779745115b4adf5c078bcf76c542e9fcd239a5c9c228d2ab43f",
"infra/otel/README.md": "7c9a128d7e025b11c76687343d237706a5d9ae90a9eff0e4d1d859bebe3602e0",
"infra/otel/RUNBOOK.md": "18d9ef9d55629aea30baca379ad5496f809ba641ad5e8cf9a9abaf9414973628",
"infra/otel/alerts.yaml": "f737f1188a2a52247003bf62a434a020e0b5e5d51705f7f8ca1c2c99a41372fd",
"infra/otel/collector.yaml": "0fb3eed23283bd317a28046f7327c0baf962e74fd6a949f52c696a3df8045fcc",
"infra/otel/dashboards/messenger.json": "886e31505dd2a4fd0c4b12c4e2889b848855605afe6c87daabe72a3f951bc25f",
"infra/otel/grafana/dashboards/default.yaml": "6d9f3f36f8fb66d875642da4aad154ce1cbddbb47c728c15e491cbbba94ea562",
"infra/otel/loki.yaml": "e187d31180b8239ba5a330e97452dc82f42b1352a2a6a475acf7ec170c36d56d",
"infra/otel/prometheus.yaml": "18d0020cdadfa931ed3808509af7f79cef203f54a012fbd0cb43e175f4df2309",
"infra/otel/tempo.yaml": "c38f3bbab532e919ad0f2eb6373efac05bd79c0c77b692932e2e0d059dc60958",
"infra/postgres/grants.sql": "a4470970f9decf757c36327eafc673f1bc81fab95d815ab717e62c8764144e67",
"infra/postgres/pg_hba.conf": "5e189df0d2143d5a4c18d21c6d6d1aabfb5cbc4903adee3c80945099b5f04f70",
"infra/rabbitmq/definitions.json": "b1dd7b5c1cc196ecc833b696fbd80671841c02789182888adbe71fc8150a85ea",
"infra/rabbitmq/enabled_plugins": "2bed3e041f079e6daef14bf6dea9d9e3e12465922f2d1ca6eeaf973c4fa0c211",
"infra/rabbitmq/rabbitmq.conf": "53f78364aa921977af08a7cb9e8d445342420e4d8ea61ecfbd71ceb814777f46",
"lab.json": "f4cc620370d5c84be3d7a4422c48c05398cb28aa89185d4141b534b58e4b51c4",
"requirements-dev.txt": "4cefdb67007caf026d1613be7c519c01b4c8343db7c4f4b618677e01cf113525",
"scripts/audit-secrets.py": "d2cb73887d06b5866268dee9f4045b2a25bfdf80c3a06b2f4201a339730f4925",
"scripts/bao.py": "1d2b18456a6184e00c1ede2ddf701a9a0836f9232aedbcc0081d98547a6ef332",
"scripts/bootstrap.py": "47ba4cfda9b420974526c211f49c5b720c4b44c8a081235d4f9e673d2cebe040",
"scripts/build-image.py": "565f13519fd8852ccd2795d24ed8dd20e112ac7c0c687e2f278ae1619650f16e",
"scripts/capture-environment.py": "d49094d291cfbb380835e2a3255d1c9f86c4670adefd28a40cebab8eed6fb68a",
"scripts/check_contract.py": "7c4402c2a6ab80d3b4676e1866d6ecc87b6daea14c080bcb9be9a7e8b959d671",
"scripts/compose.sh": "7f4abd7f232ab7096482d4f25d410229b707d2a98e666393b23c68e4b3de45f7",
"scripts/experiment-worker.py": "aa0f21de0bfbccb41dfd40b157ef3314ade64168e3d651dd6a51055d85cac669",
"scripts/final-checks.sh": "c4a00b9287b1a9ff9ac5e8a43d10618d1040d89c44337c54770b2a40c0f898ec",
"scripts/generate-types.py": "9e88eda11718e6df8f9816ea2c643a4e7d6c34fa4869fae854c47b2882fc3798",
"scripts/prove-admin.py": "198c88c95bc793d44ab233a45ba6c5b306c66c5950ffb72cd1a86d4d2776f864",
"scripts/prove-all-replicas.py": "38b9fdb1516693f8108a3d2a48c9130c1aa17f4867668ed6608dfbbe18897ec8",
"scripts/prove-auth.py": "a50f516e426a04ca1f133408e5968b1e324fdfcd6ba68c453fa25947fb5e4ec8",
"scripts/prove-cert-expiry.py": "b55d1e60b6ce3571b365de6d7b1e94ac775487419e31d6b2a6cae2a6da1fe650",
"scripts/prove-clean-clone.py": "72edaff9f2461bdfedf00713ea8de4c990bbbbf24ab956de6f23402afff5d66d",
"scripts/prove-leaf.py": "c44ed204efd52c774f7d2069552c8517935eb94961c7d94c0dec9c5930d3775d",
"scripts/prove-sealed.py": "cde24884a75daa4885fa1b6fbb4aa1b4988834610511cc8873440bbca624819a",
"scripts/prove-telemetry.py": "e3f5aed0934f044aedf09c5eaf8afb5be445e3650aba66f3739ae4a5bbc01064",
"scripts/renew-leaf.py": "603024c424990c558387fc3a9eb0a5b18958cef5fa9907e192eb03c1ddcc124a",
"scripts/restart-evidence.py": "bb75b354a13305c5dd0ad6b0c6533025434715fdd3f30b560c46dfa5c09104c0",
"scripts/restart.example.sh": "0328246ba75defbced992104e986fde973f63e3830d83251eced5953263e944b",
"scripts/restart.sh": "dbb5117429f0386741d60bc4096c6835949c0cc853e55e18d777709599681675",
"scripts/rotate-worker.py": "ff544fe9c504025465f01df8c197c993581deade778c79fa01501387e419e5cc",
"scripts/scan-images.py": "f53604bb699417f8c317dd700fed0ad918f79bfadb1122613b609dfa3e281843",
"scripts/security.py": "27d6f6fd22b2c1fa5dced045ac9154035fba87b1a8ff6df8109d20b98622bc59",
"scripts/stop-one.example.sh": "1bcf34394520b89d95b7605ec56675be799eea920e83cfbba306d5dc0a6d9811",
"scripts/stop-one.py": "a061d00d2dde7d9190bce7e83b701ce6994a0341b5c449899b9142a02d340356",
"scripts/stop-one.sh": "969f832212f8e3399446dad8fecd033267ec6676ef2111c5726c365698c5c206",
"scripts/summarize-evidence.py": "fdef2efc800ce81631dcca7aae974abf435d19a800d184d544d64ddf773b73fc",
"scripts/test-storage.sh": "71225896d8283d4bdcc9be4105abfe98d6d6000b85b67539075cbed80a1a596e",
"scripts/up.sh": "4f220b7f058ecd343a03f2106955872a59055a7c2fa798bc21a58ae7db79e499",
"scripts/validate_openapi.py": "4e981acbfc10dac58817bf922d5896e996798551fedc1b2385130e1cddb13d54",
"scripts/wait-ready.py": "5b8c61077acc07fa58786732f114b6691d619da4205cb5dd8e3a05078a81dbd3",
"security/SCAN_TRIAGE.md": "a66c2a11f81a186dad424496f2f7ea47a46db0818446420894fbdb51b1860df8",
"security/THREAT_MODEL.md": "7ec25a768b9ee2d7acb7e8a07576a413e881c3240a0909c957e7c8101c9d13d4",
"service/cmd/app/main.go": "dd04e7b22f8426b0b57b40e5cd4c455fff23cfc9d26cc42addd52ed81585cc15",
"service/cmd/app/pipeline.go": "136355cb8b52a391631068f214405a82f83e7875dda704a16f4a966e95376051",
"service/cmd/app/storage.go": "c21c04e969c835f593890c4c33706ab1dc9b501526a05d9d158f235971e2579d",
"service/cmd/benchmark/main.go": "26227a4eedb4e80de5fb011637a9df3022fea5d56a5cb45722101ffc5524bd1d",
"service/cmd/benchmark/main_test.go": "7304e7056582f8f0ae4130f1fcee0d453d3426036e8c5990581dbf09bc61f01a",
"service/cmd/securityprobe/main.go": "e90761cb1511c85ac4bc4a5253896483c915e498449fb413adeb580b903da6de",
"service/go.mod": "2ef766ef7afdab1ec443e57b39e06cbfdfe2bcdf723cf43169eebd2570d698c7",
"service/go.sum": "c1cf821074b60d627c45be58496f118d51bd6c8017350ba623dce556c8f23fba",
"service/internal/adapter/controller/http/attachment.go": "829cb066e16841f872c8d8067a74b091c2430a3d1eca9365aea6d8b36b40e7fb",
"service/internal/adapter/controller/http/attachmentHandler.go": "83673b5f0733be117df90c34e9b7e5b6cab2d18e6481edd7a0b006f5ef10f31e",
"service/internal/adapter/controller/http/auth.go": "43b3f24df2bf76cf26449a9a0b2d4bb1ad377ef03f94fea979b10c6b5a1da8dc",
"service/internal/adapter/controller/http/chat.go": "c3cf09fd828c18a0e7c46549ed4e3160b8b22118057f46c63ff78d0df3704b2b",
"service/internal/adapter/controller/http/controller.go": "fdd74a6b1ff5c621ef9d0dca459cb6e951e26fdb044270abc6a5ceef6ce28d8b",
"service/internal/adapter/controller/http/handler.go": "1d6007f299ef85c0dec94b35e67a1dc37ebcba94d5322bbb6fe19c1f7c9fccc7",
"service/internal/adapter/controller/http/health.go": "25cd15594bc634ab8f4cee51588763c057f22cdc140a984abc42af60cafa7a73",
"service/internal/adapter/controller/http/router.go": "829cb066e16841f872c8d8067a74b091c2430a3d1eca9365aea6d8b36b40e7fb",
"service/internal/adapter/controller/http/user.go": "25d26b1ab24eb474e21eae547e2a4cd4fef8b95570bca016d9639aea307d46c1",
"service/internal/adapter/repository/cache/outside/chat.go": "d9f3f1677703d62e5a6a9cb28cb5264ff8b9cda25c944be736c8afd211d4abfb",
"service/internal/adapter/repository/storage/attachment_scan.go": "d2c9ba746141b939524298051dffd4edb1ded55e3fb2bc47725a5566a9fe47a9",
"service/internal/adapter/repository/storage/attachments.go": "fe80b68d72eca5f776580fd56875f9f045faf57eeacdc1fbf857f1e2b7a31ef5",
"service/internal/adapter/repository/storage/chats.go": "d7090a47013a3d207646e0afa8a13a49f7b4387de3e04f8a8bae7427c116bbcd",
"service/internal/adapter/repository/storage/idempotency_test.go": "f075082c25e667e3929b17dfa67860c8690808c607e224bdf3f9b8569c0f8bbc",
"service/internal/adapter/repository/storage/jobs.go": "627bb00a98d835143c5d437ab221dfdf809784bc44f58cb987cec6502d08987e",
"service/internal/adapter/repository/storage/messages.go": "3bbe58606b7e989b5c1e5b1a913c59880276dd259e4f2392c38e5bc48f3f69ff",
"service/internal/adapter/repository/storage/observation.go": "5feb70ce2de6abec4d10a9d7d3cfdb2277230de78bd8d5b69bede959e4d07d58",
"service/internal/adapter/repository/storage/outbox.go": "09f5b1242ab6c0729f060bc27011dc8af78114e9a4e4dcdfa865da7fa3461748",
"service/internal/adapter/repository/storage/refresh_tokens.go": "30ad6ed103b9f6c2e551df481a27c0a41dd2ab12ba9380b75a65fa5909cbaaad",
"service/internal/adapter/repository/storage/users.go": "8f54120a68e7050385a3b16d6e41e208d81eb711c62cd4d2bd9e726802c7d07a",
"service/internal/config/abstractions.go": "47a6d954d5789640bbc1cab93fd8581cee33d0268beaf40e05f1bdfa0714f781",
"service/internal/config/application.go": "7709c2f37d3c1b1d9c97b30d0a4940e6f34878e7ee475fb9b99fa6f898f65bfd",
"service/internal/config/attachment.go": "9f1705873d7945f5510e4fd9159e65f08629ac329c631576b3c05fda048fe28e",
"service/internal/config/config.go": "b2f8655c78e922b1b87e0ab279f6c545dd9bbe4244a3d6ed36bd6246dfba52bd",
"service/internal/config/cookies.go": "93955e1f5d6734afb079772f12e003ac297c7dfd8f1a9bf5d43ca0dfa4a6bbf6",
"service/internal/config/jwt.go": "10a57daacf3e41c4ac1ae6b5d5a1b476962873207bd256e154dc5aaa34ac64f0",
"service/internal/config/pipeline.go": "22948e39770d8bea102bab20f653557cb864b97edfc1e69520e2f88d27bbc07a",
"service/internal/config/postgres.go": "80389e45cce562ddd1e359774ea1a433f6d2ac2011a11b15576580609030ede9",
"service/internal/config/redis.go": "f7cd8c4785f39e5e4478231617b935a4879ac290e98202734a712273a72dc037",
"service/internal/config/server.go": "c3203ed1105edbf3a3197951e628e375035b599fa4bbe7429bdb0fb9f11198b1",
"service/internal/config/validation.go": "d8115ca776021cdd8d44573740c2d5fdf7f379c6909d7abd39d72f31d0f9ef98",
"service/internal/dto/attachment.go": "33df44b9944cb0e2e377bd241e7c0cc459634f7379607f244b140f1ce68dd6e8",
"service/internal/dto/auth.go": "1b50ee60aaa0ccd4c62ed4e4380390fdf9c08365cbfa2d0c324c7c376397b1c9",
"service/internal/dto/chat.go": "29e54d7b24235a580247b934bb7659a112539046d49046517cbeb64f2b9954bc",
"service/internal/dto/message.go": "d4ce6456453f2f3ec66d8456dbdf7828de44452df58b2497c37e1e281a88697a",
"service/internal/dto/page.go": "819dfe56a078cf7032036a7e5942043a5f5ecdb77a10dcffafc65905b4cd55c6",
"service/internal/dto/user.go": "ddc9ad138746e7b932a2bdfb72a1b51e26f1aa14f5dd8a71a201456edc43f4f0",
"service/internal/gen/contracts/types.gen.go": "c9c09568311a214d7f1416e59739bcd7b7d860defc1881398b02512807eb484f",
"service/internal/pkg/apperr/code.go": "d882d85353494f7f1f28f8d7afe0031ed066e1e0eb9a146251448275305c4302",
"service/internal/pkg/apperr/code_string.go": "48651daf286010f8e2609c3601a44b2593c81235b4eb659cb17c954255a5255c",
"service/internal/pkg/apperr/error.go": "f56a5a6e636d1c71adc1886e91caef924517c478e68c398d3c679658acfbc483",
"service/internal/pkg/apperr/meta.go": "e9c37b9d40bd072d39c19a0fed947f8c798cf22ca8234b2dd3aef83c937b1d00",
"service/internal/pkg/apperr/metakey.go": "cb68597145dafa8053f77d438394afefbdadb070ec4f1cecd5b468c0123b809c",
"service/internal/pkg/apperr/postgres.go": "556d77a2c95a3cc3c9019d3a5f6bfb5d1c7df8b2c8f125d5f0b519eea09b4fab",
"service/internal/pkg/apperr/redis.go": "45a8f0f1c2f5984593999170333b8c7d6f5a6b5d49f7f60c0ca4546149dc1d45",
"service/internal/pkg/auth/jwtprovider/claims.go": "ba12f8aed6a5c34f2ad157eca980c9030c1a7f97ebc848fd0f3ba9d01a1cf5c4",
"service/internal/pkg/auth/jwtprovider/cookie.go": "4aac299144847976ea62e491eacc84723e3c9f0a1b1d7f34ccad8f938f830559",
"service/internal/pkg/auth/jwtprovider/error.go": "6c5903a4b1a35ba7841e57c1f160364de1778095bd37385a8f7579b11d586e89",
"service/internal/pkg/auth/jwtprovider/interface.go": "d88e563c9e785710d2e38a4ef8f6d94dbf8c4c60fff7306ec4d91f5445da3e19",
"service/internal/pkg/auth/jwtprovider/manager.go": "f1db7ad279b6d3e1900453bbdeae03ff405356403c1ab63629e92cee690b5644",
"service/internal/pkg/auth/jwtprovider/provider.go": "1606d09846f676d84d6930b1f849de36a65b8ffbb00fb29adefa43edb9afe8e8",
"service/internal/pkg/auth/jwtprovider/readers.go": "d7064e7be222be43e9927e407429d3e3136186fdb3e410f09fcc142999fcc9b2",
"service/internal/pkg/broker/rabbitmq.go": "806be6250487de277e270e96f2641b644cbf6f0084248cb774408e497b6fc812",
"service/internal/pkg/cache/redis.go": "61e21e44c41628d4c8aa923b901a29398d7e9c41ffbec71e9a310964bf25b1e4",
"service/internal/pkg/encrypting/argon2id.go": "6ef700f03b84c52b186435b9be244bd03c37474d4d90a8b100f4c3b545c2260e",
"service/internal/pkg/encrypting/encryptor.go": "b07128f65ddca6897260d9bfcf232eafafeab5ca01b141c4f80b4c0966d2c260",
"service/internal/pkg/encrypting/error.go": "13a893c0f7ec390497561df22decac9bc1f3142ca4def69818cd79fe8c659f5b",
"service/internal/pkg/encrypting/interface.go": "ca25defd6c7bfabf24009149e3d6e4975484a76d1c6182b78e6abf3238d1aa62",
"service/internal/pkg/encrypting/token_test.go": "44769661e8fa8ac116462e300ed518c2f4743c7914b7c32de0fb691f4dc28734",
"service/internal/pkg/fault/fault.go": "bfd659aa7ef2906a182ab0714d73ad63a90c6dd9ffb535af69a0c101b0e629ba",
"service/internal/pkg/imageprocessor/image.go": "7854c17607848c000ffd3dc7179f568b27cce03d3782464cce5d5445ddf563f5",
"service/internal/pkg/migrator/tern.go": "eb2e704c1aecac44a789e8938fcb12b9cf98d8ec66d54477ea48513ad698daab",
"service/internal/pkg/objectstore/s3.go": "98e39fd6a259d9fc5474783b7b60a110a59efeacea5714d54bd8f7273879fb91",
"service/internal/pkg/openbao/client.go": "7d2a1344b3cb42aad62187534a19af3c56192c5c44bf49dd46e5d82ff4994489",
"service/internal/pkg/postgres/after-connect.go": "638764a8143e038e51dc894bda268048eab6354e9f865bacfeea0480f10b99bf",
"service/internal/pkg/postgres/config.go": "25120b03517c8e933e10a3a78bbc46567d273ad59c7108d1abfeb4f298080af2",
"service/internal/pkg/postgres/err.go": "da004b6167345f88139839f5d1720effd5bf92210b9c00a9e6cd5b3a8a1ac11a",
"service/internal/pkg/postgres/interfaces.go": "d216fe34cdfb0448fcd644f9f2262a4541676e0aa89275faf3760099bc52e388",
"service/internal/pkg/postgres/postgres.go": "53eeada1a98924b1fbab216d2027261b8fd91844965ad464c0a1226d3c8bf030",
"service/internal/pkg/postgres/txmanager/tx.go": "9f3ed43fffb91dc46525e583464ec04b773258a255bfe7580fa93eb4668bc312",
"service/internal/pkg/ratelimit/redis.go": "d005d19f6eb60d58f15ed631bab624424b8fb7b043bdbd6d78ecc325702c64e4",
"service/internal/pkg/rest/framework/framework.go": "2cffaaa3b92ae25b2413f2c99ae4af247e8e623dcc1eddd81eb2923c7ba4803e",
"service/internal/pkg/rest/headers/headers.go": "077b18cebe3627cb4c9b57e5c9e8ed77798ebfb3245dce5df64ea3b89525e705",
"service/internal/pkg/rest/middleware/auth.go": "50784cbcce1450ea86ea9542031a9731b46f58287817045cf30c3b7009862243",
"service/internal/pkg/rest/middleware/auth_test.go": "e01e16e8fd997e36836099a4f650c06a6b12c8eb7839bb3bea9d52e86fa01046",
"service/internal/pkg/rest/middleware/instance.go": "8e9877aa38b0c5ea4778e524354513ebea83036fca57d2658cbc94397058aeac",
"service/internal/pkg/rest/middleware/logging.go": "5a2a3a0a83e0aeccc0fd71d9814df8bd66cd3c3528c3fa0485b016b673862231",
"service/internal/pkg/rest/middleware/middleware.go": "b8b06a2dccca8d794f6200b6ef7dbad438182cbebc39566f828adc2578996010",
"service/internal/pkg/rest/middleware/request-id.go": "c901675387cfcb4c3446614e0cc7227148f8a6ffc09f9084e3a3ea9137af1acf",
"service/internal/pkg/rest/middleware/timeout.go": "bae9f97b85ac37331cb9e66f47961d7cff0e605aabbe068bc268456c43460c0a",
"service/internal/pkg/rest/router/router.go": "345ef7619886fffc6d0c421135a047eef2cd74bf7e594c3a0b25e71f6e811d4a",
"service/internal/pkg/telemetry/http.go": "f210cea7f7fe6b9716522b452a1226eeec396fa5a893d453e0c008679733c586",
"service/internal/pkg/telemetry/observation.go": "10137f5cced7c4fbe1794102e73938f227598e04bda82722dd4e1875b43781a6",
"service/internal/pkg/telemetry/process.go": "c455581bbf8142dc8518cee7698f03f41033a3a3ba217b79bd784fcb0a98f0e7",
"service/internal/pkg/telemetry/telemetry.go": "eb3b69beaf199daa29ae8d38de87fe688328577a912092e8257e30755fce96da",
"service/internal/pkg/transportsecurity/tls.go": "f7032135845c70d5e84b42f49e2389c9d34efb32c0df03bd2c6343d0ab5cd5b6",
"service/internal/pkg/types/authprovider/provider.go": "4fb06d1e114a99eafb4da34c8d7ad53594d55b438c80e5afed3fe1ccf3f979b6",
"service/internal/pkg/types/environment/environment.go": "c6cfd877a2c492123ce23d0b34432d6e951d606cce161c65d924027aa61b2954",
"service/internal/pkg/types/error.go": "6fee4c45b6e08854d21966bb89091dfb1c50b4e577257156c56dffa5f7347390",
"service/internal/pkg/types/role/role.go": "611d29787a97aaabc8906fe3cb99729ace95129910daa7ae273623395e27112d",
"service/internal/pkg/validator/validator.go": "7c6557925b86247aa5e82466d340c2f99a67499bff57b61233a014c2187dc6a4",
"service/internal/service/attachment/interface.go": "38bfff542af5abfc40ded1c5dd3abd7b08786662468849ab3f897783fa4f48a0",
"service/internal/service/attachment/pipeline.go": "c44faac7a73c7a69819472b990cf659705be9d71e6eb695e2c790e5b0988c44b",
"service/internal/service/attachment/reconcile.go": "130bf1199b532ef52eede78a4eea4448f19602bb013f6268d4af30ab70f68eb2",
"service/internal/service/attachment/service.go": "ee6d08f47eaaf52dd93dfaaaee0d517bbda9ce0b494a9e1b73bd52122495247a",
"service/internal/service/auth/api.go": "65b6656a2549a6f6c5b69217da57126395648c420d9bbb9c78c432c194ea8f0d",
"service/internal/service/auth/interface.go": "0266c72369881fdbcdd330a48c52cb8745214725ae02c42f12bdf5fe016503da",
"service/internal/service/auth/svc.go": "d26cadcabcb3b930296f6b5f7597a16a516bf3db867c5804d03dd072e1899173",
"service/internal/service/chat/api.go": "490448c738c3e27d09476f3530a5bbd3edc7872a7b9116195987d73285f8e6cf",
"service/internal/service/chat/idempotency.go": "d9e188147141c068685d58ecf3b2d6969bc35e841bb7451ec30b8a9d60bd0b1f",
"service/internal/service/chat/interface.go": "3a0562b5907da2f642a7b630d15aea3a6be954428d09873862b3b37678e93614",
"service/internal/service/chat/svc.go": "d1b325f58fb4b1b0efe27a3dc0d988219effd84ae1a18e9450182a5cdbc845bf",
"service/internal/service/observation/service.go": "014154616843ad4fcc4d1fb46da11a2cdaa7cd8b71171b61e88fb0146a530c0f",
"service/internal/service/outbox/api.go": "6a1088d0219f32f92b49fd270d38f1bb396af8eb82856612e4359088c52b514c",
"service/internal/service/outbox/models.go": "2a28401f1a9ff36fe0a852269717479f599243131b24f76fba287aaa6601865d",
"service/internal/service/outbox/status.go": "40ac7300e89dab55a9d5f7c71a128507ef9c28483c0a42f3953242eef9ad0205",
"service/internal/service/outbox/svc.go": "747d208f628b4320ab00a7b9f9867d5e9b80d0e540ea5cbd0d20d5ea95872f82",
"service/internal/service/outbox/transport.go": "79c58cddf2ebcc78b4ed3048cdb0bee0d57e1be266f1742cf76f77f92855cc5d",
"service/internal/service/user/api.go": "a702cf6c410eb57006543dbc341a0eb6faa2fa300bd256532ac150a00eb205f8",
"service/internal/service/user/interface.go": "ed8905f680e533e7f13fd09225f908d46e78945b06720b080c48c7302a4fb5fb",
"service/internal/service/user/svc.go": "0dbbca7ee6fda228364ae29f40d4a94e063737a97e630b3de48174e4feb56005",
"service/migrations/001_create_users_table.sql": "1b471cc1999a4074e85f313d614a16d4ca29cbfa41b364205b6716bdfe6faf91",
"service/migrations/002_create_refresh_tokens_table.sql": "a413f0e480c3eb0ca1c6b0f2f4e9c2888451534a48fd244de208b5cf2686a656",
"service/migrations/003_create_chats_table.sql": "5eb5754b38115ba993063eee16b5ea4a771157b4fcd2c2e1d98b00615084d388",
"service/migrations/004_create_chat_members_table.sql": "d6d6fc46a4ffea85495d2273fef45c0685353e639a9d251ece87f83a9f127c29",
"service/migrations/005_create_messages_table.sql": "b34ef70a31c577ccfe932c324bd4e7306c35863fe0a6722fd24134a1d07beb33",
"service/migrations/006_message_idempotency.sql": "b330000aac4ad29135ae2616ca4081a2bd79570f86e1167bcc2ad29002a787cb",
"service/migrations/007_attachments.sql": "a6c7b7a6211dd74ffd67e768792c67bf0d1e0f168de157f9cda166244fc39fcf",
"service/migrations/008_async_pipeline.sql": "587d2a5d473821b8aa9df31f1bf8dbfb93161c5164d38f0619330c6e4021a71b",
"service/migrations/009_variant_manifest.sql": "5f2a884981cc6c4ef42a17a7b9e9bf9f0fe7556c463c877b7e50fc0c67e48f12",
"service/migrations/010_observability.sql": "767bfc0f44c87d9f9146bc2f67f30f91f0007514abefcccd1945eae243e6b027",
"service/migrations/011_terminal_slo.sql": "c06fef77f3cb9694df1c1f0c8a771860d669bfd2ecad4635a3a1839989c52ccb",
"service/migrations/embed.go": "8dc35112dc91bb3b453c1032887c77462c027ce63e1e7eb432dfd03e2dcf5709",
"service/tests/api_test.go": "556486d1109cb54ad045b4f53843ae1edb0f47029dc838ee4b5635a2242d0a2b",
"service/tests/attachments_test.go": "9b928104a2157d5ae84b2e09e915d0468634086937da4885380b29f2e4402e84",
"service/tests/concurrency_test.go": "73632d5d4bf5566c209c3640eb82d4dd2c931c2a225708bcb2a0325641a3d2d2",
"service/tests/idempotency_test.go": "9d83697d5cdbc717b0d69762e8dcc823a81f515761a5f9c7819613a51aa687e5",
"student-tests/README.md": "6030f68e6e0c966f31f80709ef1b1504512d534066ef684ede54e7d8b0597b32",
"student-tests/broker_persistence.py": "db738001ed1f55f0153e81069a3c8a28f49b8fac59598b90f21800c430ed4fdf",
"student-tests/images.py": "f0b9e9fa28a472d88751bf9210823a9fdec7e400c973de1ddfbb6d8e73be2b7c",
"student-tests/pipeline.py": "5224fd0c3bc16da77e0f49e156ff9197b075bdf3a5b2a4c79191dd73c6583f46",
"student-tests/storage.py": "3efeba78a45d0a579e4725f7ae24a623fc70d12a225e0137a429caedbebde60e",
"tests/README.md": "e0bfa7e196797f6a5bf6e44d8ad2ffeb82651927ff5d8484eb1c2dda1ec7dec5",
"tests/client.py": "8d50976fc7c7bbb81e88a152f613c61ab25eaf53dba33c6a9dfab19f868d546d",
"tests/fixtures/README.md": "c001783760b4f87a7a8441a7ba55f5d080ff48e1397d3581d72a88d7691f96c2",
"tests/fixtures/sample.png": "99ea7533c441f79cd630d15ce4d58d1ec4e06f6f0efb3b77a5c088305cd1bd75",
"tests/image_probe.py": "a9a4f89181c8e0fda6ce42e1a1af32fb42d8e3ae519e314207127c9b9b448b13",
"tests/load.py": "6d3511ea719c7a7e841083e73d435c86dcbfd9f4e5c2a07d62eb9614b01d9933",
"tests/resilience.py": "1f96663a174b3978d24eff66f2741f5f8c9b788d3242261d37a972720c52788b",
"tests/security.py": "6560a56cc22981c9f06043709bfabe7a47fa7eab57e62741e95534ac5ddff8a7",
"tests/smoke.py": "52ac38eb343ff7d43e7543588e1da58ca06c9fce74b2b0d0bf0e4982bc23c1db"
}
+1
View File
@@ -0,0 +1 @@
PASS: active source protected, ready staging removed, failed retention enforced, restore/replay verified
+24
View File
@@ -0,0 +1,24 @@
{
"results": [
{
"scenario": "queued_staging_protected",
"result": "PASS",
"attachment_id": "e9227a4d-862e-4c2c-8617-3853671794fa"
},
{
"scenario": "staging_deleted_after_ready",
"result": "PASS",
"attachment_id": "e9227a4d-862e-4c2c-8617-3853671794fa"
},
{
"scenario": "failed_retention_and_missing_source_replay",
"result": "PASS",
"age_simulated_hours": 25
},
{
"scenario": "verified_restore_then_replay",
"result": "PASS",
"job_id": "cba3b401-9375-42bf-8a39-821b0854d0c4"
}
]
}
+1
View File
@@ -0,0 +1 @@
PASS: metrics, worker logs and real trace queried over TLS; secret/body canaries absent
File diff suppressed because it is too large Load Diff
+36
View File
@@ -0,0 +1,36 @@
# Фактическая итоговая проверка
2026-11-17T14:23:21.443062+00:00
Результаты относятся к synthetic lab7 stand. Source snapshot: `source-manifest.json`; environment/image IDs: `environment.json` и `image-scan.json`.
| Проверка | Результат | Вывод |
| --- | --- | --- |
| Public HTTPS and external trust | PASS | [public-checks.txt](public-checks.txt) |
| Final HTTPS smoke | PASS | [final-smoke.txt](final-smoke.txt) |
| TLS/identity/ACL matrix | PASS | [security-run.txt](security-run.txt) |
| Argon2/rehash/session expiry | PASS | [auth-run.txt](auth-run.txt) |
| Leaf rotation/revocation | PASS | [leaf-run.txt](leaf-run.txt) |
| Expired allowed-SAN leaf | PASS | [cert-expiry-run.txt](cert-expiry-run.txt) |
| Sealed OpenBao | PASS | [sealed-run.txt](sealed-run.txt) |
| Real telemetry and canaries | PASS | [telemetry-run.txt](telemetry-run.txt) |
| Grafana authentication | PASS | [admin-run.txt](admin-run.txt) |
| Image/ACL negatives | PASS | [images-run.txt](images-run.txt) |
| Staging/restore/retention | PASS | [storage-run.txt](storage-run.txt) |
| Broker volume durability | PASS | [broker-run.txt](broker-run.txt) |
| All stores restart/session persistence | PASS | [persistence-run.txt](persistence-run.txt) |
| Public failover 1 | PASS | [failover-first.txt](failover-first.txt) |
| Public failover 2 | PASS | [failover-second.txt](failover-second.txt) |
| Both physical replicas | PASS | [all-replicas-run.txt](all-replicas-run.txt) |
| Worker compromise/recovery | PASS | [worker-experiment-run.txt](worker-experiment-run.txt) |
| Independent source snapshot | PASS | [clean-clone-run.txt](clean-clone-run.txt) |
| Source vulnerability scan | 0 findings | [govulncheck.txt](govulncheck.txt) |
| Application image scan | 0 findings | [image-scan.json](image-scan.json) |
## Worker experiment
- Повтор 1: 5 accepted → 5 ready, lost=0, duplicate_jobs=0, recovery=40.323 s; старые S3/broker/Bao identities отвергнуты.
- Повтор 2: 5 accepted → 5 ready, lost=0, duplicate_jobs=0, recovery=39.502 s; старые S3/broker/Bao identities отвергнуты.
- Повтор 3: 5 accepted → 5 ready, lost=0, duplicate_jobs=0, recovery=43.285 s; старые S3/broker/Bao identities отвергнуты.
Скриншоты не используются вместо команд. GitHub CI настроен, удалённый workflow не запускался агентом. Диагностические неудачные запуски не включены в PASS-таблицу.
+9
View File
@@ -0,0 +1,9 @@
Local lab7 CA, identities and synthetic secrets prepared. No credentials printed.
Worker old cert/token/DB lease revoked; S3 key and leaf replaced; image unchanged.
PASS: worker compromise/recovery repeat 1
Local lab7 CA, identities and synthetic secrets prepared. No credentials printed.
Worker old cert/token/DB lease revoked; S3 key and leaf replaced; image unchanged.
PASS: worker compromise/recovery repeat 2
Local lab7 CA, identities and synthetic secrets prepared. No credentials printed.
Worker old cert/token/DB lease revoked; S3 key and leaf replaced; image unchanged.
PASS: worker compromise/recovery repeat 3
+863
View File
@@ -0,0 +1,863 @@
{
"hypothesis": "Scoped worker identity limits DB/S3/broker access; revocation and replacement preserve accepted benign jobs.",
"timestamp": "2026-11-17T14:17:54Z",
"repeats": [
{
"repeat": 1,
"accepted": 5,
"ready": 5,
"lost": 0,
"duplicate_jobs": 0,
"variant_records": 20,
"original_checksums_match": true,
"old_identity_rejected": true,
"recovery_seconds": 40.32301945798099,
"observation_errors": 115,
"upload_latency_ms": {
"p50": 15.432999935001135,
"max": 76.49250002577901
},
"restricted_probes": {
"db": {
"ddl_denied": true,
"jobs_read": true,
"messages_read_denied": true,
"mode": "db",
"password_read_denied": true,
"role": "worker",
"session_read_denied": true
},
"s3": {
"forbidden/security-denied": true,
"mode": "s3",
"originals/security-denied": true,
"results_read": true,
"results_write": true,
"role": "worker"
},
"amqp": {
"configure_profile": true,
"mode": "amqp",
"publish_profile": true,
"queue_read": true,
"role": "worker"
}
},
"broad_db_read_and_ddl": true,
"broad_profiles": {
"s3": {
"forbidden/security-denied": true,
"mode": "s3",
"originals/security-denied": true,
"results_read": true,
"results_write": true,
"role": "worker"
},
"amqp": {
"configure_profile": true,
"mode": "amqp",
"publish_profile": true,
"queue_read": true,
"role": "worker"
}
},
"old_s3_key_rejected": true,
"old_broker_identity_rejected": true,
"resource_snapshot": [
{
"BlockIO": "2.88MB / 0B",
"CPUPerc": "0.24%",
"Container": "56afe89db128bb4e04588e532e7aa9917c3f0d0bb82558a5632e2f9a80ecacab",
"ID": "56afe89db128",
"MemPerc": "18.87%",
"MemUsage": "24.16MiB / 128MiB",
"Name": "mtusi2026lab7-s3-tls-1",
"NetIO": "976kB / 1.29MB",
"PIDs": "9"
},
{
"BlockIO": "6.73MB / 0B",
"CPUPerc": "0.26%",
"Container": "ad91f0eb9f57dad3124106fa2970a160e55206b2b5f7e5c1c42ae5e32136aca9",
"ID": "ad91f0eb9f57",
"MemPerc": "22.01%",
"MemUsage": "28.17MiB / 128MiB",
"Name": "mtusi2026lab7-otel-collector-tls-1",
"NetIO": "6.87MB / 3.43MB",
"PIDs": "9"
},
{
"BlockIO": "10.8MB / 0B",
"CPUPerc": "1.12%",
"Container": "55c1a619dba179163f075c9a50e72eaf37bb9a87bb4a2b4ae968621c13108b3f",
"ID": "55c1a619dba1",
"MemPerc": "20.77%",
"MemUsage": "106.4MiB / 512MiB",
"Name": "mtusi2026lab7-api-2",
"NetIO": "1.1MB / 1.41MB",
"PIDs": "8"
},
{
"BlockIO": "1.29MB / 0B",
"CPUPerc": "0.37%",
"Container": "4a795b20fcbdf066c7f656c0e55de0fbb7dcf24dceb073fe0f29496946d20a02",
"ID": "4a795b20fcbd",
"MemPerc": "1.45%",
"MemUsage": "14.86MiB / 1GiB",
"Name": "mtusi2026lab7-worker-1",
"NetIO": "669kB / 810kB",
"PIDs": "8"
},
{
"BlockIO": "4.1kB / 0B",
"CPUPerc": "0.95%",
"Container": "ddc8ca7b147898e9d1ac4f9b7219ee2f8905bd2921df64181ffee02ba6cb97c0",
"ID": "ddc8ca7b1478",
"MemPerc": "2.66%",
"MemUsage": "13.62MiB / 512MiB",
"Name": "mtusi2026lab7-dispatcher-1",
"NetIO": "468kB / 841kB",
"PIDs": "8"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.33%",
"Container": "1292b6fbbd2a01262923490e3dd18bd64e253c326aa0834f9db53ae247fb18a9",
"ID": "1292b6fbbd2a",
"MemPerc": "19.01%",
"MemUsage": "97.35MiB / 512MiB",
"Name": "mtusi2026lab7-api-1",
"NetIO": "907kB / 1.25MB",
"PIDs": "8"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.10%",
"Container": "08cf52574facd688fb2497bdd32dcc3cb55c83b9814ea215e0f3a2cd50170b5a",
"ID": "08cf52574fac",
"MemPerc": "15.76%",
"MemUsage": "20.18MiB / 128MiB",
"Name": "mtusi2026lab7-tempo-tls-1",
"NetIO": "1.06MB / 134kB",
"PIDs": "9"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.09%",
"Container": "6ce0529bded56716bb6f3df214263b6cc6bf62bdf0defeba7e1f31d5b798e261",
"ID": "6ce0529bded5",
"MemPerc": "16.53%",
"MemUsage": "21.16MiB / 128MiB",
"Name": "mtusi2026lab7-prometheus-tls-1",
"NetIO": "1.09MB / 97.3kB",
"PIDs": "9"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.11%",
"Container": "9d289263bdf85dd8527aa2f2e5f712e288224d43cf263f933dc5b4b0ea7767c5",
"ID": "9d289263bdf8",
"MemPerc": "16.36%",
"MemUsage": "20.94MiB / 128MiB",
"Name": "mtusi2026lab7-loki-tls-1",
"NetIO": "471kB / 84.8kB",
"PIDs": "9"
},
{
"BlockIO": "3.47MB / 328kB",
"CPUPerc": "43.64%",
"Container": "be47e533bc90852ec009a15c8f2e9d8bfaed3dfeaa73e80e8a03191e2e3370c1",
"ID": "be47e533bc90",
"MemPerc": "33.07%",
"MemUsage": "169.3MiB / 512MiB",
"Name": "mtusi2026lab7-broker-1",
"NetIO": "1.78MB / 1.74MB",
"PIDs": "96"
},
{
"BlockIO": "30.9MB / 1.51MB",
"CPUPerc": "0.43%",
"Container": "26d14907a8d04095b62ae9b92073e9743526ad3d94e7fe58b89d2480b0a6baa8",
"ID": "26d14907a8d0",
"MemPerc": "23.71%",
"MemUsage": "91.05MiB / 384MiB",
"Name": "mtusi2026lab7-prometheus-1",
"NetIO": "1.09MB / 97.3kB",
"PIDs": "7"
},
{
"BlockIO": "46.4MB / 2.37MB",
"CPUPerc": "0.34%",
"Container": "56dc536779db92bf8a1841c4b7e235a028c85a1a3b98f6227c28e2d8d847f6a7",
"ID": "56dc536779db",
"MemPerc": "20.84%",
"MemUsage": "53.35MiB / 256MiB",
"Name": "mtusi2026lab7-openbao-1",
"NetIO": "417kB / 590kB",
"PIDs": "19"
},
{
"BlockIO": "546MB / 4.08MB",
"CPUPerc": "0.59%",
"Container": "adeb6ec904706c78545c39ed621c7484b74a1b277a02d6f88e989b5100a66262",
"ID": "adeb6ec90470",
"MemPerc": "71.52%",
"MemUsage": "274.6MiB / 384MiB",
"Name": "mtusi2026lab7-grafana-1",
"NetIO": "1.07MB / 39.9kB",
"PIDs": "111"
},
{
"BlockIO": "3.07MB / 897kB",
"CPUPerc": "0.40%",
"Container": "e4e27b3ae65375241ad7f192aa0f82759e7929702cf9cff8082c3560d0366252",
"ID": "e4e27b3ae653",
"MemPerc": "18.64%",
"MemUsage": "71.57MiB / 384MiB",
"Name": "mtusi2026lab7-loki-1",
"NetIO": "471kB / 84.8kB",
"PIDs": "8"
},
{
"BlockIO": "51.1MB / 63.7MB",
"CPUPerc": "0.27%",
"Container": "debd0f0fd4f810ed8edc27351a8d9c6926e8c2e036ed622e8eab21d7bdca0cfd",
"ID": "debd0f0fd4f8",
"MemPerc": "99.12%",
"MemUsage": "380.6MiB / 384MiB",
"Name": "mtusi2026lab7-tempo-1",
"NetIO": "1.06MB / 134kB",
"PIDs": "8"
},
{
"BlockIO": "7.77MB / 0B",
"CPUPerc": "0.32%",
"Container": "29e8dc4c7eec171bcd572b91d52653fb10dd398f0693ec3903a14c02371cb88f",
"ID": "29e8dc4c7eec",
"MemPerc": "28.15%",
"MemUsage": "72.05MiB / 256MiB",
"Name": "mtusi2026lab7-otel-collector-1",
"NetIO": "6.87MB / 3.43MB",
"PIDs": "19"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.30%",
"Container": "bcdeea3ec62786e76b0226e58fd1184fe120855a02732090f0b05771a352a7d6",
"ID": "bcdeea3ec627",
"MemPerc": "17.45%",
"MemUsage": "22.34MiB / 128MiB",
"Name": "mtusi2026lab7-lb-1",
"NetIO": "7.77MB / 8.72MB",
"PIDs": "15"
},
{
"BlockIO": "16.6MB / 6.99MB",
"CPUPerc": "1.69%",
"Container": "ef7ea1912bec58bd1f62c767c4321e5ef98180a479ef9d0d5bd7288517ddcc3a",
"ID": "ef7ea1912bec",
"MemPerc": "5.37%",
"MemUsage": "54.99MiB / 1GiB",
"Name": "mtusi2026lab7-postgres-1",
"NetIO": "3.68MB / 1.94MB",
"PIDs": "15"
},
{
"BlockIO": "15MB / 53.2kB",
"CPUPerc": "0.26%",
"Container": "e5835ee95c53224aed3870c331c7af04d11b209944a12a8694524b20b72acca5",
"ID": "e5835ee95c53",
"MemPerc": "12.66%",
"MemUsage": "16.21MiB / 128MiB",
"Name": "mtusi2026lab7-redis-1",
"NetIO": "115kB / 153kB",
"PIDs": "6"
},
{
"BlockIO": "24.2MB / 295kB",
"CPUPerc": "0.88%",
"Container": "79232cd23eb7cb0d401caffc771bdddf9d26925e069682c6fd89ec434b97b146",
"ID": "79232cd23eb7",
"MemPerc": "46.04%",
"MemUsage": "235.7MiB / 512MiB",
"Name": "mtusi2026lab7-s3-1",
"NetIO": "976kB / 1.29MB",
"PIDs": "20"
}
]
},
{
"repeat": 2,
"accepted": 5,
"ready": 5,
"lost": 0,
"duplicate_jobs": 0,
"variant_records": 20,
"original_checksums_match": true,
"old_identity_rejected": true,
"recovery_seconds": 39.502094082999974,
"observation_errors": 105,
"upload_latency_ms": {
"p50": 19.169374834746122,
"max": 25.899999774992466
},
"restricted_probes": {
"db": {
"ddl_denied": true,
"jobs_read": true,
"messages_read_denied": true,
"mode": "db",
"password_read_denied": true,
"role": "worker",
"session_read_denied": true
},
"s3": {
"forbidden/security-denied": true,
"mode": "s3",
"originals/security-denied": true,
"results_read": true,
"results_write": true,
"role": "worker"
},
"amqp": {
"configure_profile": true,
"mode": "amqp",
"publish_profile": true,
"queue_read": true,
"role": "worker"
}
},
"broad_db_read_and_ddl": true,
"broad_profiles": {
"s3": {
"forbidden/security-denied": true,
"mode": "s3",
"originals/security-denied": true,
"results_read": true,
"results_write": true,
"role": "worker"
},
"amqp": {
"configure_profile": true,
"mode": "amqp",
"publish_profile": true,
"queue_read": true,
"role": "worker"
}
},
"old_s3_key_rejected": true,
"old_broker_identity_rejected": true,
"resource_snapshot": [
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.23%",
"Container": "d568da6c446d25681300facceef5e97da219f27ef17b60f0ace30bc625f5e493",
"ID": "d568da6c446d",
"MemPerc": "16.05%",
"MemUsage": "20.54MiB / 128MiB",
"Name": "mtusi2026lab7-s3-tls-1",
"NetIO": "963kB / 1.28MB",
"PIDs": "9"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.39%",
"Container": "6eea17d6edbcc586aa9caeee7f9bc7d73a82e8daeb40bbbd1b54066b6a91ae6f",
"ID": "6eea17d6edbc",
"MemPerc": "17.08%",
"MemUsage": "21.86MiB / 128MiB",
"Name": "mtusi2026lab7-otel-collector-tls-1",
"NetIO": "7.68MB / 3.83MB",
"PIDs": "9"
},
{
"BlockIO": "10.8MB / 0B",
"CPUPerc": "0.53%",
"Container": "55c1a619dba179163f075c9a50e72eaf37bb9a87bb4a2b4ae968621c13108b3f",
"ID": "55c1a619dba1",
"MemPerc": "33.55%",
"MemUsage": "171.8MiB / 512MiB",
"Name": "mtusi2026lab7-api-2",
"NetIO": "2.17MB / 2.78MB",
"PIDs": "8"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.56%",
"Container": "4a795b20fcbdf066c7f656c0e55de0fbb7dcf24dceb073fe0f29496946d20a02",
"ID": "4a795b20fcbd",
"MemPerc": "1.16%",
"MemUsage": "11.89MiB / 1GiB",
"Name": "mtusi2026lab7-worker-1",
"NetIO": "664kB / 802kB",
"PIDs": "8"
},
{
"BlockIO": "4.1kB / 0B",
"CPUPerc": "1.04%",
"Container": "ddc8ca7b147898e9d1ac4f9b7219ee2f8905bd2921df64181ffee02ba6cb97c0",
"ID": "ddc8ca7b1478",
"MemPerc": "2.72%",
"MemUsage": "13.91MiB / 512MiB",
"Name": "mtusi2026lab7-dispatcher-1",
"NetIO": "839kB / 1.51MB",
"PIDs": "8"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "1.28%",
"Container": "1292b6fbbd2a01262923490e3dd18bd64e253c326aa0834f9db53ae247fb18a9",
"ID": "1292b6fbbd2a",
"MemPerc": "31.25%",
"MemUsage": "160MiB / 512MiB",
"Name": "mtusi2026lab7-api-1",
"NetIO": "1.74MB / 2.4MB",
"PIDs": "8"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.20%",
"Container": "08cf52574facd688fb2497bdd32dcc3cb55c83b9814ea215e0f3a2cd50170b5a",
"ID": "08cf52574fac",
"MemPerc": "15.76%",
"MemUsage": "20.18MiB / 128MiB",
"Name": "mtusi2026lab7-tempo-tls-1",
"NetIO": "1.18MB / 148kB",
"PIDs": "9"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.11%",
"Container": "6ce0529bded56716bb6f3df214263b6cc6bf62bdf0defeba7e1f31d5b798e261",
"ID": "6ce0529bded5",
"MemPerc": "16.53%",
"MemUsage": "21.16MiB / 128MiB",
"Name": "mtusi2026lab7-prometheus-tls-1",
"NetIO": "1.22MB / 114kB",
"PIDs": "9"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.20%",
"Container": "9d289263bdf85dd8527aa2f2e5f712e288224d43cf263f933dc5b4b0ea7767c5",
"ID": "9d289263bdf8",
"MemPerc": "16.36%",
"MemUsage": "20.94MiB / 128MiB",
"Name": "mtusi2026lab7-loki-tls-1",
"NetIO": "529kB / 94.1kB",
"PIDs": "9"
},
{
"BlockIO": "3.53MB / 446kB",
"CPUPerc": "0.65%",
"Container": "be47e533bc90852ec009a15c8f2e9d8bfaed3dfeaa73e80e8a03191e2e3370c1",
"ID": "be47e533bc90",
"MemPerc": "19.56%",
"MemUsage": "100.2MiB / 512MiB",
"Name": "mtusi2026lab7-broker-1",
"NetIO": "2.03MB / 1.98MB",
"PIDs": "50"
},
{
"BlockIO": "31.4MB / 1.76MB",
"CPUPerc": "3.79%",
"Container": "26d14907a8d04095b62ae9b92073e9743526ad3d94e7fe58b89d2480b0a6baa8",
"ID": "26d14907a8d0",
"MemPerc": "23.97%",
"MemUsage": "92.03MiB / 384MiB",
"Name": "mtusi2026lab7-prometheus-1",
"NetIO": "1.22MB / 114kB",
"PIDs": "7"
},
{
"BlockIO": "46.8MB / 2.94MB",
"CPUPerc": "0.43%",
"Container": "56dc536779db92bf8a1841c4b7e235a028c85a1a3b98f6227c28e2d8d847f6a7",
"ID": "56dc536779db",
"MemPerc": "21.02%",
"MemUsage": "53.8MiB / 256MiB",
"Name": "mtusi2026lab7-openbao-1",
"NetIO": "583kB / 806kB",
"PIDs": "19"
},
{
"BlockIO": "546MB / 4.1MB",
"CPUPerc": "0.74%",
"Container": "adeb6ec904706c78545c39ed621c7484b74a1b277a02d6f88e989b5100a66262",
"ID": "adeb6ec90470",
"MemPerc": "71.52%",
"MemUsage": "274.6MiB / 384MiB",
"Name": "mtusi2026lab7-grafana-1",
"NetIO": "1.07MB / 39.9kB",
"PIDs": "111"
},
{
"BlockIO": "3.07MB / 1.04MB",
"CPUPerc": "0.72%",
"Container": "e4e27b3ae65375241ad7f192aa0f82759e7929702cf9cff8082c3560d0366252",
"ID": "e4e27b3ae653",
"MemPerc": "18.65%",
"MemUsage": "71.61MiB / 384MiB",
"Name": "mtusi2026lab7-loki-1",
"NetIO": "529kB / 94.1kB",
"PIDs": "8"
},
{
"BlockIO": "51.4MB / 64.2MB",
"CPUPerc": "1.19%",
"Container": "debd0f0fd4f810ed8edc27351a8d9c6926e8c2e036ed622e8eab21d7bdca0cfd",
"ID": "debd0f0fd4f8",
"MemPerc": "80.38%",
"MemUsage": "308.7MiB / 384MiB",
"Name": "mtusi2026lab7-tempo-1",
"NetIO": "1.18MB / 148kB",
"PIDs": "8"
},
{
"BlockIO": "7.91MB / 0B",
"CPUPerc": "0.71%",
"Container": "29e8dc4c7eec171bcd572b91d52653fb10dd398f0693ec3903a14c02371cb88f",
"ID": "29e8dc4c7eec",
"MemPerc": "28.51%",
"MemUsage": "72.99MiB / 256MiB",
"Name": "mtusi2026lab7-otel-collector-1",
"NetIO": "7.68MB / 3.83MB",
"PIDs": "19"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.38%",
"Container": "bcdeea3ec62786e76b0226e58fd1184fe120855a02732090f0b05771a352a7d6",
"ID": "bcdeea3ec627",
"MemPerc": "17.77%",
"MemUsage": "22.75MiB / 128MiB",
"Name": "mtusi2026lab7-lb-1",
"NetIO": "9.82MB / 10.9MB",
"PIDs": "15"
},
{
"BlockIO": "16.6MB / 7.8MB",
"CPUPerc": "2.15%",
"Container": "ef7ea1912bec58bd1f62c767c4321e5ef98180a479ef9d0d5bd7288517ddcc3a",
"ID": "ef7ea1912bec",
"MemPerc": "5.41%",
"MemUsage": "55.41MiB / 1GiB",
"Name": "mtusi2026lab7-postgres-1",
"NetIO": "4.1MB / 2.19MB",
"PIDs": "15"
},
{
"BlockIO": "15MB / 77.8kB",
"CPUPerc": "0.35%",
"Container": "e5835ee95c53224aed3870c331c7af04d11b209944a12a8694524b20b72acca5",
"ID": "e5835ee95c53",
"MemPerc": "12.86%",
"MemUsage": "16.46MiB / 128MiB",
"Name": "mtusi2026lab7-redis-1",
"NetIO": "128kB / 164kB",
"PIDs": "6"
},
{
"BlockIO": "1.7MB / 184kB",
"CPUPerc": "0.83%",
"Container": "79232cd23eb7cb0d401caffc771bdddf9d26925e069682c6fd89ec434b97b146",
"ID": "79232cd23eb7",
"MemPerc": "34.62%",
"MemUsage": "177.2MiB / 512MiB",
"Name": "mtusi2026lab7-s3-1",
"NetIO": "963kB / 1.28MB",
"PIDs": "9"
}
]
},
{
"repeat": 3,
"accepted": 5,
"ready": 5,
"lost": 0,
"duplicate_jobs": 0,
"variant_records": 20,
"original_checksums_match": true,
"old_identity_rejected": true,
"recovery_seconds": 43.28494662465528,
"observation_errors": 125,
"upload_latency_ms": {
"p50": 18.283792305737734,
"max": 30.815250240266323
},
"restricted_probes": {
"db": {
"ddl_denied": true,
"jobs_read": true,
"messages_read_denied": true,
"mode": "db",
"password_read_denied": true,
"role": "worker",
"session_read_denied": true
},
"s3": {
"forbidden/security-denied": true,
"mode": "s3",
"originals/security-denied": true,
"results_read": true,
"results_write": true,
"role": "worker"
},
"amqp": {
"configure_profile": true,
"mode": "amqp",
"publish_profile": true,
"queue_read": true,
"role": "worker"
}
},
"broad_db_read_and_ddl": true,
"broad_profiles": {
"s3": {
"forbidden/security-denied": true,
"mode": "s3",
"originals/security-denied": true,
"results_read": true,
"results_write": true,
"role": "worker"
},
"amqp": {
"configure_profile": true,
"mode": "amqp",
"publish_profile": true,
"queue_read": true,
"role": "worker"
}
},
"old_s3_key_rejected": true,
"old_broker_identity_rejected": true,
"resource_snapshot": [
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.22%",
"Container": "e56f2477dfc58b1b705c5151a4a48dd371115de300a89a9db127900ba3334f3c",
"ID": "e56f2477dfc5",
"MemPerc": "15.81%",
"MemUsage": "20.23MiB / 128MiB",
"Name": "mtusi2026lab7-s3-tls-1",
"NetIO": "1.01MB / 1.3MB",
"PIDs": "9"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.28%",
"Container": "fd2bbddf84d99c077f5f525076c80d21053765c25405570f4c0057c1f1c9acf7",
"ID": "fd2bbddf84d9",
"MemPerc": "16.52%",
"MemUsage": "21.15MiB / 128MiB",
"Name": "mtusi2026lab7-otel-collector-tls-1",
"NetIO": "8.51MB / 4.26MB",
"PIDs": "9"
},
{
"BlockIO": "10.8MB / 0B",
"CPUPerc": "1.20%",
"Container": "55c1a619dba179163f075c9a50e72eaf37bb9a87bb4a2b4ae968621c13108b3f",
"ID": "55c1a619dba1",
"MemPerc": "36.22%",
"MemUsage": "185.4MiB / 512MiB",
"Name": "mtusi2026lab7-api-2",
"NetIO": "3.24MB / 4.16MB",
"PIDs": "8"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.08%",
"Container": "4a795b20fcbdf066c7f656c0e55de0fbb7dcf24dceb073fe0f29496946d20a02",
"ID": "4a795b20fcbd",
"MemPerc": "1.09%",
"MemUsage": "11.18MiB / 1GiB",
"Name": "mtusi2026lab7-worker-1",
"NetIO": "668kB / 811kB",
"PIDs": "8"
},
{
"BlockIO": "4.1kB / 0B",
"CPUPerc": "0.96%",
"Container": "ddc8ca7b147898e9d1ac4f9b7219ee2f8905bd2921df64181ffee02ba6cb97c0",
"ID": "ddc8ca7b1478",
"MemPerc": "2.78%",
"MemUsage": "14.25MiB / 512MiB",
"Name": "mtusi2026lab7-dispatcher-1",
"NetIO": "1.23MB / 2.22MB",
"PIDs": "8"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.40%",
"Container": "1292b6fbbd2a01262923490e3dd18bd64e253c326aa0834f9db53ae247fb18a9",
"ID": "1292b6fbbd2a",
"MemPerc": "34.93%",
"MemUsage": "178.8MiB / 512MiB",
"Name": "mtusi2026lab7-api-1",
"NetIO": "2.59MB / 3.59MB",
"PIDs": "8"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.12%",
"Container": "08cf52574facd688fb2497bdd32dcc3cb55c83b9814ea215e0f3a2cd50170b5a",
"ID": "08cf52574fac",
"MemPerc": "15.76%",
"MemUsage": "20.18MiB / 128MiB",
"Name": "mtusi2026lab7-tempo-tls-1",
"NetIO": "1.31MB / 164kB",
"PIDs": "9"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.09%",
"Container": "6ce0529bded56716bb6f3df214263b6cc6bf62bdf0defeba7e1f31d5b798e261",
"ID": "6ce0529bded5",
"MemPerc": "16.53%",
"MemUsage": "21.16MiB / 128MiB",
"Name": "mtusi2026lab7-prometheus-tls-1",
"NetIO": "1.36MB / 131kB",
"PIDs": "9"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.12%",
"Container": "9d289263bdf85dd8527aa2f2e5f712e288224d43cf263f933dc5b4b0ea7767c5",
"ID": "9d289263bdf8",
"MemPerc": "16.36%",
"MemUsage": "20.94MiB / 128MiB",
"Name": "mtusi2026lab7-loki-tls-1",
"NetIO": "589kB / 104kB",
"PIDs": "9"
},
{
"BlockIO": "3.53MB / 594kB",
"CPUPerc": "49.70%",
"Container": "be47e533bc90852ec009a15c8f2e9d8bfaed3dfeaa73e80e8a03191e2e3370c1",
"ID": "be47e533bc90",
"MemPerc": "33.90%",
"MemUsage": "173.6MiB / 512MiB",
"Name": "mtusi2026lab7-broker-1",
"NetIO": "2.29MB / 2.23MB",
"PIDs": "96"
},
{
"BlockIO": "31.5MB / 2.01MB",
"CPUPerc": "0.29%",
"Container": "26d14907a8d04095b62ae9b92073e9743526ad3d94e7fe58b89d2480b0a6baa8",
"ID": "26d14907a8d0",
"MemPerc": "24.05%",
"MemUsage": "92.35MiB / 384MiB",
"Name": "mtusi2026lab7-prometheus-1",
"NetIO": "1.36MB / 131kB",
"PIDs": "7"
},
{
"BlockIO": "47.1MB / 3.51MB",
"CPUPerc": "0.35%",
"Container": "56dc536779db92bf8a1841c4b7e235a028c85a1a3b98f6227c28e2d8d847f6a7",
"ID": "56dc536779db",
"MemPerc": "21.39%",
"MemUsage": "54.77MiB / 256MiB",
"Name": "mtusi2026lab7-openbao-1",
"NetIO": "753kB / 1.03MB",
"PIDs": "19"
},
{
"BlockIO": "546MB / 4.15MB",
"CPUPerc": "0.66%",
"Container": "adeb6ec904706c78545c39ed621c7484b74a1b277a02d6f88e989b5100a66262",
"ID": "adeb6ec90470",
"MemPerc": "71.57%",
"MemUsage": "274.8MiB / 384MiB",
"Name": "mtusi2026lab7-grafana-1",
"NetIO": "1.07MB / 39.9kB",
"PIDs": "111"
},
{
"BlockIO": "3.07MB / 1.24MB",
"CPUPerc": "0.53%",
"Container": "e4e27b3ae65375241ad7f192aa0f82759e7929702cf9cff8082c3560d0366252",
"ID": "e4e27b3ae653",
"MemPerc": "18.71%",
"MemUsage": "71.84MiB / 384MiB",
"Name": "mtusi2026lab7-loki-1",
"NetIO": "589kB / 104kB",
"PIDs": "8"
},
{
"BlockIO": "51.4MB / 64.7MB",
"CPUPerc": "0.33%",
"Container": "debd0f0fd4f810ed8edc27351a8d9c6926e8c2e036ed622e8eab21d7bdca0cfd",
"ID": "debd0f0fd4f8",
"MemPerc": "80.41%",
"MemUsage": "308.8MiB / 384MiB",
"Name": "mtusi2026lab7-tempo-1",
"NetIO": "1.31MB / 164kB",
"PIDs": "8"
},
{
"BlockIO": "7.91MB / 0B",
"CPUPerc": "0.66%",
"Container": "29e8dc4c7eec171bcd572b91d52653fb10dd398f0693ec3903a14c02371cb88f",
"ID": "29e8dc4c7eec",
"MemPerc": "29.66%",
"MemUsage": "75.93MiB / 256MiB",
"Name": "mtusi2026lab7-otel-collector-1",
"NetIO": "8.51MB / 4.26MB",
"PIDs": "19"
},
{
"BlockIO": "0B / 0B",
"CPUPerc": "0.39%",
"Container": "bcdeea3ec62786e76b0226e58fd1184fe120855a02732090f0b05771a352a7d6",
"ID": "bcdeea3ec627",
"MemPerc": "17.62%",
"MemUsage": "22.55MiB / 128MiB",
"Name": "mtusi2026lab7-lb-1",
"NetIO": "11.9MB / 13.2MB",
"PIDs": "15"
},
{
"BlockIO": "16.6MB / 8.81MB",
"CPUPerc": "1.49%",
"Container": "ef7ea1912bec58bd1f62c767c4321e5ef98180a479ef9d0d5bd7288517ddcc3a",
"ID": "ef7ea1912bec",
"MemPerc": "5.47%",
"MemUsage": "55.98MiB / 1GiB",
"Name": "mtusi2026lab7-postgres-1",
"NetIO": "4.54MB / 2.46MB",
"PIDs": "15"
},
{
"BlockIO": "15.1MB / 94.2kB",
"CPUPerc": "0.27%",
"Container": "e5835ee95c53224aed3870c331c7af04d11b209944a12a8694524b20b72acca5",
"ID": "e5835ee95c53",
"MemPerc": "12.72%",
"MemUsage": "16.28MiB / 128MiB",
"Name": "mtusi2026lab7-redis-1",
"NetIO": "138kB / 174kB",
"PIDs": "6"
},
{
"BlockIO": "1.2MB / 213kB",
"CPUPerc": "1.10%",
"Container": "79232cd23eb7cb0d401caffc771bdddf9d26925e069682c6fd89ec434b97b146",
"ID": "79232cd23eb7",
"MemPerc": "33.28%",
"MemUsage": "170.4MiB / 512MiB",
"Name": "mtusi2026lab7-s3-1",
"NetIO": "1.01MB / 1.3MB",
"PIDs": "8"
}
]
}
],
"limitations": [
"Authorized worker can damage its permitted job metadata and object prefixes.",
"This experiment does not claim integrity after malicious modification of those authorized resources.",
"Single Docker host; no host/DB/LB high availability."
]
}
+4
View File
@@ -5,3 +5,7 @@
В REPORT.md сопоставьте роль → service name → версия/digest → health/readiness → volume → сеть/порт → способ передачи credentials. Приведите bootstrap (schema, bucket, broker topology, а с lab6 provisioning) и безопасное повторение этих команд.
Приложение строится из исходников. Не используйте заранее существующий образ преподавательского сервера вместо своей реализации. Restart hook перезапускает все соответствующие stores с volumes; failover hook останавливает только заданную API-реплику.
## Реализация lab7
Топология находится в корневом `compose.yaml` (JSON является допустимым YAML). Начальная команда — `make up`; полная инструкция и версии — в [REPORT.md](../REPORT.md). TLS boundaries генерируются `infra/generate.py` и хранятся как открытые Envoy configurations. Runtime credentials, private keys и Grafana secure provisioning создаются только в игнорируемом `secrets/`.
+216
View File
@@ -0,0 +1,216 @@
{
"static_resources": {
"listeners": [
{
"name": "loki",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 9443
}
},
"filter_chains": [
{
"transport_socket": {
"name": "envoy.transport_sockets.tls",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
"require_client_certificate": true,
"common_tls_context": {
"tls_params": {
"tls_minimum_protocol_version": "TLSv1_2"
},
"tls_certificates": [
{
"certificate_chain": {
"filename": "/run/identity/tls.crt"
},
"private_key": {
"filename": "/run/identity/tls.key"
}
}
],
"validation_context": {
"trusted_ca": {
"filename": "/run/identity/ca.crt"
},
"crl": {
"filename": "/run/identity/ca.crl"
},
"match_typed_subject_alt_names": [
{
"san_type": "DNS",
"matcher": {
"exact": "otel-collector"
}
},
{
"san_type": "DNS",
"matcher": {
"exact": "grafana"
}
}
]
}
}
}
},
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "loki",
"codec_type": "AUTO",
"route_config": {
"name": "routes",
"virtual_hosts": [
{
"name": "local",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "loki",
"timeout": "125s"
}
}
]
}
]
},
"http_filters": [
{
"name": "envoy.filters.http.rbac",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBAC",
"rules": {
"action": "ALLOW",
"policies": {
"otel-collector": {
"principals": [
{
"authenticated": {
"principal_name": {
"exact": "otel-collector"
}
}
}
],
"permissions": [
{
"and_rules": {
"rules": [
{
"header": {
"name": ":method",
"string_match": {
"safe_regex": {
"regex": "^(POST)$"
}
}
}
},
{
"url_path": {
"path": {
"safe_regex": {
"regex": "^/otlp/v1/logs$"
}
}
}
}
]
}
}
]
},
"grafana": {
"principals": [
{
"authenticated": {
"principal_name": {
"exact": "grafana"
}
}
}
],
"permissions": [
{
"and_rules": {
"rules": [
{
"header": {
"name": ":method",
"string_match": {
"safe_regex": {
"regex": "^(GET)$"
}
}
}
},
{
"url_path": {
"path": {
"safe_regex": {
"regex": "^/(loki/api/v1/.*|ready)$"
}
}
}
}
]
}
}
]
}
}
}
}
},
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
}
],
"clusters": [
{
"name": "loki",
"connect_timeout": "1s",
"type": "STATIC",
"load_assignment": {
"cluster_name": "loki",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 3100
}
}
}
}
]
}
]
}
}
]
}
}
+365
View File
@@ -0,0 +1,365 @@
{
"static_resources": {
"listeners": [
{
"name": "otlp",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 9443
}
},
"filter_chains": [
{
"transport_socket": {
"name": "envoy.transport_sockets.tls",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
"require_client_certificate": true,
"common_tls_context": {
"tls_params": {
"tls_minimum_protocol_version": "TLSv1_2"
},
"tls_certificates": [
{
"certificate_chain": {
"filename": "/run/identity/tls.crt"
},
"private_key": {
"filename": "/run/identity/tls.key"
}
}
],
"validation_context": {
"trusted_ca": {
"filename": "/run/identity/ca.crt"
},
"crl": {
"filename": "/run/identity/ca.crl"
},
"match_typed_subject_alt_names": [
{
"san_type": "DNS",
"matcher": {
"exact": "api"
}
},
{
"san_type": "DNS",
"matcher": {
"exact": "worker"
}
},
{
"san_type": "DNS",
"matcher": {
"exact": "dispatcher"
}
}
]
}
}
}
},
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "otlp",
"codec_type": "AUTO",
"route_config": {
"name": "routes",
"virtual_hosts": [
{
"name": "local",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "otlp",
"timeout": "125s"
}
}
]
}
]
},
"http_filters": [
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
},
{
"name": "metrics",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 9444
}
},
"filter_chains": [
{
"transport_socket": {
"name": "envoy.transport_sockets.tls",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
"require_client_certificate": true,
"common_tls_context": {
"tls_params": {
"tls_minimum_protocol_version": "TLSv1_2"
},
"tls_certificates": [
{
"certificate_chain": {
"filename": "/run/identity/tls.crt"
},
"private_key": {
"filename": "/run/identity/tls.key"
}
}
],
"validation_context": {
"trusted_ca": {
"filename": "/run/identity/ca.crt"
},
"crl": {
"filename": "/run/identity/ca.crl"
},
"match_typed_subject_alt_names": [
{
"san_type": "DNS",
"matcher": {
"exact": "prometheus"
}
}
]
}
}
}
},
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "metrics",
"codec_type": "AUTO",
"route_config": {
"name": "routes",
"virtual_hosts": [
{
"name": "local",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "metrics",
"timeout": "125s"
}
}
]
}
]
},
"http_filters": [
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
},
{
"name": "collector-metrics",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 9445
}
},
"filter_chains": [
{
"transport_socket": {
"name": "envoy.transport_sockets.tls",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
"require_client_certificate": true,
"common_tls_context": {
"tls_params": {
"tls_minimum_protocol_version": "TLSv1_2"
},
"tls_certificates": [
{
"certificate_chain": {
"filename": "/run/identity/tls.crt"
},
"private_key": {
"filename": "/run/identity/tls.key"
}
}
],
"validation_context": {
"trusted_ca": {
"filename": "/run/identity/ca.crt"
},
"crl": {
"filename": "/run/identity/ca.crl"
},
"match_typed_subject_alt_names": [
{
"san_type": "DNS",
"matcher": {
"exact": "prometheus"
}
}
]
}
}
}
},
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "collector-metrics",
"codec_type": "AUTO",
"route_config": {
"name": "routes",
"virtual_hosts": [
{
"name": "local",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "collector-metrics",
"timeout": "125s"
}
}
]
}
]
},
"http_filters": [
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
}
],
"clusters": [
{
"name": "otlp",
"connect_timeout": "1s",
"type": "STATIC",
"load_assignment": {
"cluster_name": "otlp",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 4318
}
}
}
}
]
}
]
}
},
{
"name": "metrics",
"connect_timeout": "1s",
"type": "STATIC",
"load_assignment": {
"cluster_name": "metrics",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 8889
}
}
}
}
]
}
]
}
},
{
"name": "collector-metrics",
"connect_timeout": "1s",
"type": "STATIC",
"load_assignment": {
"cluster_name": "collector-metrics",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 8888
}
}
}
}
]
}
]
}
}
]
}
}
+172
View File
@@ -0,0 +1,172 @@
{
"static_resources": {
"listeners": [
{
"name": "query",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 9443
}
},
"filter_chains": [
{
"transport_socket": {
"name": "envoy.transport_sockets.tls",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
"require_client_certificate": true,
"common_tls_context": {
"tls_params": {
"tls_minimum_protocol_version": "TLSv1_2"
},
"tls_certificates": [
{
"certificate_chain": {
"filename": "/run/identity/tls.crt"
},
"private_key": {
"filename": "/run/identity/tls.key"
}
}
],
"validation_context": {
"trusted_ca": {
"filename": "/run/identity/ca.crt"
},
"crl": {
"filename": "/run/identity/ca.crl"
},
"match_typed_subject_alt_names": [
{
"san_type": "DNS",
"matcher": {
"exact": "grafana"
}
}
]
}
}
}
},
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "query",
"codec_type": "AUTO",
"route_config": {
"name": "routes",
"virtual_hosts": [
{
"name": "local",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "query",
"timeout": "125s"
}
}
]
}
]
},
"http_filters": [
{
"name": "envoy.filters.http.rbac",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBAC",
"rules": {
"action": "ALLOW",
"policies": {
"grafana": {
"principals": [
{
"authenticated": {
"principal_name": {
"exact": "grafana"
}
}
}
],
"permissions": [
{
"and_rules": {
"rules": [
{
"header": {
"name": ":method",
"string_match": {
"safe_regex": {
"regex": "^(GET|POST)$"
}
}
}
},
{
"url_path": {
"path": {
"safe_regex": {
"regex": "^/(api/v1/(query|query_range|labels|label/[^/]+/values|series|metadata|status/buildinfo)|-/ready).*"
}
}
}
}
]
}
}
]
}
}
}
}
},
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
}
],
"clusters": [
{
"name": "query",
"connect_timeout": "1s",
"type": "STATIC",
"load_assignment": {
"cluster_name": "query",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 9090
}
}
}
}
]
}
]
}
}
]
}
}
+135
View File
@@ -0,0 +1,135 @@
{
"static_resources": {
"listeners": [
{
"name": "s3",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 9443
}
},
"filter_chains": [
{
"transport_socket": {
"name": "envoy.transport_sockets.tls",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
"require_client_certificate": true,
"common_tls_context": {
"tls_params": {
"tls_minimum_protocol_version": "TLSv1_2"
},
"tls_certificates": [
{
"certificate_chain": {
"filename": "/run/identity/tls.crt"
},
"private_key": {
"filename": "/run/identity/tls.key"
}
}
],
"validation_context": {
"trusted_ca": {
"filename": "/run/identity/ca.crt"
},
"crl": {
"filename": "/run/identity/ca.crl"
},
"match_typed_subject_alt_names": [
{
"san_type": "DNS",
"matcher": {
"exact": "api"
}
},
{
"san_type": "DNS",
"matcher": {
"exact": "worker"
}
},
{
"san_type": "DNS",
"matcher": {
"exact": "operator-client"
}
}
]
}
}
}
},
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "s3",
"codec_type": "AUTO",
"route_config": {
"name": "routes",
"virtual_hosts": [
{
"name": "local",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "s3",
"timeout": "125s"
}
}
]
}
]
},
"http_filters": [
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
}
],
"clusters": [
{
"name": "s3",
"connect_timeout": "1s",
"type": "STATIC",
"load_assignment": {
"cluster_name": "s3",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 9000
}
}
}
}
]
}
]
}
}
]
}
}
+238
View File
@@ -0,0 +1,238 @@
{
"static_resources": {
"listeners": [
{
"name": "query",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 9443
}
},
"filter_chains": [
{
"transport_socket": {
"name": "envoy.transport_sockets.tls",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
"require_client_certificate": true,
"common_tls_context": {
"tls_params": {
"tls_minimum_protocol_version": "TLSv1_2"
},
"tls_certificates": [
{
"certificate_chain": {
"filename": "/run/identity/tls.crt"
},
"private_key": {
"filename": "/run/identity/tls.key"
}
}
],
"validation_context": {
"trusted_ca": {
"filename": "/run/identity/ca.crt"
},
"crl": {
"filename": "/run/identity/ca.crl"
},
"match_typed_subject_alt_names": [
{
"san_type": "DNS",
"matcher": {
"exact": "grafana"
}
}
]
}
}
}
},
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "query",
"codec_type": "AUTO",
"route_config": {
"name": "routes",
"virtual_hosts": [
{
"name": "local",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "query",
"timeout": "125s"
}
}
]
}
]
},
"http_filters": [
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
},
{
"name": "ingest",
"address": {
"socket_address": {
"address": "0.0.0.0",
"port_value": 9444
}
},
"filter_chains": [
{
"transport_socket": {
"name": "envoy.transport_sockets.tls",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext",
"require_client_certificate": true,
"common_tls_context": {
"tls_params": {
"tls_minimum_protocol_version": "TLSv1_2"
},
"tls_certificates": [
{
"certificate_chain": {
"filename": "/run/identity/tls.crt"
},
"private_key": {
"filename": "/run/identity/tls.key"
}
}
],
"validation_context": {
"trusted_ca": {
"filename": "/run/identity/ca.crt"
},
"crl": {
"filename": "/run/identity/ca.crl"
},
"match_typed_subject_alt_names": [
{
"san_type": "DNS",
"matcher": {
"exact": "otel-collector"
}
}
]
}
}
}
},
"filters": [
{
"name": "envoy.filters.network.http_connection_manager",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager",
"stat_prefix": "ingest",
"codec_type": "AUTO",
"route_config": {
"name": "routes",
"virtual_hosts": [
{
"name": "local",
"domains": [
"*"
],
"routes": [
{
"match": {
"prefix": "/"
},
"route": {
"cluster": "ingest",
"timeout": "125s"
}
}
]
}
]
},
"http_filters": [
{
"name": "envoy.filters.http.router",
"typed_config": {
"@type": "type.googleapis.com/envoy.extensions.filters.http.router.v3.Router"
}
}
]
}
}
]
}
]
}
],
"clusters": [
{
"name": "query",
"connect_timeout": "1s",
"type": "STATIC",
"load_assignment": {
"cluster_name": "query",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 3200
}
}
}
}
]
}
]
}
},
{
"name": "ingest",
"connect_timeout": "1s",
"type": "STATIC",
"load_assignment": {
"cluster_name": "ingest",
"endpoints": [
{
"lb_endpoints": [
{
"endpoint": {
"address": {
"socket_address": {
"address": "127.0.0.1",
"port_value": 4318
}
}
}
}
]
}
]
}
}
]
}
}
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
"""Generate deterministic public Envoy TLS boundaries (JSON is valid YAML)."""
import json
from pathlib import Path
ROOT=Path(__file__).resolve().parent
def generate(name,listeners):
result={'static_resources':{'listeners':[],'clusters':[]}}
for label,port,upstream,identities in listeners:
tls={'@type':'type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext','require_client_certificate':True,'common_tls_context':{'tls_params':{'tls_minimum_protocol_version':'TLSv1_2'},'tls_certificates':[{'certificate_chain':{'filename':'/run/identity/tls.crt'},'private_key':{'filename':'/run/identity/tls.key'}}], 'validation_context':{'trusted_ca':{'filename':'/run/identity/ca.crt'},'crl':{'filename':'/run/identity/ca.crl'},'match_typed_subject_alt_names':[{'san_type':'DNS','matcher':{'exact':i}} for i in identities]}}}
route={'name':'routes','virtual_hosts':[{'name':'local','domains':['*'],'routes':[{'match':{'prefix':'/'},'route':{'cluster':label,'timeout':'125s'}}]}]}
filters=[]
if name in ['loki','prometheus']:
rules={}
for identity in identities:
methods=['GET','POST'] if identity=='grafana' and name=='prometheus' else ['GET'] if identity=='grafana' else ['POST']
pattern='^/(api/v1/(query|query_range|labels|label/[^/]+/values|series|metadata|status/buildinfo)|-/ready).*' if name=='prometheus' else '^/(loki/api/v1/.*|ready)$' if identity=='grafana' else '^/otlp/v1/logs$'
rules[identity]={'principals':[{'authenticated':{'principal_name':{'exact':identity}}}],'permissions':[{'and_rules':{'rules':[{'header':{'name':':method','string_match':{'safe_regex':{'regex':'^('+'|'.join(methods)+')$'}}}},{'url_path':{'path':{'safe_regex':{'regex':pattern}}}}]}}]}
filters.append({'name':'envoy.filters.http.rbac','typed_config':{'@type':'type.googleapis.com/envoy.extensions.filters.http.rbac.v3.RBAC','rules':{'action':'ALLOW','policies':rules}}})
filters.append({'name':'envoy.filters.http.router','typed_config':{'@type':'type.googleapis.com/envoy.extensions.filters.http.router.v3.Router'}})
hcm={'@type':'type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager','stat_prefix':label,'codec_type':'AUTO','route_config':route,'http_filters':filters}
result['static_resources']['listeners'].append({'name':label,'address':{'socket_address':{'address':'0.0.0.0','port_value':port}},'filter_chains':[{'transport_socket':{'name':'envoy.transport_sockets.tls','typed_config':tls},'filters':[{'name':'envoy.filters.network.http_connection_manager','typed_config':hcm}]}]})
result['static_resources']['clusters'].append({'name':label,'connect_timeout':'1s','type':'STATIC','load_assignment':{'cluster_name':label,'endpoints':[{'lb_endpoints':[{'endpoint':{'address':{'socket_address':{'address':'127.0.0.1','port_value':upstream}}}}]}]}})
(ROOT/'envoy'/f'{name}.json').write_text(json.dumps(result,indent=2)+'\n')
for name,ls in {
's3':[('s3',9443,9000,['api','worker','operator-client'])],
'otel-collector':[('otlp',9443,4318,['api','worker','dispatcher']),('metrics',9444,8889,['prometheus']),('collector-metrics',9445,8888,['prometheus'])],
'loki':[('loki',9443,3100,['otel-collector','grafana'])],
'tempo':[('query',9443,3200,['grafana']),('ingest',9444,4318,['otel-collector'])],
'prometheus':[('query',9443,9090,['grafana'])],
}.items():generate(name,ls)
+31
View File
@@ -0,0 +1,31 @@
global
maxconn 1024
stats socket /tmp/haproxy.sock mode 600 level admin
ssl-default-bind-options ssl-min-ver TLSv1.2
ssl-default-server-options ssl-min-ver TLSv1.2
defaults
mode http
timeout connect 1s
timeout client 125s
timeout server 125s
timeout check 1s
retries 0
resolvers docker
nameserver dns 127.0.0.11:53
hold valid 1s
hold obsolete 1s
frontend public
bind :8443 ssl crt /run/identity/bundle.pem
http-request deny deny_status 404 if { path_beg /internal }
http-request set-header X-Forwarded-For %[src]
default_backend api
backend api
balance roundrobin
option httpchk
http-check send meth GET uri /health/ready ver HTTP/1.1 hdr Host api
http-check expect status 200
server-template replica 1-4 api:8080 ssl verify required ca-file /run/identity/ca.crt crt /run/identity/bundle.pem verifyhost api sni str(api) check inter 1s fall 2 rise 1 resolvers docker init-addr none
+13
View File
@@ -0,0 +1,13 @@
<policymap>
<policy domain="delegate" rights="none" pattern="*"/>
<policy domain="filter" rights="none" pattern="*"/>
<policy domain="coder" rights="none" pattern="*"/>
<policy domain="coder" rights="read|write" pattern="{PNG,JPEG,WEBP,NULL}"/>
<policy domain="resource" name="memory" value="256MiB"/>
<policy domain="resource" name="map" value="0"/>
<policy domain="resource" name="disk" value="256MiB"/>
<policy domain="resource" name="thread" value="1"/>
<policy domain="resource" name="time" value="60"/>
<policy domain="resource" name="list-length" value="4"/>
<policy domain="path" rights="none" pattern="@*"/>
</policymap>
+4
View File
@@ -5,3 +5,7 @@
Решение должно показать реальную сервисную аутентификацию и получение нужного secret по ограниченной policy; просто работающий контейнер OpenBao не засчитывается. На 3 статический KV secret допустим. На 4 покажите expiry/renewal/rotation и allow/deny. Путь KV v2 data/metadata и ACL должен соответствовать фактическому mount; не копируйте широкое `path "*"` для приложения.
Документируйте шаги оператора init/unseal и восстановление после restart. Скрипт не должен печатать tokens/shares или хранить их в Git. См. contracts/trust-matrix.md и REPORT.md.
## Реализованный workflow
`server.hcl` задаёт persistent file storage, TLS и declarative audit. Отдельные API/worker/dispatcher policies находятся рядом. `scripts/bao.py` делает operator init/unseal и provisioning; начальный root token отзывается после успеха. Приложение использует cert auth, scoped KV и dynamic database credentials. CA key и unseal shares не монтируются сервисам. После restart оператор выполняет `python3 scripts/bao.py unseal`; recovery и отказ sealed проверяются отдельным сценарием. Подробности и ограничения — в [REPORT.md](../../REPORT.md).
+5
View File
@@ -0,0 +1,5 @@
path "secret/data/api" { capabilities = ["read"] }
path "database/creds/api" { capabilities = ["read"] }
path "auth/token/renew-self" { capabilities = ["update"] }
path "auth/token/revoke-self" { capabilities = ["update"] }
path "sys/leases/renew" { capabilities = ["update"] }
+5
View File
@@ -0,0 +1,5 @@
path "secret/data/dispatcher" { capabilities = ["read"] }
path "database/creds/dispatcher" { capabilities = ["read"] }
path "auth/token/renew-self" { capabilities = ["update"] }
path "auth/token/revoke-self" { capabilities = ["update"] }
path "sys/leases/renew" { capabilities = ["update"] }
+14
View File
@@ -0,0 +1,14 @@
ui = false
api_addr = "https://openbao:8200"
storage "file" { path = "/openbao/data" }
listener "tcp" {
address = "0.0.0.0:8200"
tls_cert_file = "/run/identity/tls.crt"
tls_key_file = "/run/identity/tls.key"
tls_client_ca_file = "/run/identity/ca.crt"
tls_min_version = "tls12"
}
audit "file" "local" {
options { file_path = "/openbao/data/audit.json" }
}
+5
View File
@@ -0,0 +1,5 @@
path "secret/data/worker" { capabilities = ["read"] }
path "database/creds/worker" { capabilities = ["read"] }
path "auth/token/renew-self" { capabilities = ["update"] }
path "auth/token/revoke-self" { capabilities = ["update"] }
path "sys/leases/renew" { capabilities = ["update"] }
+4
View File
@@ -5,3 +5,7 @@
Добавьте конфигурации storage, Grafana provisioning/datasources, provisioning/dashboards и импортируемые dashboard JSON. На 4 — alert rules и runbooks. Пустой dashboard или debug exporter, который только печатает данные в stdout, не заменяют хранилища/доказательства из `contracts/observability.md`.
Не публикуйте OTLP/metrics/административные ports в общую сеть без необходимости. В lab7 реализуйте TLS/mTLS по trust matrix; экспорт Authorization и message bodies запрещён.
## Реализованный workflow
Collector принимает OTLP через mTLS Envoy boundary; plaintext receiver доступен только по loopback. Prometheus/Loki/Tempo и Grafana используют проверяемый TLS с разными identities и ingest/query restrictions. Dashboard/alerts — в этом каталоге; secure datasource provisioning создаёт bootstrap вне Git. Проверка реальных сигналов — `scripts/prove-telemetry.py`, диагностика — [RUNBOOK.md](RUNBOOK.md).
+13
View File
@@ -0,0 +1,13 @@
# Диагностика lab7
Grafana доступна по HTTPS на localhost:13443. CA — локальный lab7 CA; anonymous выключен. Datasource client identity и trust material генерируются в закрытом secrets-каталоге, исходные dashboard и alert rules находятся в Git.
Сначала проверить свежесть observation metrics и `up`, затем HTTP 5xx/p95, backlog/oldest age, DB pool и worker busy/capacity. Trace ID связывает upload/publish/consume/S3/DB с логами; request ID связывает HTTP-ошибку. Пропуск telemetry не означает нулевой backlog.
При остановке worker API продолжает durable acceptance, растут backlog/age и QueueLag; после запуска backlog снижается. При отказе DB возрастают 5xx и DB spans/errors; при исчерпании pool readiness уходит в 503. При отказе Tempo/Loki SDK и Collector используют ограниченные queues/retry; API не делает эти backend критичными для readiness. Grafana также не влияет на readiness.
Если TLS proxy не отвечает после рестарта backend, пересоздать соответствующий `*-tls` service: он должен войти в новый network namespace родителя. Не открывать backend plaintext listener на bridge. Проверить CA/SAN, срок leaf и актуальность CRL; не использовать insecure mode.
При sealed OpenBao действующие grants используются до ограниченного deadline; затем процесс завершает операции и restart требует нового cert auth. Оператор выполняет `python3 scripts/bao.py unseal`, проверяет readiness и новый lease. При компрометации worker использовать `scripts/rotate-worker.py`, затем проверить jobs/checksums и старые credentials.
Пороговые условия и окна alerts перенесены из lab6. CPU/RAM и error ratios интерпретировать в пределах synthetic profile и фактических limits из Compose.
+126
View File
@@ -0,0 +1,126 @@
{
"groups": [
{
"name": "messenger-slo",
"interval": "5s",
"rules": [
{
"record": "messenger:api_error_ratio:1m",
"expr": "(sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\",status_class=\"5xx\"}[1m])) or vector(0)) / sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\"}[1m]))"
},
{
"record": "messenger:api_error_ratio:2m",
"expr": "(sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\",status_class=\"5xx\"}[2m])) or vector(0)) / sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\"}[2m]))"
},
{
"record": "messenger:api_error_ratio:5m",
"expr": "(sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\",status_class=\"5xx\"}[5m])) or vector(0)) / sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\"}[5m]))"
},
{
"record": "messenger:api_error_ratio:10m",
"expr": "(sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\",status_class=\"5xx\"}[10m])) or vector(0)) / sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\"}[10m]))"
},
{
"alert": "ApiBurnRateFast",
"expr": "(messenger:api_error_ratio:1m > 0.06) and (messenger:api_error_ratio:5m > 0.06) and (sum(increase(messenger_http_requests_total{route=~\"/api/v1/.*\"}[1m])) >= 20)",
"for": "20s",
"labels": {
"severity": "warning",
"slo": "api"
},
"annotations": {
"summary": "api SLO budget burning above 6x",
"runbook": "infra/otel/RUNBOOK.md"
}
},
{
"alert": "ApiBurnRateSlow",
"expr": "(messenger:api_error_ratio:2m > 0.03) and (messenger:api_error_ratio:10m > 0.03) and (sum(increase(messenger_http_requests_total{route=~\"/api/v1/.*\"}[2m])) >= 20)",
"for": "30s",
"labels": {
"severity": "warning",
"slo": "api"
},
"annotations": {
"summary": "api SLO budget burning above 3x",
"runbook": "infra/otel/RUNBOOK.md"
}
},
{
"record": "messenger:ready_error_ratio:1m",
"expr": "sum(rate(messenger_ready_slo_total{outcome=\"bad\"}[1m])) / sum(rate(messenger_ready_slo_total[1m]))"
},
{
"record": "messenger:ready_error_ratio:2m",
"expr": "sum(rate(messenger_ready_slo_total{outcome=\"bad\"}[2m])) / sum(rate(messenger_ready_slo_total[2m]))"
},
{
"record": "messenger:ready_error_ratio:5m",
"expr": "sum(rate(messenger_ready_slo_total{outcome=\"bad\"}[5m])) / sum(rate(messenger_ready_slo_total[5m]))"
},
{
"record": "messenger:ready_error_ratio:10m",
"expr": "sum(rate(messenger_ready_slo_total{outcome=\"bad\"}[10m])) / sum(rate(messenger_ready_slo_total[10m]))"
},
{
"alert": "ReadyBurnRateFast",
"expr": "(messenger:ready_error_ratio:1m > 0.06) and (messenger:ready_error_ratio:5m > 0.06) and (sum(increase(messenger_ready_slo_total[1m])) >= 5)",
"for": "20s",
"labels": {
"severity": "warning",
"slo": "ready"
},
"annotations": {
"summary": "ready SLO budget burning above 6x",
"runbook": "infra/otel/RUNBOOK.md"
}
},
{
"alert": "ReadyBurnRateSlow",
"expr": "(messenger:ready_error_ratio:2m > 0.03) and (messenger:ready_error_ratio:10m > 0.03) and (sum(increase(messenger_ready_slo_total[2m])) >= 5)",
"for": "30s",
"labels": {
"severity": "warning",
"slo": "ready"
},
"annotations": {
"summary": "ready SLO budget burning above 3x",
"runbook": "infra/otel/RUNBOOK.md"
}
},
{
"alert": "QueueLag",
"expr": "max(messenger_queue_oldest_age_seconds) > 30",
"for": "20s",
"labels": {
"severity": "warning"
},
"annotations": {
"summary": "Unfinished attachment age exceeds 30s",
"runbook": "infra/otel/RUNBOOK.md"
}
},
{
"alert": "ObservationsStale",
"expr": "time() - max(messenger_observation_timestamp) > 20 or absent(messenger_observation_timestamp)",
"for": "20s",
"labels": {
"severity": "warning"
},
"annotations": {
"summary": "No fresh dispatcher observations",
"runbook": "infra/otel/RUNBOOK.md"
}
},
{
"record": "messenger:api_error_ratio:1h",
"expr": "(sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\",status_class=\"5xx\"}[1h])) or vector(0)) / sum(rate(messenger_http_requests_total{route=~\"/api/v1/.*\"}[1h]))"
},
{
"record": "messenger:ready_error_ratio:1h",
"expr": "sum(rate(messenger_ready_slo_total{outcome=\"bad\"}[1h])) / sum(rate(messenger_ready_slo_total[1h]))"
}
]
}
]
}
+73
View File
@@ -0,0 +1,73 @@
receivers:
otlp:
protocols:
http:
endpoint: 127.0.0.1:4318
processors:
memory_limiter:
check_interval: 1s
limit_mib: 180
spike_limit_mib: 40
batch:
timeout: 1s
send_batch_size: 128
send_batch_max_size: 256
exporters:
prometheus:
endpoint: 127.0.0.1:8889
resource_to_telemetry_conversion:
enabled: true
otlphttp/tempo:
tls:
ca_file: /run/identity/ca.crt
cert_file: /run/identity/tls.crt
key_file: /run/identity/tls.key
endpoint: https://tempo:9444
timeout: 2s
retry_on_failure:
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 30s
sending_queue:
queue_size: 32
num_consumers: 2
otlphttp/loki:
tls:
ca_file: /run/identity/ca.crt
cert_file: /run/identity/tls.crt
key_file: /run/identity/tls.key
endpoint: https://loki:9443/otlp
timeout: 2s
retry_on_failure:
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 30s
sending_queue:
queue_size: 32
num_consumers: 2
extensions:
health_check:
endpoint: 127.0.0.1:13133
service:
telemetry:
metrics:
readers:
- pull:
exporter:
prometheus:
host: 127.0.0.1
port: 8888
extensions: [health_check]
pipelines:
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [prometheus]
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlphttp/tempo]
logs:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlphttp/loki]
+770
View File
@@ -0,0 +1,770 @@
{
"uid": "messenger-lab6",
"title": "Messenger \u2014 lab6",
"schemaVersion": 39,
"version": 2,
"refresh": "5s",
"time": {
"from": "now-30m",
"to": "now"
},
"panels": [
{
"id": 1,
"title": "HTTP RPS",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "sum by (route) (rate(messenger_http_requests_total[1m]))",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "reqps"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 2,
"title": "HTTP 5xx ratio",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 0,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "messenger:api_error_ratio:1m",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 3,
"title": "HTTP p50/p95/p99",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "0.5",
"expr": "histogram_quantile(0.5,sum by (le)(rate(messenger_http_duration_seconds_bucket{route=~\"/api/v1/.*\"}[1m])))",
"legendFormat": "0.5"
},
{
"refId": "0.95",
"expr": "histogram_quantile(0.95,sum by (le)(rate(messenger_http_duration_seconds_bucket{route=~\"/api/v1/.*\"}[1m])))",
"legendFormat": "0.95"
},
{
"refId": "0.99",
"expr": "histogram_quantile(0.99,sum by (le)(rate(messenger_http_duration_seconds_bucket{route=~\"/api/v1/.*\"}[1m])))",
"legendFormat": "0.99"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
},
"description": "Business routes only; histogram quantiles across all API replicas. Bucket interpolation is approximate."
},
{
"id": 4,
"title": "Job outcomes",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 8,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "sum by (outcome) (rate(messenger_jobs_total[1m]))",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "ops"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 5,
"title": "Processing p95",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 16,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "histogram_quantile(0.95,sum by(le)(rate(messenger_job_duration_seconds_bucket[1m])))",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 6,
"title": "Time to ready p95",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 16,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "histogram_quantile(0.95,sum by(le)(rate(messenger_job_ready_duration_seconds_bucket[1m])))",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 7,
"title": "RabbitMQ ready messages",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 24,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "messenger_queue_depth",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 8,
"title": "Logical pending jobs / outbox",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 24,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "messenger_jobs_pending",
"legendFormat": "jobs"
},
{
"refId": "B",
"expr": "messenger_outbox_pending",
"legendFormat": "outbox"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 9,
"title": "Oldest unfinished job",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 32,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "messenger_queue_oldest_age_seconds",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 10,
"title": "DB connections used/capacity/waiting",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 32,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "sum by (service_name)(messenger_db_pool_used)",
"legendFormat": "used {{service_name}}"
},
{
"refId": "B",
"expr": "sum by (service_name)(messenger_db_pool_capacity)",
"legendFormat": "capacity {{service_name}}"
},
{
"refId": "C",
"expr": "sum by (service_name)(messenger_db_pool_waiting)",
"legendFormat": "waiting {{service_name}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 11,
"title": "Worker busy/capacity",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 40,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "messenger_worker_busy{service_name=\"messenger-worker\"}",
"legendFormat": "busy"
},
{
"refId": "B",
"expr": "messenger_worker_capacity{service_name=\"messenger-worker\"}",
"legendFormat": "capacity"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 12,
"title": "Process memory RSS",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 40,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "messenger_process_memory",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "bytes"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 13,
"title": "CPU by service (% of one core)",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 48,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "100 * sum by(service_name)(rate(messenger_process_cpu[1m]))",
"legendFormat": "{{service_name}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "percent"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 14,
"title": "API burn rate",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 48,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "messenger:api_error_ratio:1m / 0.01",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 15,
"title": "Ready burn rate",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 56,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "messenger:ready_error_ratio:1m / 0.01",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 16,
"title": "Alerts",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 56,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "ALERTS{alertstate=\"firing\"}",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 17,
"title": "Collector export failures",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 64,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "rate(otelcol_exporter_send_failed_spans_total[1m])",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "ops"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 18,
"title": "Observation freshness",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 64,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "time() - messenger_observation_timestamp",
"legendFormat": "{{service_name}} {{route}} {{outcome}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "s"
},
"overrides": []
},
"options": {
"legend": {
"displayMode": "list",
"placement": "bottom"
}
}
},
{
"id": 19,
"title": "API SLI \u2014 1 hour",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 72,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "1 - messenger:api_error_ratio:1h"
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit"
},
"overrides": []
}
},
{
"id": 20,
"title": "Ready SLI \u2014 1 hour",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 72,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "1 - messenger:ready_error_ratio:1h"
}
],
"fieldConfig": {
"defaults": {
"unit": "percentunit"
},
"overrides": []
}
},
{
"id": 21,
"title": "Exporter bounded queue",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 0,
"y": 80,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "otelcol_exporter_queue_size",
"legendFormat": "size {{exporter}}"
},
{
"refId": "B",
"expr": "otelcol_exporter_queue_capacity",
"legendFormat": "capacity {{exporter}}"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
},
{
"id": 22,
"title": "DB lock waiters",
"type": "timeseries",
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"gridPos": {
"x": 12,
"y": 80,
"w": 12,
"h": 8
},
"targets": [
{
"refId": "A",
"expr": "messenger_db_locks_waiting"
}
],
"fieldConfig": {
"defaults": {
"unit": "short"
},
"overrides": []
}
}
]
}
@@ -0,0 +1,7 @@
apiVersion: 1
providers:
- name: Messenger
folder: Lab6
type: file
options:
path: /var/lib/grafana/dashboards
+40
View File
@@ -0,0 +1,40 @@
auth_enabled: false
server:
grpc_listen_address: 127.0.0.1
http_listen_address: 127.0.0.1
http_listen_port: 3100
common:
instance_addr: 127.0.0.1
path_prefix: /loki
replication_factor: 1
ring:
kvstore:
store: inmemory
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
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
otlp_config:
resource_attributes:
ignore_defaults: true
attributes_config:
- action: index_label
attributes: [service.name, deployment.environment.name]
- action: structured_metadata
attributes: [service.instance.id, service.version]
compactor:
working_directory: /loki/compactor
retention_enabled: true
delete_request_store: filesystem
+22
View File
@@ -0,0 +1,22 @@
global:
scrape_interval: 5s
evaluation_interval: 5s
rule_files:
- /etc/prometheus/alerts.yaml
scrape_configs:
- job_name: messenger
scheme: https
tls_config: &tls
ca_file: /run/identity/ca.crt
cert_file: /run/identity/tls.crt
key_file: /run/identity/tls.key
static_configs:
- targets: ['otel-collector:9444']
- job_name: collector
scheme: https
tls_config: *tls
static_configs:
- targets: ['otel-collector:9445']
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
+26
View File
@@ -0,0 +1,26 @@
server:
http_listen_address: 127.0.0.1
grpc_listen_address: 127.0.0.1
http_listen_port: 3200
distributor:
receivers:
otlp:
protocols:
http:
endpoint: 127.0.0.1:4318
ingester:
lifecycler:
address: 127.0.0.1
max_block_duration: 5m
compactor:
compaction:
block_retention: 168h
storage:
trace:
backend: local
wal:
path: /var/tempo/wal
local:
path: /var/tempo/blocks
usage_report:
reporting_enabled: false
+10
View File
@@ -0,0 +1,10 @@
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
GRANT USAGE ON SCHEMA public TO api_role,worker_role,dispatcher_role;
GRANT SELECT,INSERT,UPDATE ON users,refresh_tokens,chats,chat_members,messages,message_idempotency,message_attachments,attachments,attachment_jobs,job_slo,outbox TO api_role;
GRANT SELECT ON attachment_variants TO api_role;
GRANT SELECT,UPDATE ON attachments,attachment_jobs,job_slo TO worker_role;
GRANT INSERT,SELECT ON attachment_variants,job_audit TO worker_role;
GRANT USAGE ON SEQUENCE job_audit_id_seq TO worker_role;
GRANT INSERT,SELECT ON outbox TO worker_role;
GRANT SELECT,UPDATE ON outbox,job_slo,attachments,attachment_jobs TO dispatcher_role;
GRANT SELECT ON attachment_variants TO dispatcher_role;
+5
View File
@@ -0,0 +1,5 @@
local all all trust
hostssl messenger all 0.0.0.0/0 scram-sha-256
hostssl messenger all ::/0 scram-sha-256
hostnossl all all 0.0.0.0/0 reject
hostnossl all all ::/0 reject
+87
View File
@@ -0,0 +1,87 @@
{
"users": [
{
"name": "worker",
"password_hash": "",
"tags": []
},
{
"name": "dispatcher",
"password_hash": "",
"tags": []
},
{
"name": "operator-client",
"password_hash": "",
"tags": []
}
],
"vhosts": [
{
"name": "attachments"
}
],
"permissions": [
{
"user": "worker",
"vhost": "attachments",
"configure": "^$",
"write": "^$",
"read": "^attachments\\.v1$"
},
{
"user": "dispatcher",
"vhost": "attachments",
"configure": "^$",
"write": "^(attachments\\.publish|amq\\.default)$",
"read": "^attachments\\.v1$"
},
{
"user": "operator-client",
"vhost": "attachments",
"configure": "^attachments.*",
"write": "^(attachments.*|amq\\.default)$",
"read": "^attachments.*"
}
],
"queues": [
{
"name": "attachments.v1",
"vhost": "attachments",
"durable": true,
"auto_delete": false,
"arguments": {
"x-dead-letter-exchange": "attachments.invalid",
"x-dead-letter-routing-key": "invalid"
}
},
{
"name": "attachments.v1.invalid",
"vhost": "attachments",
"durable": true,
"auto_delete": false,
"arguments": {}
}
],
"exchanges": [
{
"name": "attachments.invalid",
"vhost": "attachments",
"type": "direct",
"durable": true,
"auto_delete": false,
"internal": false,
"arguments": {}
}
],
"bindings": [
{
"source": "attachments.invalid",
"vhost": "attachments",
"destination": "attachments.v1.invalid",
"destination_type": "queue",
"routing_key": "invalid",
"arguments": {}
}
]
}
+1
View File
@@ -0,0 +1 @@
[rabbitmq_auth_mechanism_ssl].
+11
View File
@@ -0,0 +1,11 @@
listeners.tcp = none
listeners.ssl.default = 5671
ssl_options.cacertfile = /run/identity/ca.crt
ssl_options.certfile = /run/identity/tls.crt
ssl_options.keyfile = /run/identity/tls.key
ssl_options.verify = verify_peer
ssl_options.fail_if_no_peer_cert = true
auth_mechanisms.1 = EXTERNAL
ssl_cert_login_from = common_name
loopback_users = none
load_definitions = /run/identity/definitions.json
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""Check versionable files against locally generated private material without printing it."""
import json,subprocess
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];S=ROOT/'secrets/lab7'
needles=[]
for p in S.rglob('*'):
if p.is_file() and (p.name.endswith('_secret') or p.name.endswith('_password') or p.name in ['old_secret','old_access','tls.key','ca.key','jwt.key','password']):
value=p.read_bytes().strip()
if len(value)>=16:needles.append(value)
init=json.loads((S/'operator/init.json').read_text())
for key in ['keys','keys_base64']:
needles.extend(x.encode() for x in init.get(key,[]))
assert not init.get('root_token'),'initial root token still stored'
files=subprocess.check_output(['git','ls-files','--cached','--others','--exclude-standard','-z'],cwd=ROOT).decode().split('\0');count=0
for name in files:
p=ROOT/name
if name and p.is_file():
count+=1;body=p.read_bytes();assert not any(n in body for n in needles),'generated secret detected in '+name
for name in ['secrets/lab7/operator/ca.key','secrets/lab7/operator/init.json','secrets/lab7/api/jwt.key']:
assert subprocess.run(['git','check-ignore','-q',name],cwd=ROOT).returncode==0
ignore=(ROOT/'.dockerignore').read_text().splitlines();assert 'secrets' in ignore and 'certs' in ignore
(ROOT/'evidence/secret-audit.json').write_text(json.dumps({'versionable_files_checked':count,'generated_secrets_checked':len(needles),'matches':0,'private_material_ignored':True,'build_context_excludes_secrets':True,'initial_root_token_removed':True},indent=2)+'\n');print('PASS: generated credentials/private keys/unseal material absent from versionable files and excluded from build context')
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""Operator-only OpenBao client. Does not log request/response bodies."""
import os, json, ssl, urllib.request, urllib.error, time
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];S=ROOT/'secrets/lab7';O=S/'operator'
def call(path,body=None,token='',method=None,identity='operator-client'):
ctx=ssl.create_default_context(cafile=str(S/identity/'ca.crt'));ctx.load_cert_chain(S/identity/'tls.crt',S/identity/'tls.key')
req=urllib.request.Request(os.environ.get('LAB7_BAO_OPERATOR_ADDR','https://localhost:18200')+'/v1/'+path,data=json.dumps(body).encode() if body is not None else None,method=method or ('POST' if body is not None else 'GET'),headers={'Content-Type':'application/json','X-Vault-Token':token})
with urllib.request.urlopen(req,context=ctx,timeout=5) as r:
b=r.read();return json.loads(b) if b else {}
def operator_token():return call('auth/cert/login',{'name':'operator'})['auth']['client_token']
def unseal():
for _ in range(60):
try:call('sys/init');break
except (OSError,urllib.error.URLError):time.sleep(1)
else:raise RuntimeError('OpenBao listener did not start')
data=json.loads((O/'init.json').read_text())
for key in data['keys_base64'][:2]:call('sys/unseal',{'key':key})
def bootstrap():
O.mkdir(exist_ok=True)
for _ in range(60):
try: state=call('sys/init');break
except (OSError,urllib.error.URLError):time.sleep(1)
else:raise RuntimeError('OpenBao did not start')
if not state['initialized']:
data=call('sys/init',{'secret_shares':3,'secret_threshold':2});p=O/'init.json';p.write_text(json.dumps(data));p.chmod(0o600)
unseal();saved=json.loads((O/'init.json').read_text());token=saved.get('root_token') or operator_token()
if saved.get('root_token'):
for path,body in [('sys/auth/cert',{'type':'cert'}),('sys/mounts/secret',{'type':'kv','options':{'version':'2'}}),('sys/mounts/database',{'type':'database'})]:
try:call(path,body,token)
except urllib.error.HTTPError as e:
if e.code!=400:raise
policy='''path "sys/seal" { capabilities = ["update","sudo"] }
path "secret/*" { capabilities = ["create","read","update","delete","list"] }
path "database/*" { capabilities = ["create","read","update","delete","list"] }
path "auth/cert/*" { capabilities = ["create","read","update","delete","list"] }
path "auth/token/*" { capabilities = ["create","read","update","delete","list","sudo"] }
path "sys/leases/*" { capabilities = ["create","read","update","delete","list","sudo"] }
path "sys/policies/acl/*" { capabilities = ["create","read","update","delete","list"] }
path "sys/audit/*" { capabilities = ["create","read","update","delete","list","sudo"] }
'''
call('sys/policies/acl/operator',{'policy':policy},token)
call('auth/cert/certs/operator',{'certificate':(S/'operator-client/tls.crt').read_text(),'token_policies':['operator'],'token_ttl':300,'token_max_ttl':1800},token)
for role in ['api','worker','dispatcher']:
call('sys/policies/acl/'+role,{'policy':(ROOT/'infra/openbao'/f'{role}.hcl').read_text()},token)
call('auth/cert/certs/'+role,{'certificate':(S/role/'tls.crt').read_text(),'token_policies':[role],'token_ttl':300,'token_max_ttl':1800,'token_no_default_policy':True},token)
creds={'s3_access':(O/('s3_'+('api' if role=='dispatcher' else role)+'_access')).read_text(),'s3_secret':(O/('s3_'+('api' if role=='dispatcher' else role)+'_secret')).read_text()}
if role=='dispatcher':creds={'s3_access':'unused','s3_secret':'unused'}
if role=='api':creds['redis_password']=(O/'redis_password').read_text()
call('secret/data/'+role,{'data':creds},token)
call('database/roles/'+role,{'db_name':'messenger','creation_statements':['CREATE ROLE "{{name}}" WITH LOGIN PASSWORD \'{{password}}\' VALID UNTIL \'{{expiration}}\' IN ROLE '+role+'_role;'],'revocation_statements':['SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE usename=\'{{name}}\';','DROP ROLE IF EXISTS "{{name}}";'],'default_ttl':'600s','max_ttl':'1800s'},token)
call('database/config/messenger',{'plugin_name':'postgresql-database-plugin','allowed_roles':['api','worker','dispatcher'],'connection_url':'postgresql://{{username}}:{{password}}@postgres:5432/messenger?sslmode=verify-full&sslrootcert=/run/identity/ca.crt','username':'bao_manager','password':(O/'bao_db_password').read_text()},token)
if saved.get('root_token'):
call('auth/token/revoke-self',{},token);saved.pop('root_token',None);(O/'init.json').write_text(json.dumps(saved));(O/'init.json').chmod(0o600)
print('OpenBao unsealed and scoped policies/leases configured; initial root token revoked.')
if __name__=='__main__':
import sys
if len(sys.argv)>1 and sys.argv[1]=='unseal':unseal();print('OpenBao operator unseal completed.')
else:bootstrap()
+97
View File
@@ -0,0 +1,97 @@
#!/usr/bin/env python3
"""Idempotent local lab7 bootstrap. Never prints secrets or modifies lab6."""
import json, os, secrets, shutil, subprocess
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]; S=ROOT/'secrets/lab7'; O=S/'operator'
def run(*args): subprocess.run(args,check=True,stdout=subprocess.DEVNULL,stderr=subprocess.PIPE)
def secret(name):
p=O/name
if not p.exists(): p.write_text(secrets.token_hex(24))
p.chmod(0o600);return p.read_text().strip()
def issue(role,days=1,cn=None):
d=S/role;d.mkdir(exist_ok=True)
if not (d/'tls.crt').exists() or (d/'tls.crt').stat().st_size==0:
run('openssl','req','-new','-newkey','rsa:2048','-nodes','-keyout',str(d/'tls.key'),'-out',str(O/'request.csr'),'-subj','/CN='+(cn or role))
ext=O/'leaf.ext';ext.write_text('[leaf]\nbasicConstraints=critical,CA:FALSE\nkeyUsage=critical,digitalSignature,keyEncipherment\nextendedKeyUsage=serverAuth,clientAuth\nsubjectAltName=DNS:'+role+(',DNS:localhost,IP:127.0.0.1' if role in ('lb','openbao','grafana') else '')+'\n')
run('openssl','ca','-batch','-config',str(O/'ca.cnf'),'-extensions','leaf','-extfile',str(ext),'-days',str(days),'-in',str(O/'request.csr'),'-out',str(d/'tls.crt'),'-notext')
for f in ['ca.crt','ca.crl']:
temporary=d/(f+'.tmp');shutil.copyfile(O/f,temporary);temporary.replace(d/f)
# The directory is the security boundary; only this identity directory is mounted in its container.
d.chmod(0o755)
return d
def main():
os.umask(0o077);S.mkdir(parents=True,exist_ok=True);O.mkdir(exist_ok=True);O.chmod(0o700)
for p in S.rglob('*'):
if p.is_file():p.chmod(0o600)
for f,value in [('index.txt',''),('serial','1000\n'),('crlnumber','1000\n')]:
if not (O/f).exists():(O/f).write_text(value)
(O/'newcerts').mkdir(exist_ok=True)
(O/'ca.cnf').write_text(f'''[ca]
default_ca=local
[local]
dir={O}
database=$dir/index.txt
new_certs_dir=$dir/newcerts
certificate=$dir/ca.crt
private_key=$dir/ca.key
serial=$dir/serial
crlnumber=$dir/crlnumber
default_md=sha256
default_days=1
default_crl_days=1
unique_subject=no
policy=policy
[policy]
commonName=supplied
[leaf]
''')
if not (O/'ca.key').exists():run('openssl','req','-x509','-newkey','rsa:3072','-nodes','-days','365','-keyout',str(O/'ca.key'),'-out',str(O/'ca.crt'),'-subj','/CN=lab7-local-ca','-addext','basicConstraints=critical,CA:TRUE','-addext','keyUsage=critical,keyCertSign,cRLSign')
run('openssl','ca','-config',str(O/'ca.cnf'),'-gencrl','-out',str(O/'ca.crl'))
roles=['lb','api','worker','dispatcher','postgres','redis','broker','s3','otel-collector','prometheus','loki','tempo','grafana','openbao','operator-client','stranger']
for role in roles:issue(role)
if not (S/'api/jwt.key').exists():
run('openssl','genrsa','-out',str(S/'api/jwt.key'),'2048');run('openssl','rsa','-in',str(S/'api/jwt.key'),'-pubout','-out',str(S/'api/jwt.pub'))
for p in (S/'api').glob('jwt.*'):p.chmod(0o444)
for name in ['db_password','bao_db_password','redis_password','grafana_password','s3_admin_access','s3_admin_secret','s3_api_access','s3_api_secret','s3_worker_access','s3_worker_secret','s3_baseline_access','s3_baseline_secret']:secret(name)
bucket='messenger-attachments'
identities=[]
for role,actions in [('baseline',[f'Read:{bucket}',f'Write:{bucket}',f'List:{bucket}']),('admin',['Admin']),('api',[f'Read:{bucket}/results/*',f'Read:{bucket}/originals/*',f'Write:{bucket}/staging/*',f'Read:{bucket}']),('worker',[f'Read:{bucket}/staging/*',f'Write:{bucket}/staging/*',f'Read:{bucket}/results/*',f'Write:{bucket}/results/*',f'Read:{bucket}'])]:
# Bucket-scoped Read also permits arbitrary object reads; do not grant it. HeadBucket is handled by health prefix probes instead.
if role not in ['admin','baseline']:actions=[a for a in actions if a!=f'Read:{bucket}']
identities.append({'name':role,'credentials':[{'accessKey':secret('s3_'+role+'_access'),'secretKey':secret('s3_'+role+'_secret')}],'actions':actions})
(S/'s3/s3.json').write_text(json.dumps({'identities':identities}));(S/'s3/s3.json').chmod(0o444)
(S/'postgres/password').write_text(secret('db_password'));(S/'postgres/password').chmod(0o444)
(S/'postgres/init.sql').write_text("CREATE ROLE bao_manager WITH LOGIN CREATEROLE PASSWORD '"+secret('bao_db_password')+"';\nCREATE ROLE api_role NOLOGIN; CREATE ROLE worker_role NOLOGIN; CREATE ROLE dispatcher_role NOLOGIN;\nGRANT api_role,worker_role,dispatcher_role TO bao_manager WITH ADMIN OPTION;\nGRANT pg_signal_backend TO bao_manager;\n")
(S/'postgres/init.sql').chmod(0o444)
(S/'redis/users.acl').write_text('user default off\nuser api on >'+secret('redis_password')+' ~ratelimit:* ~chat:* ~chats:* +@read +@write +ping +evalsha +eval +script|load +script|exists -flushall -flushdb -config -acl\n');(S/'redis/users.acl').chmod(0o444)
(S/'grafana/password').write_text(secret('grafana_password'));(S/'grafana/password').chmod(0o444)
for role in ('api','worker','dispatcher','operator-client'):
(S/role/'broker_url').write_text('amqps://broker:5671/attachments');(S/role/'broker_url').chmod(0o444)
(S/'lb/bundle.pem').write_text((S/'lb/tls.crt').read_text()+(S/'lb/tls.key').read_text());(S/'lb/bundle.pem').chmod(0o444)
for name in ['s3_admin_access','s3_admin_secret','s3_baseline_access','s3_baseline_secret']:
(S/'operator-client'/name).write_text(secret(name));(S/'operator-client'/name).chmod(0o444)
# Provisioning contains the Grafana client private key, so it is generated outside Git.
sources=[]
for name in ['prometheus','loki','tempo']:
sources.append({'name':name.title(),'uid':name,'type':name,'url':'https://'+name+':9443','access':'proxy','isDefault':name=='prometheus','jsonData':{'tlsAuth':True,'tlsAuthWithCACert':True,'serverName':name,'timeInterval':'5s'},'secureJsonData':{'tlsCACert':(O/'ca.crt').read_text(),'tlsClientCert':(S/'grafana/tls.crt').read_text(),'tlsClientKey':(S/'grafana/tls.key').read_text()}})
(S/'grafana/datasources.yaml').write_text(json.dumps({'apiVersion':1,'datasources':sources},indent=2))
for role in roles:
for p in (S/role).iterdir():p.chmod(0o444)
definitions=json.loads((ROOT/'infra/rabbitmq/definitions.json').read_text())
cn=subprocess.check_output(['openssl','x509','-in',str(S/'worker/tls.crt'),'-noout','-subject','-nameopt','RFC2253'],text=True).strip().split('CN=')[-1]
for user in definitions['users']:
if user['name']=='worker':user['name']=cn
for permission in definitions['permissions']:
if permission['user']=='worker':permission['user']=cn
(S/'broker/definitions.json').chmod(0o600) if (S/'broker/definitions.json').exists() else None
(S/'broker/definitions.json').write_text(json.dumps(definitions));(S/'broker/definitions.json').chmod(0o444)
foreign=S/'foreign';foreign.mkdir(exist_ok=True);foreign.chmod(0o755)
if not (foreign/'tls.crt').exists():
run('openssl','req','-x509','-newkey','rsa:2048','-nodes','-days','1','-keyout',str(foreign/'tls.key'),'-out',str(foreign/'tls.crt'),'-subj','/CN=foreign','-addext','subjectAltName=DNS:foreign')
(foreign/'ca.crt').chmod(0o600) if (foreign/'ca.crt').exists() else None
shutil.copyfile(O/'ca.crt',foreign/'ca.crt')
for p in foreign.iterdir():p.chmod(0o444)
print('Local lab7 CA, identities and synthetic secrets prepared. No credentials printed.')
if __name__=='__main__':main()
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env python3
"""Build public images with a temporary Docker CLI config, avoiding platform keychain helpers."""
import json,os,subprocess,tempfile
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
endpoint=subprocess.check_output(['docker','context','inspect','--format','{{.Endpoints.docker.Host}}'],text=True).strip()
with tempfile.TemporaryDirectory(prefix='lab7-docker-public-') as directory:
Path(directory,'config.json').write_text(json.dumps({'auths':{},'cliPluginsExtraDirs':[str(Path.home()/'.docker/cli-plugins')]}))
env=dict(os.environ,DOCKER_CONFIG=directory,DOCKER_HOST=endpoint);env.pop('DOCKER_CONTEXT',None)
subprocess.run([str(ROOT/'scripts/compose.sh'),'build','api'],cwd=ROOT,env=env,check=True)
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env python3
import datetime,json,platform,subprocess
from pathlib import Path
root=Path(__file__).resolve().parents[1]
def cmd(*a):return subprocess.check_output(a,text=True,cwd=root).strip()
containers=[]
for cid in cmd(str(root/'scripts/compose.sh'),'ps','-q').split():
c=json.loads(cmd('docker','inspect',cid))[0];h=c['HostConfig']
containers.append({'name':c['Name'],'image_id':c['Image'],'started_at':c['State']['StartedAt'],'user':c['Config']['User'],'memory_limit':h['Memory'],'nano_cpus':h['NanoCpus'],'read_only':h['ReadonlyRootfs'],'cap_drop':h['CapDrop'],'security_opt':h['SecurityOpt'],'port_bindings':h['PortBindings']})
data={'timestamp':datetime.datetime.now(datetime.timezone.utc).isoformat(),'base_commit':cmd('git','rev-parse','HEAD'),'working_tree_changes':True,'system':platform.platform(),'architecture':platform.machine(),'docker':cmd('docker','version','--format','{{.Server.Version}}'),'compose':cmd('docker','compose','version','--short'),'containers':containers,'docker_cpus':int(cmd('docker','info','--format','{{.NCPU}}')),'docker_memory_bytes':int(cmd('docker','info','--format','{{.MemTotal}}'))}
(root/'evidence/environment.json').write_text(json.dumps(data,indent=2)+'\n');print('Sanitized environment recorded.')
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
set -eu
cd "$(dirname "$0")/.."
exec docker compose -p "${LAB7_PROJECT:-mtusi2026lab7}" -f compose.yaml "$@"
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env python3
"""Repeatable synthetic worker compromise/recovery experiment. No credentials in results."""
import hashlib,importlib.util,json,statistics,subprocess,sys,time,urllib.error,uuid
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT/'scripts'))
import security,bao
spec=importlib.util.spec_from_file_location('rotation',ROOT/'scripts/rotate-worker.py');rotation=importlib.util.module_from_spec(spec);spec.loader.exec_module(rotation)
def db(sql):return security.compose('exec','-T','postgres','psql','-U','messenger','-d','messenger','-At','-v','ON_ERROR_STOP=1','-c',sql).stdout.strip()
def one(index):
name,pw,token,user=security.actor();auth={'Authorization':'Bearer '+token}
status,_,b=security.request('/api/v1/chats','POST',json.dumps({'title':'Synthetic recovery','member_ids':[user]}).encode(),dict(auth,**{'Content-Type':'application/json'}));assert status==201
chat=json.loads(b)['id'];security.compose('stop','worker')
fixture=(ROOT/'tests/fixtures/sample.png').read_bytes();ids=[];latencies=[]
# Work is accepted durably while the consumer is absent.
for i in range(5):
start=time.monotonic();status,_,b=security.request('/api/v1/chats/'+chat+'/attachments?filename=synthetic.png','POST',fixture,dict(auth,**{'Content-Type':'image/png'}));latencies.append(time.monotonic()-start);assert status==202;ids.append(json.loads(b)['id'])
idsql=','.join("'"+i+"'" for i in ids)
before=db('SELECT count(*) FROM attachment_jobs WHERE attachment_id IN ('+idsql+')');assert before=='5'
restricted={m:security.probe(m) for m in ['db','s3','amqp']}
# The broad DB profile from lab6 is measured without reading secrets or retaining changes.
broad=db("BEGIN; SELECT count(*)=0 FROM (SELECT password_hash FROM users LIMIT 0) x; CREATE TABLE baseline_probe(id int); ROLLBACK;")
broad_profiles={}
for mode in ['s3','amqp']:
args=['run','--rm','-T','--no-deps','--entrypoint','securityprobe','-e','BAO_ADDR=','-e','PROBE_BASELINE=1','-e','PROBE_MODE='+mode,'-e','S3_ACCESS_KEY_ID_FILE=/run/identity/s3_baseline_access','-e','S3_SECRET_ACCESS_KEY_FILE=/run/identity/s3_baseline_secret','-v',str(security.S/'operator-client')+':/run/identity:ro','worker']
broad_profiles[mode]=json.loads(security.compose(*args).stdout)
start=time.monotonic();rotation.rotate(start=False)
# Old worker auth is explicitly rejected even though its CA is still trusted.
try:bao.call('auth/cert/login',{'name':'worker'},identity='worker-old')
except urllib.error.HTTPError as e:assert e.code in [400,403]
else:raise AssertionError('old worker can authenticate')
security.probe('tls',target='https://otel-collector:9443/v1/traces',expect='deny',material='worker-old')
security.probe('amqp-tls',expect='deny',material='worker-old')
old_result=security.compose('run','--rm','-T','--no-deps','--entrypoint','securityprobe','-e','BAO_ADDR=','-e','PROBE_MODE=s3','-e','PROBE_OLD_SECRET=1','-e','S3_ACCESS_KEY_ID_FILE=/run/old_access','-e','S3_SECRET_ACCESS_KEY_FILE=/run/old_secret','-v',str(security.S/'worker-old/old_access')+':/run/old_access:ro','-v',str(security.S/'worker-old/old_secret')+':/run/old_secret:ro','worker').stdout
assert json.loads(old_result)['old_s3_secret_rejected']
security.compose('up','-d','worker')
errors=0
for _ in range(90):
statuses=[]
for aid in ids:
status,_,b=security.request('/api/v1/attachments/'+aid,headers=auth)
if status!=200:errors+=1;continue
statuses.append(json.loads(b)['status'])
if len(statuses)==5 and set(statuses)=={'ready'}:break
time.sleep(1)
else:raise AssertionError('accepted jobs did not recover')
recovery=time.monotonic()-start
sha=hashlib.sha256(fixture).hexdigest()
for aid in ids:
status,_,b=security.request('/api/v1/attachments/'+aid+'/content',headers=auth);assert status==200 and hashlib.sha256(b).hexdigest()==sha
total,unique=db('SELECT count(*),count(DISTINCT attachment_id) FROM attachment_jobs WHERE attachment_id IN ('+idsql+')').split('|');assert total==unique=='5'
effects=db('SELECT count(*) FROM attachment_variants WHERE attachment_id IN ('+idsql+')');assert effects=='20',effects
samples=security.compose('stats','--no-stream','--format','json').stdout
return {'repeat':index,'accepted':5,'ready':5,'lost':0,'duplicate_jobs':0,'variant_records':int(effects),'original_checksums_match':True,'old_identity_rejected':True,'recovery_seconds':recovery,'observation_errors':errors,'upload_latency_ms':{'p50':statistics.median(latencies)*1000,'max':max(latencies)*1000},'restricted_probes':restricted,'broad_db_read_and_ddl':True,'broad_profiles':broad_profiles,'old_s3_key_rejected':True,'old_broker_identity_rejected':True,'resource_snapshot':[json.loads(x) for x in samples.splitlines() if x.startswith('{')]}
def main():
results=[]
for i in range(1,4):
results.append(one(i));(ROOT/'evidence/worker-experiment.json').write_text(json.dumps({'hypothesis':'Scoped worker identity limits DB/S3/broker access; revocation and replacement preserve accepted benign jobs.','timestamp':time.strftime('%Y-%m-%dT%H:%M:%SZ',time.gmtime()),'repeats':results,'limitations':['Authorized worker can damage its permitted job metadata and object prefixes.','This experiment does not claim integrity after malicious modification of those authorized resources.','Single Docker host; no host/DB/LB high availability.']},indent=2)+'\n');print('PASS: worker compromise/recovery repeat',i)
if __name__=='__main__':main()
+33
View File
@@ -0,0 +1,33 @@
#!/bin/sh
# State-changing scenarios are deliberately sequential, on synthetic lab7 data.
set -eu
cd "$(dirname "$0")/.."
make check validate PYTHON=.venv/bin/python > evidence/contracts.txt
make build vet test-go > evidence/go-checks.txt
make test test-security > evidence/public-checks.txt
python3 scripts/security.py > evidence/security-run.txt
python3 scripts/prove-auth.py > evidence/auth-run.txt
python3 scripts/prove-leaf.py > evidence/leaf-run.txt
python3 scripts/prove-sealed.py > evidence/sealed-run.txt
python3 scripts/prove-telemetry.py > evidence/telemetry-run.txt
python3 scripts/prove-admin.py > evidence/admin-run.txt
python3 scripts/prove-cert-expiry.py > evidence/cert-expiry-run.txt
python3 student-tests/images.py > evidence/images-run.txt
python3 student-tests/storage.py > evidence/storage-run.txt
python3 student-tests/broker_persistence.py > evidence/broker-run.txt
make test-persistence ACTION_SCRIPT=scripts/restart.sh > evidence/persistence-run.txt
make test-failover ACTION_SCRIPT=scripts/stop-one.sh > evidence/failover-first.txt
./scripts/compose.sh up -d api
python3 scripts/wait-ready.py
make test-failover ACTION_SCRIPT=scripts/stop-one.sh > evidence/failover-second.txt
./scripts/compose.sh up -d api
python3 scripts/wait-ready.py
python3 scripts/prove-all-replicas.py > evidence/all-replicas-run.txt
python3 scripts/experiment-worker.py > evidence/worker-experiment-run.txt
make test > evidence/final-smoke.txt
python3 scripts/capture-environment.py
python3 scripts/prove-clean-clone.py > evidence/clean-clone-run.txt
python3 scripts/scan-images.py
make scan-dependencies
python3 scripts/audit-secrets.py
python3 scripts/summarize-evidence.py
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env python3
"""Convert a temporary generation view to the oapi-codegen 3.0 subset.
Runtime handlers enforce anyOf and required fields; normative contract is untouched.
"""
import json
from pathlib import Path
s=json.loads(Path('contracts/openapi.json').read_text())
for schema in s['components']['schemas'].values():
schema.pop('anyOf',None)
for prop in schema.get('properties',{}).values():
if prop.get('type')==['string','null']:
prop.update(type='string',nullable=True)
# Preserve pointers so handlers can distinguish missing fields from empty values.
for name,field in [('CreateUser','password'),('CreateMessage','text')]:
s['components']['schemas'][name]['properties'][field]['x-go-type-skip-optional-pointer']=False
s['components']['schemas'][name]['required'].remove(field)
print(json.dumps(s))
+12
View File
@@ -0,0 +1,12 @@
#!/usr/bin/env python3
import base64,json,ssl,sys,urllib.error,urllib.request
from pathlib import Path
root=Path(__file__).resolve().parents[1];s=root/'secrets/lab7';ctx=ssl.create_default_context(cafile=str(s/'grafana/ca.crt'))
url='https://localhost:13443/api/user'
try:urllib.request.urlopen(url,context=ctx)
except urllib.error.HTTPError as e:assert e.code==401
else:raise AssertionError('Grafana user API allowed anonymous access')
password=(s/'operator/grafana_password').read_text().strip();req=urllib.request.Request(url,headers={'Authorization':'Basic '+base64.b64encode(('admin:'+password).encode()).decode()})
with urllib.request.urlopen(req,context=ctx) as response:
data=json.load(response);assert data['login']=='admin'
(root/'evidence/admin.json').write_text(json.dumps({'grafana_verified_https':True,'anonymous_user_api_denied':True,'operator_authenticated':True},indent=2)+'\n');print('PASS: Grafana HTTPS operator authentication and anonymous denial')
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
import json,subprocess,sys,time,uuid
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT/'scripts'));import security
name,password,token,user=security.actor();auth={'Authorization':'Bearer '+token}
status,_,b=security.request('/api/v1/chats','POST',json.dumps({'title':'Sequential failures','member_ids':[user]}).encode(),dict(auth,**{'Content-Type':'application/json'}));assert status==201;chat=json.loads(b)['id'];results=[]
for cid in security.compose('ps','-q','api').stdout.split():
started=time.monotonic();subprocess.run(['docker','stop',cid],check=True,stdout=subprocess.DEVNULL)
try:
key=uuid.uuid4().hex;body=json.dumps({'text':'synthetic persistence during replica failure'}).encode();h=dict(auth,**{'Content-Type':'application/json','Idempotency-Key':key})
for _ in range(30):
status,headers,b=security.request('/api/v1/chats/'+chat+'/messages','POST',body,h)
if status==201:break
time.sleep(.2)
else:raise AssertionError('surviving replica did not accept write')
accepted=json.loads(b);elapsed=time.monotonic()-started;assert elapsed<10
for _ in range(30):
status,_,b=security.request('/api/v1/chats/'+chat+'/messages','POST',body,h)
if status==201:break
assert status==503,status;time.sleep(.2)
assert status==201 and json.loads(b)['id']==accepted['id']
status,_,b=security.request('/api/v1/chats/'+chat+'/messages',headers=auth);assert status==200;assert sum(x['id']==accepted['id'] for x in json.loads(b)['items'])==1
results.append({'stopped_container':cid,'recovery_seconds':elapsed,'original_session_valid':True,'no_duplicate':True})
finally:
subprocess.run(['docker','start',cid],check=True,stdout=subprocess.DEVNULL);time.sleep(3)
(ROOT/'evidence/all-replicas.json').write_text(json.dumps(results,indent=2)+'\n');print('PASS: each physical API container stopped sequentially; session/write/idempotency preserved')
+33
View File
@@ -0,0 +1,33 @@
#!/usr/bin/env python3
import base64,json,subprocess,sys,time,concurrent.futures,statistics,uuid
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT/'scripts'));import security
def main():
name,password,token,user=security.actor()
args=['run','--rm','-T','--no-deps','--entrypoint','securityprobe','-e','BAO_ADDR=','-e','PROBE_MODE=hash','-e','ARGON2_PARALLELISM=4','-e','PROBE_PASSWORD='+password,'worker']
old=security.compose(*args).stdout.strip();assert old.startswith('$argon2id$v=19$m=65536,t=3,p=4$')
sql="UPDATE users SET password_hash='"+old+"' WHERE id='"+user+"';"
subprocess.run([str(ROOT/'scripts/compose.sh'),'exec','-T','postgres','psql','-U','messenger','-d','messenger','-v','ON_ERROR_STOP=1'],input=sql,text=True,check=True,stdout=subprocess.DEVNULL,stderr=subprocess.PIPE)
status,_,_=security.request('/api/v1/auth/sessions','POST',headers={'Authorization':'Basic '+base64.b64encode((name+':'+password).encode()).decode()});assert status==201
query="SELECT password_hash LIKE '$argon2id$v=19$m=65536,t=3,p=1$%' FROM users WHERE id='"+user+"';"
assert security.compose('exec','-T','postgres','psql','-U','messenger','-d','messenger','-Atc',query).stdout.strip()=='t'
kdf=security.compose('run','--rm','-T','--no-deps','--entrypoint','securityprobe','-e','BAO_ADDR=','-e','PROBE_MODE=kdf','worker').stdout
result={'rehash_lab6_profile_on_login':True,'kdf':json.loads(kdf)}
def login_attempt(i):
credentials=base64.b64encode(('absent_'+uuid.uuid4().hex[:12]+':synthetic-wrong-password').encode()).decode();start=time.monotonic()
status,_,_=security.request('/api/v1/auth/sessions','POST',headers={'Authorization':'Basic '+credentials});return status,(time.monotonic()-start)*1000
started=time.monotonic()
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor:attempts=list(executor.map(login_attempt,range(24)))
result['login_dos_budget']={'requests':24,'concurrency':8,'duration_seconds':time.monotonic()-started,'statuses':{str(s):sum(x[0]==s for x in attempts) for s in set(x[0] for x in attempts)},'p95_all_ms':sorted(x[1] for x in attempts)[22],'api_memory_limit_mib':512,'max_kdf_memory_mib_per_process':128,'max_kdf_parallel_per_process':2}
override=ROOT/'secrets/lab7/operator/expiry.json';override.write_text(json.dumps({'services':{'api':{'environment':{'SESSION_TTL_SECONDS':'2'}}}}))
base=[str(ROOT/'scripts/compose.sh')]
try:
subprocess.run(['docker','compose','-p','mtusi2026lab7','-f',str(ROOT/'compose.yaml'),'-f',str(override),'up','-d','api'],check=True,stdout=subprocess.DEVNULL,stderr=subprocess.PIPE)
subprocess.run([sys.executable,str(ROOT/'scripts/wait-ready.py')],check=True,stdout=subprocess.DEVNULL)
_,_,short,_=security.actor();time.sleep(3);assert security.request('/api/v1/users/me',headers={'Authorization':'Bearer '+short})[0]==401;result['session_ttl_2_seconds_expires']=True
finally:
security.compose('up','-d','api');subprocess.run([sys.executable,str(ROOT/'scripts/wait-ready.py')],check=True,stdout=subprocess.DEVNULL)
(ROOT/'evidence/auth.json').write_text(json.dumps(result,indent=2)+'\n');print('PASS: legacy rehash, KDF measurements and session expiry')
if __name__=='__main__':main()
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env python3
import datetime,json,subprocess,sys
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT/'scripts'));import bootstrap,security
p=security.S/'expired';p.mkdir(exist_ok=True);p.chmod(0o755)
for f in p.iterdir():f.chmod(0o600)
bootstrap.run('openssl','req','-new','-newkey','rsa:2048','-nodes','-keyout',str(p/'tls.key'),'-out',str(p/'request.csr'),'-subj','/CN=expired-lb')
(p/'extensions.cnf').write_text('[leaf]\nbasicConstraints=critical,CA:FALSE\nkeyUsage=critical,digitalSignature,keyEncipherment\nextendedKeyUsage=clientAuth\nsubjectAltName=DNS:lb\n')
now=datetime.datetime.now(datetime.timezone.utc);date=lambda d:(now-datetime.timedelta(days=d)).strftime('%y%m%d%H%M%SZ')
bootstrap.run('openssl','ca','-batch','-config',str(bootstrap.O/'ca.cnf'),'-extensions','leaf','-extfile',str(p/'extensions.cnf'),'-startdate',date(2),'-enddate',date(1),'-in',str(p/'request.csr'),'-out',str(p/'tls.crt'),'-notext')
(p/'ca.crt').write_text((bootstrap.O/'ca.crt').read_text())
for f in p.iterdir():f.chmod(0o444)
security.probe('tls',target='https://api:8080/health/ready',expect='deny',material='expired')
(ROOT/'evidence/cert-expiry.json').write_text(json.dumps({'trusted_ca':True,'allowed_lb_san':True,'expired_leaf_rejected':True},indent=2)+'\n');print('PASS: expired leaf with trusted CA and allowed LB SAN rejected')
+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/env python3
"""Exercise a source-only snapshot in a fresh project, with new CA/secrets/volumes and distinct ports."""
import json,os,shutil,subprocess,tempfile,time
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1]
files=subprocess.check_output(['git','ls-files','--cached','--others','--exclude-standard','-z'],cwd=ROOT).decode().split('\0')
with tempfile.TemporaryDirectory(prefix='lab7-clean-') as work:
target=Path(work)
for name in files:
p=ROOT/name
if not name or not p.is_file() or name.startswith('evidence/'):continue
out=target/name;out.parent.mkdir(parents=True,exist_ok=True);shutil.copy2(p,out)
(target/'evidence').mkdir(exist_ok=True)
image='mtusi-messenger:lab7-clean-'+str(os.getpid())
cfg=json.loads((target/'compose.yaml').read_text())
for service in cfg['services'].values():
if service.get('image')=='mtusi-messenger:lab7':service['image']=image
for role,port in [('lb',18443),('openbao',18201),('grafana',13444)]:
current=cfg['services'][role]['ports'][0].split(':');cfg['services'][role]['ports']=['127.0.0.1:'+str(port)+':'+current[-1]]
(target/'compose.yaml').write_text(json.dumps(cfg))
env=dict(os.environ,LAB7_PROJECT='mtusi2026lab7-clean-'+str(os.getpid()),LAB7_BASE_URL='https://localhost:18443',LAB7_BAO_OPERATOR_ADDR='https://localhost:18201')
started=time.monotonic()
try:
subprocess.run(['./scripts/up.sh'],cwd=target,env=env,check=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
smoke=subprocess.run(['python3','tests/smoke.py','--base-url',env['LAB7_BASE_URL'],'--ca-file',str(target/'secrets/lab7/lb/ca.crt')],cwd=target,env=env,check=True,text=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
subprocess.run(['python3','tests/security.py','--base-url',env['LAB7_BASE_URL'],'--ca-file',str(target/'secrets/lab7/lb/ca.crt')],cwd=target,env=env,check=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
result={'fresh_source_snapshot':True,'new_ca_and_secrets':True,'new_project_and_volumes':True,'separate_application_image_tag':True,'no_lab6_access':True,'verified_https_smoke':smoke.stdout.strip(),'duration_seconds':time.monotonic()-started}
(ROOT/'evidence/clean-clone.json').write_text(json.dumps(result,indent=2)+'\n');print('PASS: fresh source-only snapshot with new secrets/volumes passes HTTPS smoke')
finally:
subprocess.run(['./scripts/compose.sh','down','-v'],cwd=target,env=env,stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
subprocess.run(['docker','image','rm',image],stdout=subprocess.DEVNULL,stderr=subprocess.DEVNULL)
+11
View File
@@ -0,0 +1,11 @@
#!/usr/bin/env python3
import json,subprocess,sys
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT/'scripts'));import security
before=json.loads(subprocess.check_output(['docker','inspect',security.compose('ps','-q','lb').stdout.strip()],text=True))[0]['Image']
subprocess.run([sys.executable,str(ROOT/'scripts/renew-leaf.py'),'lb'],check=True)
subprocess.run([sys.executable,str(ROOT/'scripts/wait-ready.py')],check=True)
security.probe('tls',target='https://api:8080/health/ready',material='lb-old',expect='deny')
security.probe('tls',target='https://api:8080/health/ready',material='lb')
after=json.loads(subprocess.check_output(['docker','inspect',security.compose('ps','-q','lb').stdout.strip()],text=True))[0]['Image'];assert before==after
(ROOT/'evidence/leaf-rotation.json').write_text(json.dumps({'image_unchanged':True,'old_leaf_rejected':True,'new_leaf_accepted':True,'verified_https_ready':True},indent=2)+'\n');print('PASS: leaf rotation without image rebuild and old-serial revocation')
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env python3
"""Bounded short-token test: sealed Bao cannot silently refresh application credentials."""
import json,subprocess,sys,time,urllib.error
from pathlib import Path
ROOT=Path(__file__).resolve().parents[1];sys.path.insert(0,str(ROOT/'scripts'));import bao,security
def main():
token=bao.operator_token();normal=bao.call('auth/cert/certs/api',token=token)['data'];short=dict(normal,token_ttl=30,token_max_ttl=30)
bao.call('auth/cert/certs/api',short,token)
security.compose('restart','api');subprocess.run([sys.executable,str(ROOT/'scripts/wait-ready.py')],check=True,stdout=subprocess.DEVNULL)
started=time.monotonic()
try:
bao.call('sys/seal',{},token)
for _ in range(55):
status,_,_=security.request('/health/ready')
if status==503:break
time.sleep(1)
else:raise AssertionError('API served beyond short grant lifetime while Bao sealed')
elapsed=time.monotonic()-started;assert elapsed<=45
finally:
bao.unseal();token=bao.operator_token();bao.call('auth/cert/certs/api',normal,token);security.compose('restart','api');subprocess.run([sys.executable,str(ROOT/'scripts/wait-ready.py')],check=True,stdout=subprocess.DEVNULL)
(ROOT/'evidence/sealed.json').write_text(json.dumps({'short_token_ttl_seconds':30,'fail_closed_seconds':elapsed,'recovered_after_operator_unseal':True,'plaintext_fallback':False},indent=2)+'\n');print('PASS: sealed OpenBao produces bounded fail-closed and recovers after operator unseal')
if __name__=='__main__':main()

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