-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
modsecurity 3.0 interferes with nginx even when disabled. #3336
Comments
Hi @debugnetiq1, do you use latest stable ModSecurity-nginx connector (from here) or you cloned from Github with the current state? If you use the current GH state, probably you ran into this issue. |
Ubuntu 24.01 x64 with latest modsecurity-nginx 1.0.3 (which seems broken - similar issue reported in the link) Then what's the working recipe? Which versions should be relied upon? Thanks https://otland.net/threads/how-to-build-nginx-from-source-and-optimize-it-for-security-and-performance-including-tls.288892/ ./build.sh nginx connector for mod-security: In the logs |
As I hinted in my previous comment you should use the latest stable release, grab it from here. |
I encountered the same issue as @debugnetiq1. After reinstalling the connector using the latest stable release here and following the steps below, ModSecurity started working correctly: Steps to Resolve:
|
Do we need to keep open this issue? |
I'm going to close this issue. For the references, please take a look at PR's ModSecurity-nginx/344 (I mentioned that here) and also this one. |
Site running joomla 3.9
In modsecurity.conf disabled engine to see where the issue is
#SecRuleEngine On
SecRuleEngine Off
Using modsecurity-3.conf-recommended w/o any change except the above and SecDebugLog
Version:
2025/02/03 04:33:09 [notice] 2074355#2074355: ModSecurity-nginx v1.0.3 (rules loaded inline/local/remote: 0/49/0)
2025/02/03 04:33:09 [notice] 2074355#2074355: libmodsecurity3 version 3.0.13
Activated debug log for modsecurity
SecDebugLog /var/log/nginx/modsecurity_debug.log
SecDebugLogLevel 4
Can't see in the log any error or hint of a "block" action
In nginx.conf
. . .
location ~* ^.*{
limit_req zone=speedbump_req burst=20;
limit_conn speedbump_conn 10;
modsecurity on;
modsecurity_rules_file /etc/nginx/modsecurity.conf;
proxy_cache nginx_cache;
. . .
With modsecurity off or commented out
With modsecurity on
nginx build
configure arguments: --build=welcome
--prefix=/usr/share/nginx-1.26.2
--sbin-path=/usr/sbin/nginx-1.26.2
--modules-path=/usr/lib64/nginx-1.26.2/modules
--conf-path=/etc/ng inx-1.26.2/nginx-1.26.2.conf
--error-log-path=/var/log/nginx-1.26.2/error.log
--http-log-path=/var/log/nginx-1.26.2/access.log
--http-client-body-temp-path=/var/lib/nginx- 1.26.2/tmp/client_body
--http-proxy-temp-path=/var/lib/nginx-1.26.2/tmp/proxy
--http-fastcgi-temp-path=/var/lib/nginx-1.26.2/tmp/fastcgi
--http-uwsgi-temp-path=/var/lib/nginx-1.26.2/tmp/uwsgi
--http-scgi-temp-path=/var/lib/nginx-1.26.2/tmp/scgi
--pid-path=/var/run/nginx.pid
--lock-path=/var/lock/subsys/nginx-1.26.2
--user=nginx
--group=nginx
...
--with-stream=dynamic
--with-stream_ssl_module
--with-compat
--add-dynamic-module=/var/www/data/packages/ModSecurity-nginx
modsecurity_debug.log:
modsecurity_debug.log
The text was updated successfully, but these errors were encountered: