iac/infrastructure/security-audit/base/processor-configmap.yaml
emelinda 5ba7149e20 uralkal: route traces through Kafka into audit-processor instead of direct S3
- opentelemetry-collector/uralkal: kafka exporter (telemetry.traces, otlp_proto,
  SASL_SSL, creds from otel-collector-kafka + kafka-ca), NetworkPolicy egress to kafka ns
- security-audit: add {topic: telemetry.traces, kind: traces} pipeline to
  audit-processor config (requires k8s-audit-processor image with traces support —
  update the pinned digest after CI build)
2026-11-08 18:56:13 +03:00

67 lines
2.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Конфиг audit-processor (образ k8s-audit-processor, CONFIG_PATH=/etc/k8s-audit/config.yaml).
# Контур-специфичные значения (contour, kafka.brokers, minio.endpoint, app.env, log.s3_echo)
# задаёт оверлей через env K8S_AUDIT_* — см. uralkal/kustomization.yaml.
apiVersion: v1
kind: ConfigMap
metadata:
name: audit-processor-config
labels:
app.kubernetes.io/name: audit-processor
data:
config.yaml: |
contour: "" # K8S_AUDIT_CONTOUR
app:
name: audit-processor
env: dev # K8S_AUDIT_APP_ENV
log:
level: info
output: stdout
add_source: false
access_log: true
audit_events: false # поток ИБ не идёт в прикладные логи (п.20)
s3_echo: false # K8S_AUDIT_LOG_S3_ECHO; только отладка (п.20)
# Пайплайны чтения: один consumer group вычитывает все топики списка.
# Ключ верхнего уровня (config.Pipelines), НЕ внутри kafka.
# kafka.topic НЕ удалять — без pipelines (откат на старый образ) читается он.
pipelines:
# - {topic: security.k8s-audit, kind: k8s_audit}
- {topic: security.mesh-access, kind: mesh_access}
# Трейсы от otel-collector (ns opentelemetry-collector). Требует образ k8s-audit-processor
# с поддержкой kind traces — digest в processor-deployment.yaml обновить после сборки.
- {topic: telemetry.traces, kind: traces}
kafka:
brokers: [] # K8S_AUDIT_KAFKA_BROKERS
topic: security.k8s-audit
group: security-audit-processor
start_from: earliest # latest перескочил бы события после разрыва offset'ов
session_timeout: 45s
rebalance_timeout: 60s
tls:
enabled: true
ca_file: /vault/secrets/kafka-ca.crt
sasl:
mechanism: SCRAM-SHA-512
username_file: /vault/secrets/kafka-username
password_file: /vault/secrets/kafka-password
minio:
endpoint: "" # K8S_AUDIT_MINIO_ENDPOINT
bucket: security-audit
secure: false # внешний MinIO контура — plain HTTP (ServiceEntry minio.uralkal.external)
access_key_file: /vault/secrets/minio-access-key
secret_key_file: /vault/secrets/minio-secret-key
http:
host: 0.0.0.0
port: 8000 # /healthz, /readyz, /metrics
stream:
flush_interval: 1m # как часто сбрасывать буфер в MinIO (и коммитить offset'ы)
flush_max_rows: 10000 # или раньше, при стольких строках
flush_timeout: 30s # меньше kafka.rebalance_timeout
max_flush_failures: 30