lab7: безопасность, mTLS, OpenBao и PKI lifecycle
Application / Go invariants and static checks (pull_request) Canceled after 0s
Application / Lab7 verified TLS and retained features (pull_request) Canceled after 0s
Skeleton contracts / contracts (pull_request) Canceled after 0s

This commit is contained in:
Vladislav Kunetskiy
2026-11-10 14:39:57 +03:00
parent 20afc2c790
commit 1b6e96ccc0
570 changed files with 298308 additions and 137 deletions
+21 -4
View File
@@ -1,7 +1,24 @@
# Конфигурация наблюдаемости — реализовать
# OTel Collector
Добавьте `collector.yaml` с OTLP receivers, processors и exporters выбранной версии Collector. Укажите явные bind endpoints, внутренние сети, memory limits/batch и поведение при backpressure по уровню. Сопоставьте все три pipeline с реально развёрнутыми backend.
`collector.yaml` сохраняет traces/metrics/logs pipelines. API/worker/relay шлют
OTLP HTTP через mTLS gateway `otel-collector:4318`: только authenticated CN
`api`, `worker`, `relay` и POST `/v1/traces`, `/v1/metrics`, `/v1/logs`.
Native receiver — `127.0.0.1:14318`; отдельного gRPC receiver нет.
Добавьте конфигурации storage, Grafana provisioning/datasources, provisioning/dashboards и импортируемые dashboard JSON. На 4 — alert rules и runbooks. Пустой dashboard или debug exporter, который только печатает данные в stdout, не заменяют хранилища/доказательства из `contracts/observability.md`.
Collector экспортирует:
- метрики — loopback pull-exporter `18889`, через mTLS gateway `:8889`;
- логи — HTTPS/mTLS в `https://loki:3100/otlp` (итоговый `/otlp/v1/logs`);
- трассы — GRPCS/mTLS в `tempo:4437`, где допускается только CN `collector`.
Не публикуйте OTLP/metrics/административные ports в общую сеть без необходимости. В lab7 реализуйте TLS/mTLS по trust matrix; экспорт Authorization и message bodies запрещён.
Exporters используют own identity `current/{ca.crt,tls.crt,tls.key}` в readonly
`/run/identity`. Проверка CA/hostname не отключается. Native self-metrics —
`127.0.0.1:18888`, health — `127.0.0.1:13133`; mTLS gateways — `:8888`
(GET `/metrics`) и `:13134` (GET `/`), только CN `prometheus`/`operator`.
Native plaintext endpoints не публикуются и недоступны соседним namespaces.
`memory_limiter` — 140 MiB, batch — 5 с/1024. Loki/Tempo очереди ограничены
10 MiB (`sizer: bytes`), retry не дольше 30 с; отказ телеметрии не должен
блокировать business readiness. Gateway ACL/TLS config находятся в
`../telemetry-gateway/collector.cfg`; namespace mounts/restarts и lifecycle
trust consumers выполняет operator orchestration. Конфигурация не заменяет
live проверки доставки трёх signals, wrong-CN rejection и revocation.
+92
View File
@@ -0,0 +1,92 @@
receivers:
otlp:
protocols:
http:
endpoint: 127.0.0.1:14318
processors:
memory_limiter:
check_interval: 1s
# limit_mib, not limit_percentage: Docker Desktop cgroup limits are easy to
# misread and a percentage would fall back to the VM total.
limit_mib: 140
spike_limit_mib: 40
batch:
timeout: 5s
send_batch_size: 1024
exporters:
# Pull-based: no sending_queue/retry for this exporter.
prometheus:
endpoint: 127.0.0.1:18889
translation_strategy: UnderscoreEscapingWithSuffixes
resource_constant_labels:
included:
- service.name
- service.instance.id
- deployment.environment.name
- service.version
otlp_http/loki:
endpoint: https://loki:3100/otlp
tls:
ca_file: /run/identity/current/ca.crt
cert_file: /run/identity/current/tls.crt
key_file: /run/identity/current/tls.key
min_version: "1.2"
sending_queue:
enabled: true
sizer: bytes
queue_size: 10485760
num_consumers: 2
retry_on_failure:
enabled: true
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 30s
timeout: 5s
otlp_grpc/tempo:
endpoint: tempo:4437
tls:
ca_file: /run/identity/current/ca.crt
cert_file: /run/identity/current/tls.crt
key_file: /run/identity/current/tls.key
min_version: "1.2"
sending_queue:
enabled: true
sizer: bytes
queue_size: 10485760
num_consumers: 2
retry_on_failure:
enabled: true
initial_interval: 1s
max_interval: 5s
max_elapsed_time: 30s
timeout: 5s
extensions:
health_check:
endpoint: 127.0.0.1:13133
service:
extensions: [health_check]
telemetry:
metrics:
readers:
- pull:
exporter:
prometheus:
host: 127.0.0.1
port: 18888
pipelines:
traces:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp_grpc/tempo]
metrics:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [prometheus]
logs:
receivers: [otlp]
processors: [memory_limiter, batch]
exporters: [otlp_http/loki]