Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Ensure that all rules with ARGS also consider XML:* #1227

Closed
csanders-git opened this issue Nov 5, 2018 · 12 comments
Closed

Ensure that all rules with ARGS also consider XML:* #1227

csanders-git opened this issue Nov 5, 2018 · 12 comments
Assignees
Labels
Feature Request Good first issue Stale issue This issue has been open 120 days with no activity.

Comments

@csanders-git
Copy link
Contributor

Type of Issue

Feature Request

Description

In general we'll like to have XML considered for all rules, where it is evaluated. This can be done by adding the TARGET of XML:* to the rules. But we need to be careful to ensure only the rules that need it, get it. Starting with rules that have ARGS, is a good start

Confirmation

[x] I have removed any personal data (email addresses, IP addresses,
passwords, domain names) from any logs posted.

@spartantri
Copy link
Contributor

I think that XML:/* would be the equivalent for XML to ARGS in URLENCODED, so it makes sense to have them together by default

@ghost
Copy link

ghost commented Jan 22, 2019

Taking this issue. I think I understand it, and if that's the case, I'll have it done in two weeks...testing for a cert this weekend or would have it all sooner :)

@dune73
Copy link
Contributor

dune73 commented Jan 23, 2019

Looking forward to that! Thanks.

@ghost
Copy link

ghost commented Feb 12, 2019

Does someone have an example of what this rule would look like? The only way I can see to specifically target XML coming in is to check the Headers. E.g.:

SecRule REQUEST_HEADERS:Content-Type ^text/xml ?

or maybe

SecRule ARGS|XML:/* blahblahblah id:2000 ?

I actually don't see a mention of XML:/* anywhere in the documentation I'm looking at, although it is for 2.9.

@ghost
Copy link

ghost commented Feb 12, 2019

@dune73 Just look at this comment:

Actually, I think this is the answer.

Anything that has the word ARGS after SecRule should, if it doesn't right now, have |XML:/* appended to it?

E.g. like the following rule:

SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|REQUEST_HEADERS:User-Agent|REQUEST_HEADERS:Referer|ARGS_NAMES|ARGS|XML:/* "@detectSQLi" \

@dune73
Copy link
Contributor

dune73 commented Feb 12, 2019

Could you guys please support @danehrlich1? I'm overly busy at the moment.

@ghost
Copy link

ghost commented Feb 15, 2019

@spartantri Can you look at my comment really quickly? Think I am correct but just want someone to double check.

@spartantri
Copy link
Contributor

Hi @danehrlich1 it may be better to discuss this in slack, but basically, this one is to add XML:/* to all SecRule's that have ARGS as targets of the rule.
You may find all targets with running the command below on the rule set directory:
egrep -o "SecRule ([^\s])ARGS([^\s]) " *|grep -v "XML:"
You may find rules that do check both ARGS and XML removing the -v from the previous command:
egrep -o "SecRule ([^\s])ARGS([^\s]) " *|grep "XML:"

@fzipi
Copy link
Contributor

fzipi commented Oct 5, 2019

@danehrlich1 Did you made any progress with this? Do you need more help/advise?

@github-actions
Copy link

github-actions bot commented Feb 3, 2020

This issue has been open 120 days with no activity. Remove the stale label or comment, or this will be closed in 14 days

@github-actions github-actions bot added the Stale issue This issue has been open 120 days with no activity. label Feb 3, 2020
@lifeforms lifeforms self-assigned this Feb 10, 2020
@dune73
Copy link
Contributor

dune73 commented Feb 11, 2020

@lifeforms volunteered to fix this issue during the monthly CRS chat.

Meeting minutes: #1671 (comment)

@dune73 dune73 reopened this Mar 2, 2020
@dune73
Copy link
Contributor

dune73 commented Mar 2, 2020

@lifeforms: Any update here?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature Request Good first issue Stale issue This issue has been open 120 days with no activity.
Projects
None yet
Development

No branches or pull requests

5 participants