owasp-modsecurity / owasp-modsecurity/ModSecurity
Audit log match does not represent chained rules
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.8k
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 1
Description
Hi,
When using chained rules, the match field only contains details about the last rule in the chain:
SecRule REQUEST_HEADERS:User-Agent "@contains curl" "id:1000,msg:'POST with cURL',auditlog,phase:1,deny,t:none,chain"
SecRule REQUEST_METHOD "@rx POST" "t:none"
Trigger the rule:
curl -X POST http://localhost:8080/hello
Current log message:
Matched "Operator `Rx' with parameter `POST' against variable `REQUEST_METHOD' (Value: `POST' )
Expected log message:
Matched: "Operator `Contains' with parameter `curl' against variable `REQUEST_HEADERS:User-Agent' (Value: `curl/8.5.0' ), "Operator `Rx' with parameter `POST' against variable `REQUEST_METHOD' (Value: `POST' )
Currently, the audit log does not fully represent which conditions caused the chained rule to match.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the chained SecRule with curl and compare the current and expected audit-log match messages. Trace the audit-log handling for chained rules and verify that the completed log represents every matched condition, including both the User-Agent and request-method checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100