owasp-modsecurity / ModSecurity-apache

ModSecurity v3 Apache Connector
Apache License 2.0
87 stars 51 forks source link

chain rules not working in libmodsecurity 3.0 #43

Closed cyberblackhole closed 5 years ago

cyberblackhole commented 5 years ago

Hi,

I have raised an issue here describing chain rules syntax. I'm posting it here as suggested by @victorhora .

Kindly let me know what is wrong.

zimmerle commented 5 years ago

Instead of using multiple _modsecurityrules we recommend you to use a single one. Or to include an external file.

kanhajinis commented 4 years ago

Hi @Goron ,

I faced same issue in ModSecurity-apache with libmodsecurity and followed above two solutions given by @zimmerle but couldn't solve my issue. Then I tried multiple attempts like putting chain in front or put chain in last or put rule in single line. After all that effort I got success in putting both rule in one line like below and worked for me.

modsecurity_rules 'SecRule ARGS "anyargument" "pass,log,id:123,chain"SecRule REQUEST_URI "index.php"'

Could you try same and and check if its working for you. Waiting for your reply.

zimmerle commented 4 years ago

Have you tried:

modsecurity_rules '
    SecRule ARGS "anyargument" "pass,log,id:123,chain"
    SecRule REQUEST_URI "index.php"
'

?

cyberblackhole commented 4 years ago

It's been a long time. I will try this out next time and get back. Thanks for the update @zimmerle

kanhajinis commented 4 years ago

I've tried same and its giving me below error as previously,

modsecurity_rules takes one argument, Please ensure that the arugment is specified correctly, including line continuations.

Only below is working for me,

modsecurity_rules 'SecRule ARGS "anyargument" "pass,log,id:123,chain"SecRule REQUEST_URI "index.php"'

Lets see what @Goron says.