Skip to content

ModSecurity: SecPcreMatchLimit not allowed in VirtualHost #1481

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

Closed
itbuiductai opened this issue Jul 3, 2017 · 5 comments
Closed

ModSecurity: SecPcreMatchLimit not allowed in VirtualHost #1481

itbuiductai opened this issue Jul 3, 2017 · 5 comments
Assignees

Comments

@itbuiductai
Copy link

itbuiductai commented Jul 3, 2017

I try to configure modsecurity with a virtual host in apache then it alerted the error: "ModSecurity: SecPcreMatchLimit not allowed in VirtualHost". Why SecPcreMatchLimit was not allowed in Virtual host? any option of mod_sec is same that.

@victorhora victorhora self-assigned this Jul 3, 2017
@victorhora
Copy link
Contributor

Hi @itbuiductai,

Yes, indeed there are a few directives that aren't allowed to be placed inside VirtualHost configurations, namely:

You should place these inside your global server-wide (not per VirtualHost) configuration. Normally this will be placed inside your modsecurity.conf configuration file.

@victorhora
Copy link
Contributor

I've added notes on the reference manual to make this limitation clearer:

https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#SecPcreMatchLimit

@itbuiductai
Copy link
Author

Hi @victorhora
yes, i see.
But then we can only use a modsecurity.conf template per webserver.
do you know anyway to configure modsecurity.conf per virtualhost?
what is important of SecPcreMatchLimit?
Thanks

@victorhora
Copy link
Contributor

You should be able to safely set different VirtualHosts just fine with your ModSecurity configuration. As long as your "template" don't use any of the directives mentioned above inside your VirtualHost context and just have this one directive set globally.

You might have a legitimate reason for needing to set different SecPcreMatchLimit values for different web applications, but you should be able to get away with it by just setting the value globally.

You can learn about SecPcreMatchLimit on the reference manual: https://github.com/SpiderLabs/ModSecurity/wiki/Reference-Manual#SecPcreMatchLimit

@itbuiductai
Copy link
Author

Thanks @victorhora ,
I hope you received my message. Pls, contact with me as soon as you agree,
best regard!

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

No branches or pull requests

2 participants