feat: implement pki-ingress-mtls
Local CA script, HTTPS ingress on :8443, mandatory mTLS LB -> API with an identity allowlist, separate health listener, random X-Instance-Id alias; tests, hooks and driver over HTTPS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: run-mtusi-messenger
|
||||
description: Запустить, остановить, прогнать и подёргать API мессенджера MTUSI (FastAPI, PostgreSQL, Valkey; лаба 3 — HAProxy перед репликами API; лаба 4 — S3 на SeaweedFS; лаба 5 — RabbitMQ, relay и worker; лаба 6 — OTel Collector, Prometheus, Loki, Tempo и Grafana) — на хосте или в Docker. Use when asked to run / start / stop the server or the stand, check telemetry (find a request in Loki and Tempo, Grafana provisioning, Collector outage, stand from scratch), run the smoke test, `make test`, `make student_test`, `make test_isolated`, `make test-persistence` or `make test-failover`, `make s3_check`, check that the S3 bucket is private, run the defense scenario or its failure windows, check the broker, the worker or the relay process, show the pipeline state, stop or restore an API replica, show X-Instance-Id distribution, check that an API change works on a live server, send a request to an endpoint, reproduce a bug over HTTP, check the containers, or call services directly without HTTP.
|
||||
description: Запустить, остановить, прогнать и подёргать API мессенджера MTUSI (FastAPI, PostgreSQL, Valkey; лаба 3 — HAProxy перед репликами API; лаба 4 — S3 на SeaweedFS; лаба 5 — RabbitMQ, relay и worker; лаба 6 — OTel Collector, Prometheus, Loki, Tempo и Grafana; лаба 7 — HTTPS на :8443, mTLS LB → API, локальный CA) — на хосте или в Docker. Use when asked to run / start / stop the server or the stand, check telemetry (find a request in Loki and Tempo, Grafana provisioning, Collector outage, stand from scratch), run the smoke test, `make test`, `make student_test`, `make test_isolated`, `make test-persistence` or `make test-failover`, `make s3_check`, `make mtls_check` (mTLS LB → API negative checks), `make pki_stand` / `pki_status` (stand certificates), check that the S3 bucket is private, run the defense scenario or its failure windows, check the broker, the worker or the relay process, show the pipeline state, stop or restore an API replica, show X-Instance-Id distribution, check that an API change works on a live server, send a request to an endpoint, reproduce a bug over HTTP, check the containers, or call services directly without HTTP.
|
||||
---
|
||||
|
||||
REST API мессенджера (пользователи, чаты, сообщения) — сервер на
|
||||
@@ -472,7 +472,7 @@ Gotchas:
|
||||
Брокер остановлен ~5–10 с, задания ждут в PostgreSQL, relay пишет «Broker is unavailable» и
|
||||
публикует их после возврата.
|
||||
- **Без `--port` у `defense-scenario`, `defense-faults`, `worker-process`, `relay-process` — код 2**
|
||||
(«no stand on port 18080»): стенд на 8080, а порт драйвера по умолчанию 18080.
|
||||
(«no stand on port 18080»): стенд на 8443 (до лабы 7 — на 8080), а порт драйвера по умолчанию 18080.
|
||||
- **Подмена окружением.** Одноразовый контейнер `worker-process` — такой же потребитель рабочей
|
||||
очереди, у `relay-process` — такой же издатель; живёт секунды и убирается `docker rm -f`: задание
|
||||
worker вернётся по аренде, дубль relay — no-op.
|
||||
@@ -678,6 +678,15 @@ python3 .claude/skills/run-mtusi-messenger/driver.py --port 8443 mtls-check #
|
||||
docker-compose.yml -f <override> up -d --no-deps --wait api`): код 1, случай «forbidden
|
||||
identity» — HTTP 200, записи нет; вернуть — `make run_docker`. Вывод —
|
||||
`evidence/security/mtls-lb-api.md`.
|
||||
- **Команды со своим HAProxy или процессом API** (задача 7.3 change, прогон 2026-11-16) — все
|
||||
работают с лабы 7, неподдерживаемых нет: `lb-upload-timeouts` (файлы PKI стенда в LB и
|
||||
заглушку, заглушка — TLS 1.3 с проверкой клиента), `freeze-lb` (временный проект берёт
|
||||
`secrets` из `.pki/stand/`, клиенты — HTTPS с CA стенда), `freeze-sessions` (вызовы ASGI в
|
||||
процессе одноразового контейнера, TLS не нужен), одноразовый контейнер `telemetry-check` с
|
||||
`OTEL_*`, `stand-from-scratch` и `--fresh-pki` — код 0 (у `telemetry-check` до правки
|
||||
`KNOWN_ISSUES.md` «`service.version` телеметрии — 1.6.0» — одна строка FAIL, не связанная с
|
||||
TLS). Не работают до change `https-tooling` только `make test_isolated`, `make
|
||||
failure_checks`, CI и профили `bench/` (раздел в начале).
|
||||
|
||||
## Direct invocation (без HTTP)
|
||||
|
||||
@@ -728,7 +737,7 @@ HTTP-коды: `authenticate(token="x")` бросает `Unauthenticated`, не
|
||||
## Run (human path)
|
||||
|
||||
```bash
|
||||
make run_dev # Postgres + миграции, Valkey, S3 + bootstrap, затем 127.0.0.1:8080, reload по src/; Ctrl-C
|
||||
make run_dev # pki_stand, Postgres + миграции, Valkey, S3 + bootstrap, затем https://localhost:8080 (ingress, без проверки клиента), reload по src/; Ctrl-C
|
||||
```
|
||||
|
||||
Блокирует терминал — агенту не подходит, используй `driver.py start`.
|
||||
|
||||
Reference in New Issue
Block a user