fix(tradein/security): defense-in-depth trusted-header auth + rate-limiter fix (#2213) #2229
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#2229
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/tradein-defense-in-depth-auth"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
TRADEIN_INTERNAL_AUTH_SECRETкаждый запрос сX-Authenticated-Userобязан нестиX-Internal-Auth-Secret(secrets.compare_digest, constant-time) — подделка username изнутри docker-сети даёт 401 + WARNING. Fail-open до провижининга (env не задан → поведение байт-как-раньше + WARNING на старте). Caddyheader_upперезаписывает клиентский заголовок (та же механика, что защищает X-Authenticated-User).user:<name>, лимит ×5) / per-IP (ip:<addr>) ключи вместо освобождения всех authenticated; client IP из rightmost XFF (единственный доверенный прокси Caddy аппендит real IP; leftmost клиент-контролируем и игнорируется).log_credentials(писал обратимые base64 basic-auth пароли в оба лога). glitchtip-auth-forwarder деградирует gracefully (attempted_username→(none), 401-события продолжают уходить — проверено).⚠️ Провижининг секрета (human, ПОРЯДОК КРИТИЧЕН)
openssl rand -hex 32./opt/gendesign/.env→ recreate caddy-контейнера (reload env не перечитает).Как проверено
Refs #2213