Comments (6)
A more correct answer is that Nginx with modsecurity v2.x does not use the kleene operator '*' in the same way Apache does. This means that CRS will be loaded out of order. However, the ModSecurity-Nginx connection (libmodsecurity) fixes this issue. Let me know if that solves the issue. If you have other CRS issues feel free to ask on the CRS github https://github.com/SpiderLabs/owasp-modsecurity-crs
from modsecurity-nginx.
Hello @Bali2016, hope I can help. I am using a similar setup and have a single includes file, say for example:
/etc/nginx/modsec_includes.conf
This will contain -all- of my modsecurity related configuration, and within my nginx virtual host, I will apply it like:
server {
...
location / {
modsecurity on;
modsecurity_rules_file /usr/local/nginx/modsec_includes.conf;
root html;
index index.html index.htm;
}
}
This include file will have include statements for modsecurity.conf, crs-setup.conf and all of the rules files within the owasp-crs folder,
This setup works quite well for me.
Hope that helps,
Regards,
met3or
from modsecurity-nginx.
Yes, this is a known "limitation" with nginx. "Include rules/*.conf" doesn't work. You need to manually specify each configuration file to be loaded as per:
https://github.com/SpiderLabs/owasp-modsecurity-crs/blob/v3.0/master/INSTALL#L132
from modsecurity-nginx.
@csanders-git @victorhora @met3or thanks all your help, now I include all the rules' conf in a file, don't use *.conf, and can see the mailicous attack is blocked.
from modsecurity-nginx.
Just to confirm the above explanation from @csanders-git - we were facing exactly the same issue with loading CRS files with *
mask on earlier versions of libmodsecurity; now it works like a charm.
I did a quick search in git log
, but was unable to determine the exact changeset, probably @zimmerle has better insights here. :)
from modsecurity-nginx.
Hi @defanator,
Hard to tell the exactly commit. Most likely it was fixed by one of the parser refactoring commits, where I was working more on a macro view. Collateral benefit ? :)
from modsecurity-nginx.
Related Issues (20)
- Issue with transaction variable and chained rule HOT 1
- exist memory leak! HOT 1
- getting error while starting ngnix server HOT 4
- Wordpress WooComerce checkout on Mobile Devices, rule exclusions not working, not identified HOT 2
- 'Host' header missing when HTTP3 is in use prevents "SecRule REQUEST_HEADERS:Host" rules from being effective. HOT 3
- Nginx Segfaulted HOT 24
- How to make lua script or nginx-plugin to send modsec-audit.log to redis not file transformer HOT 6
- regarding the Hidden field manipulation HOT 1
- OCSP validation not working
- Modsecurity STDOUT Logging
- GeoIP databases in ingress-nginx without maxmind GeoIP2 HOT 1
- macos 环境下编译错误 HOT 1
- Audtilog not works with nginx default-backend
- expirevar not working HOT 6
- Print ModSecurity version from nginx connector HOT 4
- CI workflow on Windows is missing HOT 1
- size of the LMDB database file does not change HOT 2
- No new version of the nginx connector has been cut in a long time(2 years) HOT 1
- Compilation issue with gcc14 and nginx 1.27.0 HOT 2
- Debian 12 issue HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modsecurity-nginx.