forked from mtusi2026/mtusi2026lab7
lab7: PKI, mTLS infra, OpenBao non-dev, hardening, lifecycle scripts
This commit is contained in:
@@ -6,7 +6,7 @@ global:
|
||||
rule_files:
|
||||
- /etc/prometheus/rules/*.yml
|
||||
|
||||
# Метрики API/worker приходят только по OTLP (--web.enable-otlp-receiver);
|
||||
# Метрики API/worker приходят только по OTLP (--web.enable-otlp-receiver) по mTLS + Basic Auth.
|
||||
# /internal/metrics — legacy JSON, не exposition-формат, и не скрейпится.
|
||||
otlp:
|
||||
translation_strategy: UnderscoreEscapingWithSuffixes
|
||||
@@ -20,15 +20,59 @@ storage:
|
||||
|
||||
scrape_configs:
|
||||
- job_name: prometheus
|
||||
scheme: https
|
||||
tls_config:
|
||||
ca_file: /run/certs/ca.crt
|
||||
cert_file: /run/certs/client.crt
|
||||
key_file: /run/certs/client.key
|
||||
server_name: localhost
|
||||
basic_auth:
|
||||
username: prometheus-self
|
||||
password_file: /run/secrets/prometheus_self_password
|
||||
static_configs: [{ targets: ['localhost:9090'] }]
|
||||
|
||||
- job_name: otel-collector
|
||||
scheme: https
|
||||
tls_config:
|
||||
ca_file: /run/certs/ca.crt
|
||||
cert_file: /run/certs/client.crt
|
||||
key_file: /run/certs/client.key
|
||||
server_name: otel-collector
|
||||
static_configs: [{ targets: ['otel-collector:8888'] }]
|
||||
|
||||
- job_name: haproxy
|
||||
scheme: https
|
||||
metrics_path: /metrics
|
||||
tls_config:
|
||||
ca_file: /run/certs/ca.crt
|
||||
cert_file: /run/certs/client.crt
|
||||
key_file: /run/certs/client.key
|
||||
server_name: haproxy
|
||||
static_configs: [{ targets: ['haproxy:8404'] }]
|
||||
|
||||
- job_name: rabbitmq
|
||||
static_configs: [{ targets: ['broker:15692'] }]
|
||||
scheme: https
|
||||
tls_config:
|
||||
ca_file: /run/certs/ca.crt
|
||||
cert_file: /run/certs/client.crt
|
||||
key_file: /run/certs/client.key
|
||||
server_name: broker
|
||||
static_configs: [{ targets: ['broker:15691'] }]
|
||||
|
||||
- job_name: loki
|
||||
scheme: https
|
||||
tls_config:
|
||||
ca_file: /run/certs/ca.crt
|
||||
cert_file: /run/certs/client.crt
|
||||
key_file: /run/certs/client.key
|
||||
server_name: loki
|
||||
static_configs: [{ targets: ['loki:3100'] }]
|
||||
|
||||
- job_name: tempo
|
||||
scheme: https
|
||||
tls_config:
|
||||
ca_file: /run/certs/ca.crt
|
||||
cert_file: /run/certs/client.crt
|
||||
key_file: /run/certs/client.key
|
||||
server_name: tempo
|
||||
static_configs: [{ targets: ['tempo:3200'] }]
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Template for Prometheus HTTPS + mTLS + Basic Auth web config (lab7).
|
||||
# scripts/init-env.sh renders ./secrets/infra/prometheus_web.yml with generated
|
||||
# bcrypt hashes for operator, grafana, otel-collector, and prometheus-self.
|
||||
# No real credentials or password hashes are committed to Git.
|
||||
tls_server_config:
|
||||
cert_file: /run/certs/server.crt
|
||||
key_file: /run/certs/server.key
|
||||
client_ca_file: /run/certs/ca.crt
|
||||
client_auth_type: RequireAndVerifyClientCert
|
||||
min_version: TLS12
|
||||
|
||||
basic_auth_users:
|
||||
operator: __OPERATOR_BCRYPT__
|
||||
grafana: __GRAFANA_BCRYPT__
|
||||
otel-collector: __OTEL_BCRYPT__
|
||||
prometheus-self: __SELF_BCRYPT__
|
||||
Reference in New Issue
Block a user