forked from mtusi2026/mtusi2026lab7
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:
@@ -315,6 +315,18 @@ bao_ready: env_setup pki_stand
|
||||
bao_check:
|
||||
$(PYTHON) .claude/skills/run-mtusi-messenger/driver.py --ca-file "$(CA_FILE)" --port $(HTTPS_OUT_PORT) openbao-check$(if $(filter 1,$(REPORT)), --report)
|
||||
|
||||
# ограничения контейнеров стенда (driver.py hardening-check, change
|
||||
# container-hardening, design, решение 9): у каждого контейнера проекта —
|
||||
# docker inspect против требований и модели compose (capabilities,
|
||||
# no-new-privileges, seccomp, корень только на чтение, tmpfs, пользователь,
|
||||
# лимиты CPU / памяти / процессов, монтирования, порты), процессы и слушатели
|
||||
# пробой в пространствах контейнера, отказ записи в корень контейнеров
|
||||
# приложения, предел процессов разовым контейнером worker. Коды 0 / 1 / 2
|
||||
# (стенда нет). REPORT=1 — те же сведения без вердикта (стенд до change)
|
||||
.PHONY: hardening_check
|
||||
hardening_check:
|
||||
$(PYTHON) .claude/skills/run-mtusi-messenger/driver.py --ca-file "$(CA_FILE)" --port $(HTTPS_OUT_PORT) hardening-check$(if $(filter 1,$(REPORT)), --report)
|
||||
|
||||
# стенд: postgres, valkey, s3, rabbitmq, openbao -> migrate, s3-bootstrap ->
|
||||
# api × API_REPLICAS, cleaner, worker -> haproxy; телеметрия — otel-collector,
|
||||
# prometheus, loki, tempo, grafana (приложение их не ждёт)
|
||||
|
||||
Reference in New Issue
Block a user