Hi Virgilio,
Thanks for using our community!
The issue you are facing is due to a missing tag on the rules. In order to reference a parent rule you need to add the tag on the new rule pointing to the parent rule you want to extend.
For example in rule 100047 you need to call 31101 in order for Wazuh to test the new rule when 31101 is called.
Once was added the rules work as expected, Rule 100047 will look like this:
<group name="exceptions,">
<rule id="100047" level="3">
<if_sid>31101<if_sid>
<srcip>192.168.1.10</srcip>
<description>Ignore alerts from 192.168.1.10.</description>
</rule>
</group>
Test
Log:
192.168.1.10 - - [14/Apr/2022:06:09:42 -0400] "GET /cgi-bin/clwarn.cgi HTTP/1.1" 404 216 "${jndi:ldap://log4shell-generic-aioTzmIZTGsZWgnr2mGv${lower:ten}.w.nessus.org/nessus}" "${jndi:ldap://log4shell-generic-aioTzmIZTGsZWgnr2mGv${lower:ten}.w.nessus.org/nessus}"
Result
**Phase 1: Completed pre-decoding.
full event: '192.168.1.10 - - [14/Apr/2022:06:09:42 -0400] "GET /cgi-bin/clwarn.cgi HTTP/1.1" 404 216 "${jndi:ldap://log4shell-generic-aioTzmIZTGsZWgnr2mGv${lower:ten}.w.nessus.org/nessus}" "${jndi:ldap://log4shell-generic-aioTzmIZTGsZWgnr2mGv${lower:ten}.w.nessus.org/nessus}"'
timestamp: '(null)'
hostname: 'welastic'
program_name: '(null)'
log: '192.168.1.10 - - [14/Apr/2022:06:09:42 -0400] "GET /cgi-bin/clwarn.cgi HTTP/1.1" 404 216 "${jndi:ldap://log4shell-generic-aioTzmIZTGsZWgnr2mGv${lower:ten}.w.nessus.org/nessus}" "${jndi:ldap://log4shell-generic-aioTzmIZTGsZWgnr2mGv${lower:ten}.w.nessus.org/nessus}"'
**Phase 2: Completed decoding.
decoder: 'web-accesslog'
srcip: '192.168.1.10'
protocol: 'GET'
url: '/cgi-bin/clwarn.cgi'
id: '404'
**Phase 3: Completed filtering (rules).
Rule id: '100047'
Level: '3'
Description: 'Ignore alerts from 192.168.1.10.'
**Alert to be generated.
The rule for the cdb list had the same issue after adding 31101 it will work as expected, by the way the correct rule to implement would be 100003 is the correct syntax for matching cdb list with the source IPs.
<group name="exceptions,">
<rule id="100003" level="3">
<if_sid>31101<if_sid>
<list field="srcip" lookup="address_match_key">etc/lists/security-scanners</list>
<description>Ignored (downgraded to level 3 to retain logging) alerts from Security Scanners (by src ip)</description>
</rule>
</group>
Bellow is some reference documentation on rules syntax:
https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/rules.htmlRegards
Hi Virgilio,
You can create a CDB as you did with all the IPs you require, but you will have to apply it to every rule as in the example below:
<group name="exceptions,">
<rule id="100003" level="3">
<if_sid>31101<if_sid>
<list field="srcip" lookup="address_match_key">etc/lists/security-scanners</list>
<description>Ignored (downgraded to level 3 to retain logging) alerts from Security Scanners (by src ip)</description>
</rule>
</group>
There is no way to apply such a filter to every rule other than silencing each one as shown.
Regards!