feat: scan images and uv.lock for vulnerabilities with a triage file and patch-line updates
make scan runs pinned Trivy (by digest, no Docker socket, images as docker save archives, network none, read-only) over every compose image and the app image (also secrets in layers) and pinned pip-audit over the uv.lock groups; every CRITICAL/HIGH image finding, secret and pip-audit finding needs a triage record (verdict, reason, control, review date) in infra/scan/triage.toml, otherwise a non-zero exit. Fixable findings are updated within the patch line after a 7-day quarantine: PostgreSQL and RabbitMQ rebuilds, Valkey 9.1.4, HAProxy 3.4.7, Loki 3.7.10, Python 3.12.15, certifi, dnspython, black, filelock, virtualenv. 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; лаба 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 storage_tls_check` (TLS to PostgreSQL, Valkey and S3 negative checks), `make broker_mtls_check` (mTLS to RabbitMQ, relay and worker rights negative checks), `make telemetry_tls_check` (mTLS to the OTel Collector gateway negative checks), `make hardening_check` (container capabilities, users, read-only roots, pids limits, ports), `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.
|
||||
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 storage_tls_check` (TLS to PostgreSQL, Valkey and S3 negative checks), `make broker_mtls_check` (mTLS to RabbitMQ, relay and worker rights negative checks), `make telemetry_tls_check` (mTLS to the OTel Collector gateway negative checks), `make hardening_check` (container capabilities, users, read-only roots, pids limits, ports), `make scan` (image and uv.lock vulnerability scan with triage), `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 мессенджера (пользователи, чаты, сообщения) — сервер на
|
||||
@@ -1098,6 +1098,24 @@ make s3_check # с change — ещё строки gRPC ш
|
||||
- **Журнал `s3`**: `W … propagating_store.go … failed to propagate change to s3 server
|
||||
127.0.0.1:18333` — ожидаемо (толчок filer без TLS отвергается, доставка — подпиской).
|
||||
|
||||
## Лаба 7: scan образов и зависимостей
|
||||
|
||||
Change `vulnerability-scan` (`docker.md`, «Scan образов и зависимостей»). Не команда драйвера:
|
||||
`infra/scan/scan.py` на Python проекта (`tomllib`), стенд и `.env` не нужны.
|
||||
|
||||
```bash
|
||||
make scan # ~1–2 мин: образы модели compose + образ приложения (Trivy по digest), uv.lock (pip-audit); 0 / 1 / 2
|
||||
make scan REPORT=1 # те же сведения без вердикта (состояние «до»)
|
||||
make scan SCAN_OUT=/tmp/scan-raw # сырые JSON Trivy и pip-audit для разбора (каталог внутри репозитория — код 2)
|
||||
uv run --frozen python infra/scan/scan.py --only python --project-dir <копия> # контроль: только uv.lock копии проекта
|
||||
```
|
||||
|
||||
- Код 1 — обязательная находка без действующей записи `infra/scan/triage.toml` (или срок записи
|
||||
прошёл); новая база Trivy (раз в сутки) может дать код 1 без изменений кода — разбор или
|
||||
обновление по правилу `docker.md`.
|
||||
- Рабочий стенд scan не трогает: тег `mtusi-messenger:scan`, контейнеры сканера — с меткой
|
||||
`mtusi.scan`, без сети и сокета Docker.
|
||||
|
||||
## Direct invocation (без HTTP)
|
||||
|
||||
Для правок в `src/core/` сервисы вызываются поверх единицы работы, сервер не
|
||||
|
||||
Reference in New Issue
Block a user