Files
mtusi2026lab7/evidence/lab7-tls-matrix.json
T
zemiles 9cc80d2529 ЛР 7 — БПИ2303 — Лазарев — на 3
Перенесена реализация lab6; бизнес-API без изменений, транспорт — HTTPS.

- Внешний HTTPS (public-ca) на 127.0.0.1:8443; HSTS, TLS >= 1.2.
- Обязательное mTLS LB -> каждая API-реплика: API проверяет цепочку
  internal-ca и SAN клиента (allowlist: lb); health только на 127.0.0.1.
- TLS с проверкой сервера ко всем зависимостям: PostgreSQL verify-full
  (pg_hba только hostssl), HTTPS S3, AMQPS, OTLP/HTTPS с client cert,
  mTLS Collector -> Prometheus/Loki/Tempo, Grafana -> datasources, scrape.
- OpenBao 2.7.2 не в dev-mode: Raft на volume, init/unseal оператором,
  auth/cert с ролью и policy на сервис, TTL 15 мин + renew/re-login.
- Отдельные роли PostgreSQL с грантами по таблицам; разные ключи S3 и
  пользователи брокера выдаются из OpenBao.
- Argon2id (m=19 MiB, t=2, p=1, замер на стенде) и rehash при входе.
- Случайный X-Instance-Id; hardening контейнеров (non-root, cap_drop ALL,
  no-new-privileges, read-only, лимиты); TCP_NODELAY на сокете API.
- Модель угроз, trust matrix, отрицательные тесты TLS/mTLS, API, OpenBao,
  hardening; evidence, в т.ч. прогон из чистого clone.
2026-11-18 23:59:35 +03:00

607 lines
14 KiB
JSON

{
"checked_at": "2026-11-18T20:26:44Z",
"total": 67,
"failed": 0,
"results": [
{
"link": "LB->API",
"case": "replicas_resolved",
"pass": true,
"detail": 2
},
{
"link": "LB->API[0]",
"case": "no client cert",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV13_ALERT_CERTIFICATE_REQUIRED",
"pass": true,
"note": ""
},
{
"link": "LB->API[0]",
"case": "client cert of rogue CA, SAN lb",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV1_ALERT_UNKNOWN_CA",
"pass": true,
"note": ""
},
{
"link": "LB->API[0]",
"case": "trusted CA, identity intruder",
"expect": "fail",
"observed": "fail",
"detail": "closed_after_handshake_no_http_response",
"pass": true,
"note": ""
},
{
"link": "LB->API[0]",
"case": "plaintext HTTP to 8443",
"expect": "fail",
"observed": "fail",
"detail": "reset_by_server",
"pass": true,
"note": ""
},
{
"link": "LB->API[0]",
"case": "health listener 8081 from network",
"expect": "fail",
"observed": "fail",
"detail": "connection_refused",
"pass": true,
"note": ""
},
{
"link": "LB->API[0]",
"case": "server cert, wrong expected hostname",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:Hostname mismatch, certificate is not valid for 'db'.",
"pass": true,
"note": ""
},
{
"link": "LB->API[0]",
"case": "identity lb -> /health/ready",
"expect": "ok",
"observed": "ok",
"detail": 200,
"pass": true,
"note": "status=200"
},
{
"link": "LB->API[0]",
"case": "identity lb, no Bearer -> business API",
"expect": "ok",
"observed": "ok",
"detail": 401,
"pass": true,
"note": "mTLS не заменяет сессию: ожидается 401, получено 401"
},
{
"link": "LB->API[1]",
"case": "no client cert",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV13_ALERT_CERTIFICATE_REQUIRED",
"pass": true,
"note": ""
},
{
"link": "LB->API[1]",
"case": "client cert of rogue CA, SAN lb",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV1_ALERT_UNKNOWN_CA",
"pass": true,
"note": ""
},
{
"link": "LB->API[1]",
"case": "trusted CA, identity intruder",
"expect": "fail",
"observed": "fail",
"detail": "closed_after_handshake_no_http_response",
"pass": true,
"note": ""
},
{
"link": "LB->API[1]",
"case": "plaintext HTTP to 8443",
"expect": "fail",
"observed": "fail",
"detail": "reset_by_server",
"pass": true,
"note": ""
},
{
"link": "LB->API[1]",
"case": "health listener 8081 from network",
"expect": "fail",
"observed": "fail",
"detail": "connection_refused",
"pass": true,
"note": ""
},
{
"link": "LB->API[1]",
"case": "server cert, wrong expected hostname",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:Hostname mismatch, certificate is not valid for 'db'.",
"pass": true,
"note": ""
},
{
"link": "LB->API[1]",
"case": "identity lb -> /health/ready",
"expect": "ok",
"observed": "ok",
"detail": 200,
"pass": true,
"note": "status=200"
},
{
"link": "LB->API[1]",
"case": "identity lb, no Bearer -> business API",
"expect": "ok",
"observed": "ok",
"detail": 401,
"pass": true,
"note": "mTLS не заменяет сессию: ожидается 401, получено 401"
},
{
"link": "API/worker->PostgreSQL",
"case": "sslmode=disable (plaintext)",
"expect": "fail",
"observed": "fail",
"detail": "connection failed: connection to server at \"192.168.0.3\", port 5432 failed: fatal: pg_hba.conf rejects connection for h",
"pass": true,
"note": ""
},
{
"link": "API/worker->PostgreSQL",
"case": "verify-full, rogue CA as trust",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client",
"pass": true,
"note": ""
},
{
"link": "API/worker->PostgreSQL",
"case": "verify-full by IP (SAN mismatch)",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client",
"pass": true,
"note": ""
},
{
"link": "API/worker->PostgreSQL",
"case": "verify-full, internal CA, wrong pwd",
"expect": "ok",
"observed": "ok",
"detail": "tls_ok_then_password_rejected",
"pass": true,
"note": "TLS проверен; дальше SCRAM отклоняет неверный пароль"
},
{
"link": "API/worker->S3",
"case": "plaintext HTTP",
"expect": "fail",
"observed": "fail",
"detail": "http_400_plain_http_sent_to_https_port",
"pass": true,
"note": ""
},
{
"link": "API/worker->S3",
"case": "HTTPS, rogue CA as trust",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:unable to get local issuer certificate",
"pass": true,
"note": ""
},
{
"link": "API/worker->S3",
"case": "HTTPS verified, anonymous list",
"expect": "ok",
"observed": "ok",
"detail": 403,
"pass": true,
"note": "TLS ok; анонимно: 403 (ожидается 403)"
},
{
"link": "API/worker->broker",
"case": "plaintext AMQP 5672",
"expect": "fail",
"observed": "fail",
"detail": "connection_refused",
"pass": true,
"note": ""
},
{
"link": "API/worker->broker",
"case": "AMQPS, rogue CA as trust",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:self-signed certificate in certificate chain",
"pass": true,
"note": ""
},
{
"link": "API/worker->broker",
"case": "AMQPS, client cert of rogue CA",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV1_ALERT_UNKNOWN_CA",
"pass": true,
"note": "verify_peer: предъявленный чужой сертификат отвергается"
},
{
"link": "API/worker->broker",
"case": "AMQPS verified (без cert), Connection.Start",
"expect": "ok",
"observed": "ok",
"detail": "amqp_connection_start",
"pass": true,
"note": "далее аутентификация паролем + ACL vhost (проверка прав — broker_permissions)"
},
{
"link": "API/worker->broker",
"case": "AMQPS, user worker, wrong password",
"expect": "fail",
"observed": "fail",
"detail": "auth_refused",
"pass": true,
"note": ""
},
{
"link": "Prometheus->broker metrics",
"case": "HTTPS 15691 without client cert",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV13_ALERT_CERTIFICATE_REQUIRED",
"pass": true,
"note": ""
},
{
"link": "Prometheus->broker metrics",
"case": "plaintext 15692 from network",
"expect": "fail",
"observed": "fail",
"detail": "connection_refused",
"pass": true,
"note": ""
},
{
"link": "API/worker->Collector",
"case": "plaintext",
"expect": "fail",
"observed": "fail",
"detail": "http_400_plain_http_sent_to_https_port",
"pass": true,
"note": ""
},
{
"link": "API/worker->Collector",
"case": "TLS without client cert",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV13_ALERT_CERTIFICATE_REQUIRED",
"pass": true,
"note": ""
},
{
"link": "API/worker->Collector",
"case": "TLS, client cert of rogue CA",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV1_ALERT_UNKNOWN_CA",
"pass": true,
"note": ""
},
{
"link": "API/worker->Collector",
"case": "TLS, wrong expected hostname",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:Hostname mismatch, certificate is not valid for 'api'.",
"pass": true,
"note": ""
},
{
"link": "Collector/Grafana->Prometheus",
"case": "plaintext",
"expect": "fail",
"observed": "fail",
"detail": "http_400_plain_http_sent_to_https_port",
"pass": true,
"note": ""
},
{
"link": "Collector/Grafana->Prometheus",
"case": "TLS without client cert",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV13_ALERT_CERTIFICATE_REQUIRED",
"pass": true,
"note": ""
},
{
"link": "Collector/Grafana->Prometheus",
"case": "TLS, client cert of rogue CA",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV1_ALERT_UNKNOWN_CA",
"pass": true,
"note": ""
},
{
"link": "Collector/Grafana->Prometheus",
"case": "TLS, wrong expected hostname",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:Hostname mismatch, certificate is not valid for 'api'.",
"pass": true,
"note": ""
},
{
"link": "Collector/Grafana->Loki",
"case": "plaintext",
"expect": "fail",
"observed": "fail",
"detail": "http_400_plain_http_sent_to_https_port",
"pass": true,
"note": ""
},
{
"link": "Collector/Grafana->Loki",
"case": "TLS without client cert",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV13_ALERT_CERTIFICATE_REQUIRED",
"pass": true,
"note": ""
},
{
"link": "Collector/Grafana->Loki",
"case": "TLS, client cert of rogue CA",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV1_ALERT_UNKNOWN_CA",
"pass": true,
"note": ""
},
{
"link": "Collector/Grafana->Loki",
"case": "TLS, wrong expected hostname",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:Hostname mismatch, certificate is not valid for 'api'.",
"pass": true,
"note": ""
},
{
"link": "Grafana->Tempo",
"case": "plaintext",
"expect": "fail",
"observed": "fail",
"detail": "http_400_plain_http_sent_to_https_port",
"pass": true,
"note": ""
},
{
"link": "Grafana->Tempo",
"case": "TLS without client cert",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV13_ALERT_CERTIFICATE_REQUIRED",
"pass": true,
"note": ""
},
{
"link": "Grafana->Tempo",
"case": "TLS, client cert of rogue CA",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:SSLEOFError",
"pass": true,
"note": ""
},
{
"link": "Grafana->Tempo",
"case": "TLS, wrong expected hostname",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:Hostname mismatch, certificate is not valid for 'api'.",
"pass": true,
"note": ""
},
{
"link": "Collector->Tempo OTLP gRPC",
"case": "plaintext",
"expect": "fail",
"observed": "fail",
"detail": "closed_without_plaintext_response",
"pass": true,
"note": ""
},
{
"link": "Collector->Tempo OTLP gRPC",
"case": "TLS without client cert",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV13_ALERT_CERTIFICATE_REQUIRED",
"pass": true,
"note": ""
},
{
"link": "Collector->Tempo OTLP gRPC",
"case": "TLS, client cert of rogue CA",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV1_ALERT_UNKNOWN_CA",
"pass": true,
"note": ""
},
{
"link": "Collector->Tempo OTLP gRPC",
"case": "TLS, wrong expected hostname",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:Hostname mismatch, certificate is not valid for 'api'.",
"pass": true,
"note": ""
},
{
"link": "Prometheus->LB metrics",
"case": "plaintext",
"expect": "fail",
"observed": "fail",
"detail": "closed_without_plaintext_response",
"pass": true,
"note": ""
},
{
"link": "Prometheus->LB metrics",
"case": "TLS without client cert",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV13_ALERT_CERTIFICATE_REQUIRED",
"pass": true,
"note": ""
},
{
"link": "Prometheus->LB metrics",
"case": "TLS, client cert of rogue CA",
"expect": "fail",
"observed": "fail",
"detail": "tls_alert:TLSV1_ALERT_UNKNOWN_CA",
"pass": true,
"note": ""
},
{
"link": "Prometheus->LB metrics",
"case": "TLS, wrong expected hostname",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:Hostname mismatch, certificate is not valid for 'api'.",
"pass": true,
"note": ""
},
{
"link": "internal-only port",
"case": "otel-collector:4317 from network",
"expect": "fail",
"observed": "fail",
"detail": "connection_refused",
"pass": true,
"note": ""
},
{
"link": "internal-only port",
"case": "otel-collector:8888 from network",
"expect": "fail",
"observed": "fail",
"detail": "connection_refused",
"pass": true,
"note": ""
},
{
"link": "internal-only port",
"case": "otel-collector:13133 from network",
"expect": "fail",
"observed": "fail",
"detail": "connection_refused",
"pass": true,
"note": ""
},
{
"link": "internal-only port",
"case": "loki:9095 from network",
"expect": "fail",
"observed": "fail",
"detail": "connection_refused",
"pass": true,
"note": ""
},
{
"link": "internal-only port",
"case": "tempo:9096 from network",
"expect": "fail",
"observed": "fail",
"detail": "connection_refused",
"pass": true,
"note": ""
},
{
"link": "API/worker->Collector",
"case": "trusted CA, foreign identity (intruder)",
"expect": "documented",
"observed": "ok",
"detail": 405,
"pass": true,
"note": "level 3: CA-only mTLS; разграничение identity — уровень 4 (см. trust-matrix)"
},
{
"link": "services->OpenBao",
"case": "plaintext HTTP",
"expect": "fail",
"observed": "fail",
"detail": "http_400_plain_http_sent_to_https_port",
"pass": true,
"note": ""
},
{
"link": "services->OpenBao",
"case": "TLS, rogue CA as trust",
"expect": "fail",
"observed": "fail",
"detail": "server_cert_rejected_by_client:unable to get local issuer certificate",
"pass": true,
"note": ""
},
{
"link": "services->OpenBao",
"case": "TLS verified, /v1/sys/health",
"expect": "ok",
"observed": "ok",
"detail": 200,
"pass": true,
"note": ""
},
{
"link": "services->OpenBao",
"case": "cert login as role api with intruder cert",
"expect": "fail",
"observed": "fail",
"detail": "http_400",
"pass": true,
"note": ""
},
{
"link": "services->OpenBao",
"case": "cert login as role api with lb cert",
"expect": "fail",
"observed": "fail",
"detail": "http_400",
"pass": true,
"note": "сертификат того же CA, но SAN не api -> роль не подходит"
},
{
"link": "services->OpenBao",
"case": "cert login without client cert",
"expect": "fail",
"observed": "fail",
"detail": "http_400",
"pass": true,
"note": ""
}
]
}