Retry busy model calls, share shun state, patch CVE-2025-29927, log country #14
Loading…
Reference in a new issue
No description provided.
Delete branch "retry-shared-state-geo"
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?
Follow-up to the 2026-10-23 scanner burst (34.84.93.203, about 415 requests in two minutes). The burst filled both Laya replicas: 68 model calls got 503 and failed open, and the client was never shunned because its 28 blocks were split 18/10 across the two pods.
One commit per change; each builds and passes tests on its own.
Retry a 503 from the model backend once
layathe retry uses a client with keep-alives off. A Service picks the backend per connection, and the pooled client would reuse the connection that just got the 503, sending the retry to the same busy replica.centinela_model_retriesandcentinela_model_retries_failed. Only a retry that also fails is logged asmodel call failed, so the existing Grafana panel still works.Share shuns and client counts between replicas through Valkey
CENTINELA_STATE_URL=valkey://host:6379keeps shuns,CENTINELA_SHUN_AFTERstrike counts and rate-limit counts in Valkey (or Redis 7+), shared by all replicas. Onecentinela unshunthen clears a shun everywhere.internal/valkeyis a small RESP client rather than a new dependency. Tests run against an in-process fake and, withCENTINELA_TEST_VALKEY, a real server; they pass on Valkey 9.Virtual patch for CVE-2025-29927 (Next.js middleware bypass)
x-middleware-subrequeston every request. CRS 920450 scored it only as a restricted header, and the model allowed nearly all of them.Log the client's country with each decision
countryfield from Cloudflare'sCF-IPCountry(CENTINELA_COUNTRY_HEADER), for the dashboard's traffic map. The model never sees it.Deploying
CENTINELA_STATE_URLalso needs a Valkey in thecentinelanamespace (gitops-infra change).🔎 ojo scan results
No findings.