fix: address storage-tls verify findings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-19 00:55:33 +03:00
co-authored by Claude Opus 5.5
parent 9f01fcce4b
commit a1bfb8dde2
16 changed files with 340 additions and 62 deletions
+21 -5
View File
@@ -630,6 +630,10 @@ def cmd_start(port: int) -> int:
"API_TLS__CERT_FILE": str(stand_dir / "ingress.crt"),
"API_TLS__KEY_FILE": str(stand_dir / "ingress.key"),
"API_TLS__CLIENT_AUTH": "false",
# TLS к хранилищам (change storage-tls, verify W2): CA стенда, как
# CLIENT_TLS_ENV Makefile у run_dev; worker и relay получают его от
# make run_worker / run_relay. Без него API — код 2
"CLIENT_TLS__CA_FILE": str(stand_dir / "ca.crt"),
"MTUSI_WORKER_LOG": str(worker_log_path),
"MTUSI_RELAY_LOG": str(relay_log_path),
}
@@ -16354,15 +16358,27 @@ def storage_tls_check(
"AND a.client_addr IS NOT NULL;\n",
).strip()
tls_count, other_count = (stats.split("|") + ["?", "?"])[:2]
rows.append(
# хотя бы одна сессия TLS 1.3 (verify S4): без неё «0 без TLS 1.3»
# прошло бы и на стенде, где проверять нечего (relay, worker и уборщик
# держат соединения постоянно)
rows += [
(
"postgres",
"pg_stat_ssl",
f"network sessions over TLS 1.3: {tls_count}",
"0 without TLS 1.3",
f"{other_count} without TLS 1.3",
f"network sessions over TLS 1.3 ({tls_count})",
">= 1",
">= 1"
if tls_count.isdigit() and int(tls_count) >= 1
else tls_count,
),
)
(
"postgres",
"pg_stat_ssl",
"network sessions without TLS 1.3",
"0",
other_count,
),
]
# порты вне loopback: только TLS-порты (и gRPC шлюза S3, решение 7)
expected_ports = {
"postgres": [target("postgres")],