Files
mtusi2026lab7/contracts/trust-matrix.md
T

21 lines
4.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Матрица доверия
Service CA подписывает серверы и клиентские leaf приложения. Отдельные CA telemetry и collector ограничивают доступ к хранилищам сигналов. Bootstrap выпускает leaf на 7 суток и CA на 365 суток. Имена серверов из таблицы проверяются по DNS SAN, кроме локальных HTTPS URL, для которых выданы также localhost и 127.0.0.1.
| Связь | Endpoint и проверка сервера | Клиент и ACL | Проверка |
| --- | --- | --- | --- |
| Клиент → ingress | `https://localhost:8443`, service CA | Bearer, SHA-256 в БД, TTL 3600 с, ACL чата | `make test test-security CA_FILE=secrets/tls/service-ca/ca.crt`, `student-tests/auth_security.py` |
| LB → обе API | `https://api:8080`, service CA, SNI/verifyhost api | leaf `DNS:lb-client`, CRL, обязательный client cert | `student-tests/tls-audit.sh`, положительные и отрицательные подключения |
| API/worker/reconciler → PostgreSQL | `postgres:5432`, service CA, SSL с проверкой имени | раздельные SCRAM-роли и SQL grants; API имеет доступ к пользовательским данным, worker ограничен pipeline | `student-tests/worker_compromise.py`, `pg_stat_ssl`, SQLSTATE 42501/28P01 |
| API/worker/reconciler → S3 | `https://s3:9000`, service CA | SigV4 с отдельными ключами, prefix ACL, List только у reconciler и оператора | `student-tests/worker_compromise.py`, staged read / private deny / старый ключ 403 |
| API/worker → RabbitMQ | `amqps://rabbitmq:5671/messenger`, service CA | EXTERNAL по CN, `api` публикует в attachments, текущий `worker-*` читает attachments.process; declare запрещён | `student-tests/tls-audit.sh`, `student-tests/worker_compromise.py` |
| API/worker → Collector | `https://otel-collector:4318`, service CA | HAProxy требует client cert и CN `api` или выданный `worker-*`, проверяет CRL, разрешает только OTLP POST | `student-tests/tls-audit.sh`, `student-tests/worker_compromise.py` |
| Collector → хранилища | `prometheus:9090`, `loki:3100` по HTTPS, `tempo:4317` по OTLP gRPC/TLS, service CA | клиентский cert от collector CA; Tempo ingest доверяет только collector CA | `student-tests/telemetry_check.py`, `student-tests/tls-audit.sh` |
| Grafana → источники | HTTPS `prometheus:9090`, `loki:3100`, `tempo:3200`, service CA | `grafana-query` от telemetry CA, доступ в UI аутентифицирован | provisioning, `student-tests/telemetry_check.py`, `student-tests/tls-audit.sh` |
| Сервисы → OpenBao | `https://openbao:8200`, service CA | cert auth с pinned leaf, API/worker/reconciler читают каждый свой KV; TTL 45 с, re-auth 5 с | `student-tests/worker_compromise.py`, `student-tests/bao_expiry.py` |
| Оператор | `https://localhost:8200`, `https://localhost:3000`; S3 через внутреннюю сеть | OpenBao root и Shamir у оператора, Grafana Basic, отдельный S3 admin для bootstrap | `scripts/bao.py`, HTTPS Grafana и bootstrap bucket |
| Redis/Valkey | Н/П | Сессии в PostgreSQL | HTTPS persistence |
| Replication | Н/П | Две независимые API-реплики; брокер и хранилища в одном экземпляре | HTTPS failover обеих API-реплик |
Collector скрейпит `https://lb:8404` и `https://rabbitmq:15691` с client cert от collector CA. Prometheus проверяет серверные сертификаты источников и использует отдельный cert `prometheus-scrape`. Локальные HTTP hop находятся в закрытом namespace: процесс OTel слушает `127.0.0.1:14318`, доступны только его ingress и self-scrape, а внутренние master/filer/volume SeaweedFS находятся на loopback одного контейнера. API имеет отдельный HTTP socket на `127.0.0.1:8081`, отдающий только состояние процесса. Bootstrap БД использует Unix socket с peer map для пользователя postgres. Сеть и порты видны через `docker compose config`.