fix: address container-hardening re-verify findings

Recheck processes with a privilege sign in hardening-check and fail only
when the same process (PID and start time) keeps the sign in every scan,
so the transient runc process of any docker exec no longer gives a false
FAIL; run the root-write probe after the process probes. Name the second
Loki retention error form, fix the exit-code wording in the threat model
and record the live Loki retention probe in the evidence.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-27 08:57:05 +03:00
co-authored by Claude Opus 5.5
parent 273d7ce1d8
commit bcfad0c4f3
11 changed files with 331 additions and 48 deletions
+8 -3
View File
@@ -1072,10 +1072,15 @@ make s3_check # с change — ещё строки gRPC ш
на `127.0.0.1`, «matches compose model» (`cap_drop`, `cap_add`, nnp, `read_only`, `pids`, tmpfs,
user). Пробы (6 параллельно) на образе API `--read-only --cap-drop ALL --security-opt
no-new-privileges --user 10001 --pids-limit 32 --memory 64m`: процессы — `--pid container:<id>
--network none` (`/proc/*/status`: `Uid`, `CapEff`, `CapBnd`, `NoNewPrivs`, `Seccomp`), слушатели —
--network none` (`/proc/*/status`: `Uid`, `CapEff`, `CapBnd`, `NoNewPrivs`, `Seccomp`; правки
повторного verify, W1 — процесс с признаком перепроверяется `HC_RESCANS` = 3 раза через
`HC_RESCAN_PAUSE` = 0,3 с, в вердикт идёт, только если тот же PID с тем же временем старта
(`/proc/<pid>/stat`) держит признак во всех сканах; не застанные — строка «transient processes
(rechecked)», обычно `runc:[2:INIT]` healthcheck Docker; имя не учитывается), слушатели —
`--network container:<id>` у владельцев сетевых пространств (`/proc/net/tcp*`, вне loopback =
`HC_LISTENERS`); `docker exec … python` у `api`, `worker`, `relay`, `cleaner` — создать `/` и
`/var/tmp` (`EROFS`; на стенде до change — `EACCES` и `written`); `docker compose run --rm
`HC_LISTENERS`); после проб процессов (`docker exec` — тот же процесс runc) `docker exec …
python` у `api`, `worker`, `relay`, `cleaner` — создать `/` и `/var/tmp` (`EROFS`; на стенде до
change — `EACCES` и `written`); `docker compose run --rm
--no-deps -T --label … --entrypoint python worker` — потоки (стек 256 KiB, не больше 4096) до
отказа, пока держатся — `GET /health/ready` через LB. Журнал (правки verify, S7): у каждого
контейнера проекта, и у завершённых, `docker logs --since <State.StartedAt>` — строка «log since