Move the engine's endpoints off the proxied listener and add unshun #12
Loading…
Reference in a new issue
No description provided.
Delete branch "admin-listener"
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?
Stacked on the
CENTINELA_SHUN_ON_VERDICTPR. Until that merges, the diff here includes its commit.Problem
In proxy mode the main listener faces the internet, and it served the engine's own endpoints under every proxied host:
/v1/inspecttakes the client address from its caller. Anyone could have any address shunned with one request./debug/varspublished the counters and process details./authzwas reachable too.Confirmed against production from outside the cluster with a benign request:
/v1/inspectanswered with a verdict and/debug/varsreturned the counters.Separately, the only way to lift a shun was to restart the pods, which frees every client that was shunned for good reason.
Change
Main listener. With a proxy configured it now serves only
/healthzand the proxied apps. Forward-auth deployments, where that listener is the integration surface, are unchanged.Admin listener.
CENTINELA_ADMIN_LISTEN, default127.0.0.1:9108.offdisables it.GET /debug/vars,/authzandPOST /v1/inspectfor trying a request by hand, andPOST /unshun?client=<address>.Unshun. Lifts the shun, clears that client's count of blocked requests, and logs
client unshunnedwith the client and whether it had been shunned.The image has no shell or HTTP client, so the binary is its own client. Each replica keeps its own shun list, so ask every pod:
Access control is whoever may
kubectl execin the namespace.Behaviour changes to know
/debug/varsis no longer on port 9107 in proxy mode. Usekubectl port-forwardto 9108./v1/inspect,/authzand/debug/varsthemselves, after the usual checks.CENTINELA_CACHE_TTLpasses.Tests
/v1/inspect,/authz,/debug/varsand/unshunto the app, and a caller there cannot get an address shunned;/healthzstill answers./unshun.off, loopback forms accepted; wildcard, private, hostname and bare-port forms refused.centinela unshun.make vet,make buildandmake test(race detector) pass.Merging to
mainrunsbuild-and-push, which tags and publishes the next patch version.🔎 ojo scan results
Details (12)