8000 Documentation: Enhancement of installation process for Nginx / IIS by azurit · Pull Request #1988 · coreruleset/coreruleset · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Documentation: Enhancement of installation process for Nginx / IIS #1988

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

Merged
merged 2 commits into from
Mar 1, 2021
Merged

Documentation: Enhancement of installation process for Nginx / IIS #1988

merged 2 commits into from
Mar 1, 2021

Conversation

azurit
Copy link
Member
@azurit azurit commented Jan 26, 2021

According to modsecurity documentation, Include directive used in installation process for Nginx and IIS supports wildcards:
https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual-(v2.x)

The include directive also supports wildcard characters (*) and full paths. It should be easy to add something like the following (assuming CRS has been downloaded and installed to this path):

Include /opt/owasp-modsecurity-crs/modsecurity_crs_10_setup.conf
Include /opt/owasp-modsecurity-crs/rules/*.conf

Not sure why we are not using it, maybe previous versions of modsecurity doesn't supports this. I also double checked this behavior in modsec source: Wildcards are really supported and matched files are processesd in ASCII collation order. Important to note is that i didn't test it.

@fzipi
Copy link
Member
fzipi commented Jan 31, 2021

@azurit It did not work in the past, at least in my tests. But will double check.

@dune73
Copy link
Member
dune73 commented Feb 1, 2021

@airween: What is your take here? I think we talked about this before, did not we?

@fzipi: Did you have the time to test?

@fzipi
Copy link
Member
fzipi commented Feb 1, 2021

I remember the problems I had now.

This is something that comes from modsecurity v2.x for nginx I think: there are two different "include" directives. The include (lowercase) is the one from nginx. The one starting with upper, Include, comes from apache apr (originally nginx was compiled with apr for memory management in nginx, until libmodsecurity).

So we should use include where needed, not Include.

This is an example from the config in our dockers:

http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    sendfile on;

    keepalive_timeout ${NGINX_KEEPALIVE_TIMEOUT};

    include /etc/nginx/conf.d/*.conf;
}

@dune73
Copy link
Member
dune73 commented Feb 1, 2021

Wow. I was not aware of this.

@lifeforms
Copy link
Member

It definitely didn't work on old ModSec, but that info was now three years old. Good to see that we can simplify now!

@azurit
Copy link
Member Author
azurit commented Feb 1, 2021

I must add that Include used in installation instructions for nginx is NOT processed by nginx but by modsecurity - it is inside a file specified using ModSecurityConfig directive (and it's read and processed directly by modsec).

Copy link
Contributor
@airween airween left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the #1677 ModSecurity v3 supports the include rules/*.conf. I checked it again, it works.

@fzipi fzipi merged commit ba44488 into coreruleset:v3.4/dev Mar 1, 2021
@azurit azurit deleted the v3.4/DocsFix branch May 18, 2021 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0