Перенесена реализация 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.
9 lines
2.3 KiB
Plaintext
9 lines
2.3 KiB
Plaintext
[ 0.20s] message sent {"request_id": "e755c640d7c64606817798996b38e737", "trace_id": "a5395a7a0d14fddbe988dd3fbc8052c3", "instance": "r-f7dd6d1932"}
|
|
[ 2.25s] message trace in Tempo {"spans": 4, "server_ms": 5.068, "db_spans": ["db get_session_user", "db get_chat_for", "db add_message"]}
|
|
[ 2.28s] structured API log in Loki {"event": "http.request", "trace_id": "a5395a7a0d14fddbe988dd3fbc8052c3", "span_id": "96d2ff4278525fc6", "severity": "INFO", "service_name": "messenger-api", "line": "POST /api/v1/chats/{chat_id}/messages -> 201 4.7ms request_id=e755c640d7c64606817798996b38e737"}
|
|
[ 2.63s] upload accepted and ready {"attachment_id": "530ec172-4a69-4d17-b809-7c4f1323c9af", "trace_id": "f257a257a05eb9b2129200a8a2e3763f", "status": "ready"}
|
|
[ 5.78s] one trace upload -> relay -> worker {"spans": 26, "services": ["messenger-api", "messenger-relay", "messenger-worker"], "job_id": "2febd212-9808-4ff5-bf84-f3e5b6f8a705", "outbox_traceparent": "00-f257a257a05eb9b2129200a8a2e3763f-974c4ff4bf81a0a4-03", "process_parent_is_send": true, "send_parent_is_create": true, "worker_s3_puts": 4, "api_to_worker_gap_ms": 6.8, "process_ms": 146.945, "outcome": "ready"}
|
|
[ 5.80s] worker structured logs in Loki by trace_id {"events": ["job.claimed", "job.completed"], "job_id": "2febd212-9808-4ff5-bf84-f3e5b6f8a705", "span_id": "daa51e4f3cc7737a", "line": "job 2febd212-9808-4ff5-bf84-f3e5b6f8a705 attempt 1 -> ready in 131ms"}
|
|
[ 9.21s] no secrets/bodies in telemetry, no ID labels in metrics {"leaks": {"loki:message_text": 0, "loki:password": 0, "loki:token": 0, "loki:filename": 0, "tempo:message_text": 0, "tempo:password": 0, "tempo:token": 0, "tempo:filename": 0}, "metric_labels": ["__name__", "db_client_connection_pool_name", "db_client_connection_state", "db_operation_name", "db_system_name", "deployment_environment_name", "error_type", "http_request_method", "http_response_status_class", "http_response_status_code", "http_route", "instance", "job", "le", "messenger_job_outcome", "messenger_job_status", "messenger_job_type", "messenger_s3_operation", "otel_component_name", "otel_component_type", "otel_span_parent_origin", "otel_span_sampling_result", "outcome", "reason", "server_address", "server_port", "service_version", "telemetry_sdk_language", "telemetry_sdk_name", "telemetry_sdk_version"]}
|
|
PASS: correlation request->trace->log and upload->relay->worker
|