feat: require mTLS with certificate login for RabbitMQ and split relay and worker rights

Broker accepts only TLS 1.3 with a client certificate checked against the
stand CRL; login is EXTERNAL by certificate DNS SAN, broker passwords are
gone. Relay may declare its queue and publish, worker may only consume.
Definitions and TLS material checks come from infra/rabbitmq/start.sh;
temporary stands, CI, bench and the fault hook use the same mTLS identities.
Adds make broker_mtls_check [REPORT=1] and drops the rollback broker compose.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 21:34:47 +03:00
co-authored by Claude Opus 5.5
parent 2474e4cb28
commit 8236027e92
52 changed files with 3888 additions and 243 deletions
+15 -1
View File
@@ -111,6 +111,17 @@ STAND_TLS = {
"s3": "https only, verify-full",
},
}
# брокер профилей с обработкой (change messaging-telemetry-mtls, design, решение
# 10): только TLS 1.3 с сертификатом клиента и CRL, вход по identity relay и
# worker (EXTERNAL, их раздельные права), PKI прогона; плагин метрик профиля
# очереди — HTTP без TLS только в сети стенда замера, порт на хосте не
# публикуется
STAND_BROKER_TLS = {
"transport": "amqps tls1.3 only, client certificate required, CRL",
"login": "EXTERNAL by DNS SAN: relay, worker; no passwords",
"pki": "per-run CA",
"metrics_port": "15692 http, bench network only, not published",
}
# транспорт к хранилищам варианта профиля входа: образ «до» (56ccb79) — код до
# change storage-tls: asyncpg по умолчанию sslmode=prefer (TLS без проверки
# сервера: PostgreSQL принимает только TLS, pg_hba стенда тот же), Valkey без
@@ -2229,7 +2240,6 @@ def compose_env(profile: Profile) -> dict[str, str]:
"S3_CLEANER_SECRET_KEY": secrets.token_hex(20),
"S3_WORKER_ACCESS_KEY": secrets.token_hex(10),
"S3_WORKER_SECRET_KEY": secrets.token_hex(20),
"RABBITMQ_DEFAULT_PASS": secrets.token_urlsafe(24),
"GRAFANA_ADMIN_PASSWORD": secrets.token_hex(16),
"BENCH_APP_CPUS": profile.cpus,
"BENCH_APP_MEMORY": profile.memory,
@@ -4201,6 +4211,10 @@ class Stand:
if self.profile.runs_pipeline:
# брокер запускают только профили очереди и цены телеметрии
extra["rabbitmq"] = image(BROKER)
# транспорт брокера и граница порта метрик (change
# messaging-telemetry-mtls, design, решение 10): метки до change с
# новыми — разная методика
extra["broker_tls"] = dict(STAND_BROKER_TLS)
# режим телеметрии стенда (design change track1-telemetry-cost,
# решение 13): у цены телеметрии — вариант прогона
extra["telemetry"] = {"mode": "on" if self.telemetry else "off"}