ЛР 7 — БВТ2301 — Курлова — на 4

Перенесён минимум lab6 (API без изменений), добавлена защита на границах доверия:
- внешний HTTPS; обязательный mTLS LB -> API с allowlist identity и отзывом по serial;
- TLS на всех связях: PostgreSQL verify-full, MinIO HTTPS, RabbitMQ AMQPS mTLS (EXTERNAL),
  Valkey TLS + ACL, Collector и хранилища телеметрии через mTLS с отдельными CA;
- OpenBao в server mode: cert auth, токены 15 мин, политики только на свой путь;
- роли БД, S3-политики и права брокера по принципу минимальных прав;
- Argon2id с замером, rehash, общий лимит входа, бюджет защиты от login DoS;
- hardening всех контейнеров, scan образов с разбором, модель угроз, матрица доверия;
- отрицательные тесты: TLS-аудит (135 проверок), ACL, ротации, sealed OpenBao.
This commit is contained in:
alenchha
2026-11-16 10:49:13 +03:00
parent 20afc2c790
commit 861e7722b5
116 changed files with 14522 additions and 63 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,9 @@
apiVersion: 1
providers:
- name: messenger
folder: Messenger
type: file
disableDeletion: true
allowUiUpdates: false
options:
path: /var/lib/grafana/dashboards
@@ -0,0 +1,63 @@
# Grafana 11.5.2 datasources (fixed uids are referenced by the dashboard JSON). Grafana stores no signals itself.
# "$$" escapes "$" from Grafana's env-variable interpolation; $__file{...} reads the client TLS material.
# lab7: every datasource uses HTTPS, verifies the server against the lab root CA and authenticates with grafana-out.
apiVersion: 1
datasources:
- name: Prometheus
uid: prometheus
type: prometheus
access: proxy
url: https://prometheus:9090
isDefault: true
jsonData:
tlsAuth: true
tlsAuthWithCACert: true
timeInterval: 15s
prometheusType: Prometheus
secureJsonData:
tlsCACert: "$__file{/run/secrets/ca.crt}"
tlsClientCert: "$__file{/run/secrets/client.crt}"
tlsClientKey: "$__file{/run/secrets/client.key}"
- name: Loki
uid: loki
type: loki
access: proxy
url: https://loki:3100
jsonData:
tlsAuth: true
tlsAuthWithCACert: true
maxLines: 1000
derivedFields:
# trace_id is OTLP structured metadata -> link "Open trace" to Tempo.
- name: TraceID
matcherType: label
matcherRegex: trace_id
datasourceUid: tempo
url: "$${__value.raw}"
urlDisplayLabel: Open trace
secureJsonData:
tlsCACert: "$__file{/run/secrets/ca.crt}"
tlsClientCert: "$__file{/run/secrets/client.crt}"
tlsClientKey: "$__file{/run/secrets/client.key}"
- name: Tempo
uid: tempo
type: tempo
access: proxy
url: https://tempo:3200
jsonData:
tlsAuth: true
tlsAuthWithCACert: true
tracesToLogsV2:
datasourceUid: loki
spanStartTimeShift: "-5m"
spanEndTimeShift: "5m"
filterByTraceID: true
filterBySpanID: false
customQuery: true
query: '{service_name=~"messenger-.*"} | trace_id="$${__trace.traceId}"'
nodeGraph:
enabled: true
secureJsonData:
tlsCACert: "$__file{/run/secrets/ca.crt}"
tlsClientCert: "$__file{/run/secrets/client.crt}"
tlsClientKey: "$__file{/run/secrets/client.key}"