# 2026-11-22T19:19:29Z commit=n/a host=Linux 6.18.44-fc-v726 x86_64 cpus=2
$ python3 student-tests/test_security.py
## lab7 external security (https://127.0.0.1:8443)
PASS TLS: доверенный CA + hostname → 200; пустой/чужой trust store и чужое имя → ошибка ПРОВЕРКИ сертификата   0.03s  empty trust store → unable to get local issuer certificate; foreign CA → unable to get local issuer certificate; system CAs only → unable to get local issuer certificate; wrong hostname → Hostname mismatch, certificate is not valid for 'evil.example'.
PASS TLS: версии < 1.2 отклоняются; согласуется TLS 1.3/1.2; HSTS; plaintext на :8443 не обслуживается   0.01s  TLS1.1→TLSV1_ALERT_PROTOCOL_VERSION; TLS1.2 ok (ECDHE-ECDSA-AES128-GCM-SHA256); default TLSv1.3; HSTS=max-age=31536000; plaintext→closed (RemoteDisconnected); host ports closed: [8080, 8081, 9000, 5432, 6379, 4222, 4318]
PASS ACL: посторонний не видит чат/сообщения/вложение (404); X-User-Id не меняет Bearer identity   1.66s  outsider 404 ×4, foreign attachment 404, X-User-Id ignored (me=eve), anonymous+X-User-Id 401
PASS logout отзывает сессию; истечение TTL (api-ttl, профиль ttl) → 401   3.36s  logout → 401; TTL 2 s → 401 после истечения
PASS лимит входа ОБЩИЙ для реплик: 5 неудач (IP+username) → 429 + Retry-After, даже с верным паролем   0.39s  401×5 от реплик ['api-2c95f68a', 'api-b71c78e6'] → 429 Retry-After=300s (shared via Redis); XFF spoof → 429; другой user → 201
PASS ограничения размера: JSON > 64 KiB → 413 (API), URI > 4 KiB → 414, > 64 заголовков → 400, заголовок > 16 KiB → 400 (LB)   0.12s  json 70 KB→413 payload_too_large, URI 5 KB→414, 70 headers→400, 20 KB header→400, upload Content-Length 50 MiB→413 (LB, до чтения тела)
PASS Argon2id: соль+параметры в PHC; ≥ 19 MiB/t≥2/p=1; legacy scrypt и слабый Argon2id перехешируются при входе   3.09s  current m=19456 t=3 p=1; scrypt → argon2id ✓; argon2id t=2 → t=3 ✓
PASS ошибки не раскрывают credentials: 401 одинаков для неизвестного/неверного; нет Server/версий; пароль не эхо   0.24s  401 identical, no Server header, no credential echo
summary: 8 passed, 0 failed
exit=0
