Kleine Kirby
unread,Jun 25, 2024, 5:34:39 AM6/25/24Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Wazuh | Mailing List
Wazuh Version 4.7.5
Hi
I wanted to set up rules in wazuh and write a new custom rule to ignore some alerts with level 5 “Web server 400 error code.”, in wazuh this is rule 31101. I want to write an additional rule that would ignore a certain URL after decoding the log, I have already managed to do this for a regular URL that does not contain special characters, there I described that if the parent rule is 31101 and there is a certain URL, then the rule becomes level 0.
However, I can’t do the same for the URL containing the query parameter at the end of the line - “?”, that is, for the URL - /example/…/…/example? or /example/…/…/?
If I insert the line described above in the URL field in the rule for ignoring, then rule 31101 is still triggered when processing the log, and not the rule I wrote.
At the same time, when decoding the wazuh log at the Phase 2 stage, it correctly determines the URL, but there is a feeling that it does not perceive the “?” sign. I tried to use the decoding of the “?” character, however, this does not help and the rule 31101 still works.
Relevant Logs:
**Phase 1: Completed pre-decoding.
full event: ‘xxx.xxx.xxx.xxx - - [xx/Jun/xxxx:xx:xx:xx +xxxx] “GET /example/example? HTTP/1.1” 404 280 “-” “xxx/x.x (xxx; U; xxx NT x.x; en-US; rv:x.x.x.x) Xxx/xxxxxx xxxxx/x.x.x”’
**Phase 2: Completed decoding.
name: ‘web-accesslog’
id: ‘404’
protocol: ‘GET’
srcip: ‘xxx.xxx.xxx.xxx’
url: ‘/example/example?’
**Phase 3: Completed filtering (rules).
id: ‘31101’
level: ‘5’
description: ‘Web server 400 error code.’
groups: ‘[‘web’, ‘accesslog’, ‘attack’]’
firedtimes: ‘1’
gdpr: ‘[‘IV_35.7.d’]’
mail: ‘False’
nist_800_53: ‘[‘SA.11’, ‘SI.4’]’
pci_dss: ‘[‘6.5’, ‘11.4’]’
tsc: ‘[‘CC6.6’, ‘CC7.1’, ‘CC8.1’, ‘CC6.1’, ‘CC6.8’, ‘CC7.2’, ‘CC7.3’]’
**Alert to be generated.
Example custom rule:
<rule id=“100111” level=“0”>
<if_sid>31101</if_sid>
<url>/example/example?</url>
<compiled_rule>is_simple_http_request</compiled_rule>
<description>Ignored extensions on 400 error codes</description>
</rule>