feat: load process secrets from OpenBao via cert auth

OpenBao 2.7.3 (raft, TLS 1.3 with client certificates) holds the
PostgreSQL role passwords, the Valkey password and the S3 keys; each
process logs in with its own mTLS identity, reads only its paths and
renews its token in the background. Operator init, unseal, configure
and seed go through infra/openbao/bao.py and make bao_*; checks are
make bao_check and driver.py openbao-outage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-26 13:55:09 +03:00
co-authored by Claude Opus 5.5
parent 4dd4a957be
commit 64210dace0
64 changed files with 6709 additions and 321 deletions
+11 -1
View File
@@ -37,7 +37,7 @@ import aiormq.exceptions
import pytest
from src.config import settings
from src.config.settings import BASE_DIR, Broker, Settings
from src.config.settings import BASE_DIR, Broker, Secrets, Settings
from src.core.exceptions import BrokerUnavailable
from src.infra.broker import client as broker_client
from src.infra.broker.client import JobConsumer, JobPublisher, broker_context
@@ -340,6 +340,12 @@ def _settings(broker: Broker, pki: Path) -> Settings:
database=settings.database.model_copy(update={"host": "postgres"}),
s3=settings.s3.model_copy(update={"host": "s3"}),
broker=broker,
# OpenBao (change openbao-secrets): действующие файлы identity
secrets=Secrets(
cert_file=str(pki / "stand" / "relay.crt"),
key_file=str(pki / "stand" / "relay.key"),
crl_file=str(pki / "stand" / "crl.pem"),
),
)
@@ -402,6 +408,10 @@ def _run(
"BROKER__KEY_FILE": str(stand / "relay.key"),
"BROKER__CRL_FILE": str(stand / "crl.pem"),
"TELEMETRY__ENABLED": "false",
"SECRETS__ADDRESS": "https://openbao:8200",
"SECRETS__CERT_FILE": str(stand / "relay.crt"),
"SECRETS__KEY_FILE": str(stand / "relay.key"),
"SECRETS__CRL_FILE": str(stand / "crl.pem"),
**env,
},
capture_output=True,