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:
@@ -208,8 +208,12 @@ def remove_objects(prefix: str) -> None:
|
||||
for line in removed.splitlines()
|
||||
if line.startswith("rm:") and WEED_NO_ENTRY not in line
|
||||
]
|
||||
# строка об истории команд weed shell (временный каталог; с change
|
||||
# container-hardening /tmp у s3 — tmpfs) — не запись префикса
|
||||
left = [
|
||||
line for line in weed_shell(f"fs.ls {prefix}").splitlines() if line
|
||||
line
|
||||
for line in weed_shell(f"fs.ls {prefix}").splitlines()
|
||||
if line and "history" not in line.lower()
|
||||
]
|
||||
if errors or left:
|
||||
detail = errors[0] if errors else f"{len(left)} entries left"
|
||||
|
||||
Reference in New Issue
Block a user