feat: require TLS to PostgreSQL, Valkey and S3

Storage servers accept only TLS 1.3 (pg_hba hostssl / hostnossl reject,
Valkey port 0, S3 gateway HTTPS only) with stand identities postgres,
valkey and s3. Clients trust only the stand CA from [client_tls] ca_file
and check the host name; no switch to disable verification. Processes
exit with code 2 without a CA or with an IP storage address. Temporary
stands, CI and bench/ run on TLS storages; make storage_tls_check adds
negative checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 21:17:49 +03:00
co-authored by Claude Opus 5.5
parent 25f5d981c0
commit 8bca5543fd
56 changed files with 2562 additions and 176 deletions
+7 -5
View File
@@ -14,10 +14,12 @@
# не трогает (change https-tooling, design, решение 2).
#
# Healthcheck PostgreSQL проверяет служебную базу postgres, а не базу
# приложения: с 127.0.0.1 образ пускает без пароля (trust), и каждая
# проверка — сессия в pg_stat_database базы. Иначе раз в 5 с она попадала
# бы в счётчик теста «Соединения пула не переоткрываются» (действие hook
# db-sessions).
# приложения: до change storage-tls с 127.0.0.1 образ пускал без пароля
# (trust), и каждая проверка была сессией в pg_stat_database базы. Иначе раз
# в 5 с она попадала бы в счётчик теста «Соединения пула не переоткрываются»
# (действие hook db-sessions). С change storage-tls — по TLS с проверкой CA
# этой PKI и имени, как healthcheck рабочего стенда (pg_hba.conf стенда:
# без TLS — отказ).
#
# У PostgreSQL — init (tini) с PID 1, postmaster — его потомок. fault_hook.py
# fill-connections отвязывает psql в фоне sh, запущенного docker compose exec;
@@ -32,7 +34,7 @@ services:
init: true
ports: !reset []
healthcheck:
test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U \"$$POSTGRES_USER\" -d postgres"]
test: ["CMD-SHELL", "pg_isready -d \"host=$$POSTGRES_HOST hostaddr=127.0.0.1 port=$$PGPORT dbname=postgres user=$$POSTGRES_USER sslmode=verify-full sslrootcert=/run/secrets/ca.crt\""]
valkey:
ports: !reset []
# свой S3 со своим volume, порт API S3 не публикуется. Срок остановки