Repository navigation
WAF plugin: what the sniffer is missing, and a small-steps plan #1350
Replies: 2 comments 6 replies
I think this is a much better approach to a giant PR like previous time.
Combine with your point 2 and 3, I think we might be able to add 2 status code, one is immediate deny (so it won't even enter the proxy logic, as mentioned in 1 ) and the other one is "wait, that request header seems odd but I am not sure if this need to be blocked, let me inspect the body instead" and proceed with the That way we do not need to change the introspec structure and also make the IPC much more efficient (in some use-cases, maybe some path do not need payload body inspection) . If the sniff body setting is set at launch time (introspect), plugins will need to handle all incoming request body sniff data no matter if it is necessary or not.
Btw, you do not need to license it as AGPL as far as you concern, the plugin API itself is LGPL |
|
Agreed, that is cleaner – per request instead of per plugin, and the common case stays one IPC call. Concrete proposal so I can start: New sniff responses, next to the existing 200 accept / 501 skip:
PR 1: If the numbers or header names should be different, tell me and I will use yours. |
Uh oh!
There was an error while loading. Please reload this page.
Hi Toby, hi Anthony,
following up on #1349 – closing it was fair, the PR was too big. Here is the short version of the "why" and a plan in small PRs against v3.3.6.
What dynamic capture can and cannot do today
The sniffer gets method, URL, headers and client IP. That is enough for IP-based blocking – Anthony's CrowdSec bouncer does exactly that, and it is the right tool for that job.
It is not enough for a web application firewall, for two reasons:
So the gap is small and specific: the sniffer needs a bounded body prefix, and a way to say "deny with this status" without taking the request over. Toby mentioned a new sniffer status code in #1349 – that is step 1 below.
Plan – one topic per PR, each small enough to read in one sitting, base v3.3.6
dynamic_capture_sniff_body_kb; Zoraxy reads up to N KiB, adds it to the sniff payload, replays it to the upstream. Off unless a plugin asks.http.Clientper request), per-route fail-open/fail-closed. With numbers from a test instance.Nothing changes for existing plugins or rules in any of the steps. I will post step 1 as a PR once you are fine with the direction. Happy to adjust names and field placement to whatever fits the project.
Tobias
All reactions