feat(fail2ban): caddy-auth 401 deny-list -> credential-endpoint allow-list (#196) #200
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-infra!200
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/196-caddy-auth-allowlist"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Closes #196.
Why
The
caddy-authjail banned on any repeated 401 minus a growingignoreregexof protocol-handshake paths. That deny-list is fragile: every endpoint that answers 401 by protocol (not by a wrong credential) is a latent CI outage, and it fired twice — #179 (/v2/registry handshake) and #195 (/api/actions/runner gRPC, amplified because our ephemeral runners share one SNAT egress IP).What
Flip to an allow-list: count 401s ONLY on genuine credential-auth endpoints —
…/info/refs,…/git-upload-pack,…/git-receive-pack) — HTTP Basic auth…/info/lfs/…)/api/v1/…(token/Basic)/user/login(SSO-only today, kept defensively)Each line captures
<ADDR>atremote_ip, then requires the URI, then anchorsstatus":401. A new 401-by-protocol endpoint is simply never matched — the regression class is gone.ignoreregexremoved (redundant under an allow-list). 403 still deliberately unmatched.Trade-off (accepted, documented in-file): a new credential endpoint must be added here explicitly, or brute force on it goes un-jailed — a safer failure (availability) than a recurring CI outage.
Verification (fail2ban-regex, both directions)
Not yet applied — no active incident (the #195 fix already covers prod). Ready for review + apply via infra-apply.