I've been doing some reading, but I'm not quite sure how to address this problem. I'm working on a very poorly written app that has lots of security issues. I've got modsecurity running protecting it, but to get it working I've had to disable 22 rules (SecRuleRemoveByID NUM). I'd prefer for these rules to only be disabled for the specific issue where they block legitimate use.
In this case, the problem is in the ARGS for AnSwEr0001, but there will be numerous AnSwErS in this app. (0001,0002,0003, etc.)
I don't want to allow 8t^2 in the general case, but I have to allow it in this specific case. Is there a way to do this by either altering the rule or by using a special command?
I read something on the web about using SecRuleUpdateTargetsById NUM "!ARGS_NAMES", but the explanation wasn't very clear, and when I placed that in my custom rules file (modsecurity_crs_60_custom_rules.conf) Apache balked with the following error: Invalid command 'SecRuleUpdateTargetById', perhaps misspelled or defined by a module not included in the server configuration
Did I put it in the wrong place? Is it the right way to attack this problem?
Edited to add:
Maybe this will help?
Producer: ModSecurity for Apache/2.7.3 (http://www.modsecurity.org/); OWASP_CRS/2.2.6.
If I understand that correctly, we're running modsecurity 2.7.3 with the CRS version 2.2.6. The error apache throws seems to be indicating that the version I have doesn't know about that command, but I thought it was available in version 2.6.
Last edit: Paul Schmehl 2013-09-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Never mind. I figured it out. The command has to be read in before all the rules. I created a custom rule file named modsecurity_crs_15_customrules.conf, and Apache is happy now.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've been doing some reading, but I'm not quite sure how to address this problem. I'm working on a very poorly written app that has lots of security issues. I've got modsecurity running protecting it, but to get it working I've had to disable 22 rules (SecRuleRemoveByID NUM). I'd prefer for these rules to only be disabled for the specific issue where they block legitimate use.
For example:
In this case, the problem is in the ARGS for AnSwEr0001, but there will be numerous AnSwErS in this app. (0001,0002,0003, etc.)
I don't want to allow 8t^2 in the general case, but I have to allow it in this specific case. Is there a way to do this by either altering the rule or by using a special command?
I read something on the web about using SecRuleUpdateTargetsById NUM "!ARGS_NAMES", but the explanation wasn't very clear, and when I placed that in my custom rules file (modsecurity_crs_60_custom_rules.conf) Apache balked with the following error: Invalid command 'SecRuleUpdateTargetById', perhaps misspelled or defined by a module not included in the server configuration
Did I put it in the wrong place? Is it the right way to attack this problem?
Edited to add:
Maybe this will help?
Producer: ModSecurity for Apache/2.7.3 (http://www.modsecurity.org/); OWASP_CRS/2.2.6.
If I understand that correctly, we're running modsecurity 2.7.3 with the CRS version 2.2.6. The error apache throws seems to be indicating that the version I have doesn't know about that command, but I thought it was available in version 2.6.
Last edit: Paul Schmehl 2013-09-11
Never mind. I figured it out. The command has to be read in before all the rules. I created a custom rule file named modsecurity_crs_15_customrules.conf, and Apache is happy now.
I have a related question. Can you use wild cards in ARGS:foo? For example:
SecRuleUpdateTargetById 999999 "!ARGS:foo*"
Or does the suffix have to be precise? E.g foo1, foo2, foo3?
Last edit: Paul Schmehl 2013-09-11
Never mind again. I found the section in the manual and read that you can use regex.