Replies: 11 comments 3 replies
-
Hey! Unline ModSecurity, Coraza stops rule execution after interruption. Is this something we want to change? I don't see any good reason to continue evaluating rules, if there is a specific use case we could change it or create a configuration flag or directive |
Beta Was this translation helpful? Give feedback.
-
Interesting case. I wonder how does the request look like. @M4tteoP could you please triage this? |
Beta Was this translation helpful? Give feedback.
-
@M4tteoP |
Beta Was this translation helpful? Give feedback.
-
Hey @dspeg! Glad to see you here :) |
Beta Was this translation helpful? Give feedback.
-
Thank you Matteo! |
Beta Was this translation helpful? Give feedback.
-
I had a WIP around e2e in istio but did not finish it, these e2e aim to triage this kind of issues. Maybe it is time to rework it? corazawaf/coraza-proxy-wasm#80 |
Beta Was this translation helpful? Give feedback.
-
Hi @dspeg, I'm on this issue. By any chance, could you please reproduce it with the following slightly modified coraza-proxy-wasm and report the Istio logs back? You may build it from this branch, or, for your convenience, directly retrieve the wasm filter from
In your deployment, it seems that the IngressGateway is adding some headers to the deny response generated following the interruption, It would be great to understand it a bit deeper. |
Beta Was this translation helpful? Give feedback.
-
Hi Matteo, I will test out the changes soon. I will share the log. |
Beta Was this translation helpful? Give feedback.
-
I'm very sorry about the delay. I tested the WasmPlugin on IngressGateway just now. I could still reproduce the problem. Below are some log entries emitted from the WasmPlugin based on docker.io/deltag/coraza-proxy-wasm:vheaders When I sent a request, which is to be blocked, to the app via the IngressGateway with "curl", no response will be sent back. ` 2023-04-13T06:06:33.193235Z debug envoy wasm wasm log istio-system.coraza-wasm: [NSmYQBqAXnvNGiPijfA] [201] Finish evaluating rule 201 After I sent "ctrl-c" to "curl", a few more log entries were appended: |
Beta Was this translation helpful? Give feedback.
-
Hey @dspeg, thanks also for this dump (corazawaf/coraza-proxy-wasm#171 (comment)). Just updating you that there is an open PR that should fix this issue: corazawaf/coraza-proxy-wasm#172. Feel free to join the conversation if needed! |
Beta Was this translation helpful? Give feedback.
-
Fixed by corazawaf/coraza-proxy-wasm#172 |
Beta Was this translation helpful? Give feedback.
-
I am testing the Coraza Waf WasmPlugin on an Istio Ingress Gateway. I added a dummy test rule in Phase 1 to block on certain parameter patterns. And I have
SecDefaultAction "phase:1,log,deny,status:444"
When the rule is triggered, it seems no more WAF processing happens after phase 1. Viewed from the client side, the server never returns any response.When I changed the above rule to "Phase 2", the problem no longer reproduced. When I moved the above Coraza Waf WasmPlugin to an Istio side-car proxy, I didn't see the problem either.
From the Istio log, I found a line saying "error envoy wasm wasm log istio-system.modsecurity-wasm: interruption already handled, unexpected local response". Not sure whether this is related to the problem.
Beta Was this translation helpful? Give feedback.
All reactions