fix: address auth-hardening verify findings

Drop the body-limit rule from HAProxy (user decision 2026-11-18): the
replica middleware answers 400 with X-Instance-Id, tests require the
header again. Widen the failure_checks selection in the trust matrix,
name 13fdd18 in the evidence header, document Valkey LRU eviction of
login counters and the allowlist as trusted X-Forwarded-For senders,
check waited_ms of KDF budget rejections in the queue scenario.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 10:31:57 +03:00
co-authored by Claude Opus 5.5
parent 4d117f0297
commit 3f4771c9d9
22 changed files with 372 additions and 127 deletions
+4 -2
View File
@@ -421,8 +421,10 @@ paths:
— предел тела (объявленное, частями, наибольшее валидное, загрузка), `test_sessions.py::
test_login_large_body`, `test_transport.py` («Недоверенный TLS», сценарий `student-tests` в
докстринге). Неудачных входов за прогон — 63: два прогона подряд в окне 300 с — 125 при пределе
адреса 200 (докстринг модуля); у каждого теста свои username. Ответ 400 предела тела через LB
строит LB — `assert_error(…, instance_id=False)`;
адреса 200 (докстринг модуля); у каждого теста свои username. Ответ 400 предела тела и через
LB строит реплика — `assert_error` требует `X-Instance-Id`, как у всех ответов API (решение
пользователя 2026-11-18: предела в LB нет; на прежнем `haproxy.cfg` с правилом LB оба теста
объявленного тела красные — «bad X-Instance-Id ''»);
- `api_client.py`: `Api.request(…, forwarded_for=)` — в роли LB (`TLS_CLIENT_CERT`)
`X-Forwarded-For` по умолчанию `LB_CLIENT_ADDRESS` (192.0.2.1), `None` — без заголовка;
`login_response(…, forwarded_for=)`, `login_raw(authorization, …)`;