feat: drop capabilities, run read-only and non-root in every container, mTLS for the S3 gRPC gateway

Every service of the stand gets the x-hardening anchor (cap_drop ALL,
no-new-privileges, read-only root) with an empty exception table, tmpfs
with size limits, pids limits by measurement and non-root users for
PostgreSQL, Valkey, RabbitMQ and SeaweedFS. The S3 gateway gRPC accepts
only mTLS with the stand CA. make hardening_check checks inspect data,
processes and listeners against the compose model; a fast test keeps the
override files from removing restrictions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 05:23:13 +03:00
co-authored by Claude Opus 5.5
parent 1f45bfe011
commit 157b878289
26 changed files with 2639 additions and 130 deletions
+6 -3
View File
@@ -1,9 +1,12 @@
#!/bin/sh
# Старт Valkey стенда с ACL (change storage-roles, design, решение 9).
#
# От root до entrypoint образа: проверки, файл пользователей ACL с SHA-256
# паролей на tmpfs /run/valkey (владелец — valkey, 0600), затем exec
# docker-entrypoint.sh valkey-server — сервер работает от пользователя valkey.
# От пользователя valkey (с change container-hardening — `user: "999:999"`
# сервиса, ни одного шага от root, без capabilities, корень только на чтение):
# проверки, файл пользователей ACL с SHA-256 паролей на tmpfs /run/valkey
# (tmpfs с владельцем 999, файл 0600; chmod и chown своего каталога на себя
# capability не требуют), затем exec docker-entrypoint.sh valkey-server —
# entrypoint образа не от root пользователя не меняет (setpriv не вызывается).
# Паролей нет ни в argv, ни в команде контейнера, ни на диске; в выводе — только
# имена. Ошибка — код 1 и строка без значений, сервер не стартует.
#