corazawaf / coraza

OWASP Coraza WAF is a golang modsecurity compatible web application firewall library
https://www.coraza.io
Apache License 2.0
2.15k stars 211 forks source link

Some configurations of coraza.conf-recommended do not work #141

Closed sky9090 closed 2 years ago

sky9090 commented 2 years ago

Hi,

I did some tests on the settings in the coraza.conf-recommended file and included this file in the Coraza-Server config.yml file, but some configurations don't work. Please have a took and give me some advice.

jptosso commented 2 years ago

Hey! Thank you for you interest in Coraza, coraza-server is an experimental project and it requires a lot of testing, so your feedback is valuable. I have updated coraza-server to the latest coraza version, could you try with the last commit? It contains many fixes.

About the body size enforcing and mimes, it is handled by coraza-waf and not coraza-server, so I will review that and keep you posted.

ShiMing-Q commented 2 years ago

For case2, I changed the rule below and got the auditlog successfully

SecRule REQUEST_HEADERS:Content-Type "(?:application(?:/soap\+|/)|text/)xml" "id:'200000', phase:1, log, auditlog, deny, status:403, ctl:requestBodyProcessor=XML"
sky9090 commented 2 years ago

Thank you @jptosso @ShiMing-Q, I will recheck the test results according to your advice.

ShiMing-Q commented 2 years ago

https://github.com/jptosso/coraza-waf/pull/142 this may fix the case 1 and case 4. @sky9090

ShiMing-Q commented 2 years ago

Working on the fix for case 5

ShiMing-Q commented 2 years ago

https://github.com/jptosso/coraza-server/pull/4, this will fix for case 5

sky9090 commented 2 years ago

Thanks @ShiMing-Q @jptosso , I have rechecked these five issues and they have all passed now.

Also, I found that the current default value for SecResponseBodyAccess is Off, and the version of the Coraza-waf package included in go.mod is not the latest one, I manually updated the version in my local to recheck the test.