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 -3
View File
@@ -121,8 +121,9 @@ def test_broken_basic(api: Api, alice: Actor) -> None:
@pytest.mark.spec("sessions", "Большое тело входа")
def test_login_large_body(api: Api, alice: Actor) -> None:
"""Предел размера тела (change auth-hardening, решение 8): верный Basic с
телом больше 64 KiB — 400 до проверки credentials; через LB отказывает
LB (без X-Instance-Id)."""
телом больше 64 KiB — 400 до проверки credentials; отказывает реплика по
Content-Length, с X-Instance-Id (предела в LB нет — решение пользователя
2026-11-18)."""
headers = {
"Authorization": basic_header(
f"{alice.username}:{alice.password}".encode(),
@@ -135,7 +136,7 @@ def test_login_large_body(api: Api, alice: Actor) -> None:
headers=headers,
content=b" " * 65537,
)
error = assert_error(resp, 400, instance_id=False)
error = assert_error(resp, 400)
assert error["message"] == "Request body is too large"
assert "token" not in resp.text