Open Orgoth opened 2 hours ago
Hi @Orgoth,
which version do you use?
If you use libmodsecurity3 and Nginx, you should try to put into a location
block:
location /api/endpoint {
modsecurity_rules '
SecPcreMatchLimit 1024
';
}
See this part of documentation.
Sorry forgot to mention. I am using libapache2-mod-security2 2.9.3-3+deb11u2.
I suspect, I can create a files block within the vhost and set the rule for this specific file. Thank you very much.
Please feel free to close this issue if you could solve that.
Sadly, this is not possible.
SecPcreMatchLimit not allowed in <Location> context
SecPcreMatchLimit not allowed in <FilesMatch> context
SecPcreMatchLimit not allowed in <Directory> context
ModSecurity: SecPcreMatchLimit not allowed in VirtualHost
I will disable modsecurity via exclude rule for this api, the coworker confirmed, he will take responsibility.
But could this behavior be changed? That you allow Apache in the module/lib that this rule can be set in the VHOST?
https://github.com/owasp-modsecurity/ModSecurity/tree/v2/master
Or is this something you do not have control and can not be changed within the module, to tell apache, it is allowed within the vhost?
Is there a way to increase the SecPcreMatchLimit for a specific file? Our Application has an API which receives very large amounts of data and I only want to increase the limit for this API. The global limit should stay the same.