forked from mtusi2026/mtusi2026lab7
37 lines
1.6 KiB
INI
37 lines
1.6 KiB
INI
# mTLS-шлюз Prometheus (Prometheus в namespace этого контейнера слушает только 127.0.0.1:9091).
|
|
# otel-collector — только OTLP-запись; tempo — только remote write (метрики metrics-generator);
|
|
# grafana — только чтение /api/v1/* (без admin/записи и remote read). Остальное — 403.
|
|
global
|
|
log stdout format raw local0 notice
|
|
maxconn 1024
|
|
ssl-default-bind-options ssl-min-ver TLSv1.2 no-tls-tickets
|
|
stats socket /tmp/haproxy.sock mode 600 level admin
|
|
|
|
defaults
|
|
mode http
|
|
log global
|
|
option httplog
|
|
option dontlognull
|
|
timeout connect 1s
|
|
timeout client 60s
|
|
timeout server 60s
|
|
timeout http-request 10s
|
|
timeout http-keep-alive 30s
|
|
# Отказ в доступе — 403 с причиной (без деталей сертификата).
|
|
errorfile 403 /usr/local/etc/haproxy/403.http
|
|
|
|
frontend prometheus
|
|
bind :9090 ssl crt /run/tls/self/tls.pem ca-file /run/tls/trust/ca.crt crl-file /run/tls/trust/crl.pem verify required alpn http/1.1
|
|
acl id_collector ssl_c_s_dn(CN) -m str otel-collector
|
|
acl id_tempo ssl_c_s_dn(CN) -m str tempo
|
|
acl id_grafana ssl_c_s_dn(CN) -m str grafana
|
|
acl write_api path_beg /api/v1/admin /api/v1/write /api/v1/otlp /api/v1/read
|
|
http-request allow if id_collector METH_POST { path /api/v1/otlp/v1/metrics }
|
|
http-request allow if id_tempo METH_POST { path /api/v1/write }
|
|
http-request allow if id_grafana { path_beg /api/v1/ } !write_api
|
|
http-request deny deny_status 403
|
|
default_backend prometheus
|
|
|
|
backend prometheus
|
|
server p 127.0.0.1:9091
|