Shun clients that probe for missing paths, and log response statuses #22
Loading…
Reference in a new issue
No description provided.
Delete branch "recon-404"
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?
Centinela had no way to recognise scanners. Over the last 7 days, 777 WordPress/PHP
probes hit the Ghost blog (
/wp-login.php,/xmlrpc.php,/.env.php, …):Ghost answered all of them with 404.
In proxy mode Centinela forwards each request to the app and sees the response. This PR
uses that: a client that keeps asking for paths that don't exist is scanning.
Changes
Response status in the decision log. In proxy mode each
decisionline now waitsfor the response headers and includes
status: the code the client got (the upstream's,or Centinela's own 403/429).
they close.
msis still the time to the decision./v1/inspectlines are unchanged.404 recon detection.
CENTINELA_RECON_404_AFTER(default0, off) shuns a clientfor
CENTINELA_SHUN_TTLonce that many distinct paths it asked for came back 404 or 410within
CENTINELA_RECON_404_WINDOW(default1m).client shunnedwithreason=recon, and counted in thecentinela_recon_shunsmetric.favicon*,robots.txt,/.well-known/, sitemaps, …);Sec-Fetch-Destother thandocument/iframe/frame), so apost with broken images can't get a reader shunned;
CENTINELA_RATE_LIMIT_EXEMPTnetworks.CENTINELA_STATE_URL, the counts are a Valkey set per client, so misses on everyreplica add up.
POST /unshunclears them.Training log ID. Training log entries now use the request's
id, the same as itsdecision log line, so a model input can be matched to its outcome and, later, to a
reviewer's label. This is the first step of the labeling plan.
Docs. README sections on the decision log, client checks, training log, settings
and planned work are updated.
Testing
every exclusion (routine paths, subresources, exempt networks); off by default; two
replicas sharing counts through Valkey; unshun clears misses; the status is logged
exactly once.
client is shunned. The status is logged while a streaming response is still open.
go vet,go test ./...andgo test -race(engine, proxy) pass.Rollout
Merging changes nothing until gitops sets
CENTINELA_RECON_404_AFTER(suggested:10)along with the new image. Watch for
reason=reconshuns in the logs after enabling it.🔎 ojo scan results
Details (1)