-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lazy loading rules set #277
lazy loading rules set #277
Conversation
This patch would lazy loading ModSecurity rules in nginx worker process. owasp-modsecurity/ModSecurity#2381 |
2a9cb7e
to
3ffa8a3
Compare
@liudongmiao I've tried this, whilst it did stop nginx crashing/needing a reset, it completely broke scanning web requests correctly.
The above were three valid requests. Content-Type was correct, Length was correct and the request was. Going back to the stock/master code immediately stopped these being generated. |
@iammattmartin It's nothing with this PR.
|
I believe PCRE(1).
I'm sure I tried a newer version of nginx when building originally and had to revert to this version due to that as pagespeed didn't want to work with PCRE2 (from memory). |
@iammattmartin This PR does nothing with actual rules. And, for the memory issue ( |
@iammattmartin BTW, we have use it on production for at least 3 months. |
Thanks for the reference to owasp-modsecurity/ModSecurity#2728, we've put this back to the master release and tried that. Rules seem to be obeyed correctly and we'll monitor for any crashing. |
I can confirm that at least for our setup (nginx 1.19, PCRE 1 8.45, ModSecurity 3.0.5) this actually breaks Regexp-based rule evaluation since PCRE fails to allocate memory, and ModSecurity treats this as silently assuming that no regexps ever match. I believe this is due to the calls to |
nginx with pcre prevent original pcre_malloc and pcre_free ngx_http_modsecurity_pcre_malloc_init/done is required before call pcre.
@guelfey Thanks.
In our production, we prevent modsecurity to use pcre from nginx by using a different prefix.
And, as owasp-modsecurity/ModSecurity#2728 actually fix the memory problem, I would close this PR. |
No description provided.