Hello,
I’m running Wazuh 4.8.2 on Ubuntu 20.04 and trying to drop all logs originating from specific IP addresses using a CDB list. Here’s what I’ve done so far:
Created the CDB list
File: /var/ossec/etc/lists/list-whitelist-ip
Contents:
Declared the list in ossec.conf
<ruleset>
…
<!-- existing lists -->
<list>etc/lists/list-whitelist-ip</list>
…
</ruleset>
Restarted the Wazuh manager.
Added local rules in /var/ossec/etc/rules/local_rules.xml
<group name="whitelist">
<rule id="100200" level="0">
<decoded_as>json</decoded_as>
<list field="sourceIp" lookup="address_match_key">etc/lists/list-whitelist-ip</list>
<description>Whitelist JSON logs by sourceIp</description>
<options>no_full_log</options>
</rule>
<rule id="100201" level="0">
<decoded_as>json</decoded_as>
<list field="win.eventdata.ipAddress" lookup="address_match_key">etc/lists/list-whitelist-ip</list>
<description>Whitelist Windows EventChannel logs by ipAddress</description>
<options>no_full_log</options>
</rule>
</group>
Restarted the manager again.
Result:
Rule 100200 correctly suppresses custom logs with sourceIp.
Why isn’t rule 100201 suppressing real Windows Event logs by win.eventdata.ipAddress ( also tried data.win.eventdata.ipAddress), and how can I fix it so that RDP attempts from whitelisted IPs are dropped?
Thank you!
Reference:
https://documentation.wazuh.com/4.8/user-manual/ruleset/cdb-list.html
Based on the shared details, it seems that you are facing an issue related to suppressing the Windows EventChannel alert on the dashboard from a whitelisted source IP. However, you have used the <decoded_as> tag to match the decoder log with your custom rule (rule ID 100201). That might be the reason why your rule is not suppressing the events.
For Windows EventChannel logs, default rules are available in the Wazuh manager. You need to identify the rule that is triggering the event you want to suppress from the Wazuh dashboard. After identifying the rule ID, use the <if_sid> tag in your custom rule 100201 to match the parent rule, as shown below:
In the above custom rule, you need to replace <parent_rule_id> with the rule ID that you want to suppress. After triggering the rule ID that you want to suppress, Wazuh's analysisd will check your custom child rule. If the win.eventdata.ipAddress matches a value listed in the CDB list, it will suppress the alert by assigning rule level 0.
You can refer to the Wazuh rules syntax documentation for more details.
If you need further assistance, please share the sample log of the event that you want to suppress from the Wazuh manager’s archives.json file.
Hello,
Thank you for your response, I followed the recommendation to include the parent rule’s ID as SID in my local rule, but it still isn’t suppressing the Windows EventChannel alerts. Below I’ve provided:
Parent rule
My tested local rule (with parent ID as SID)
A sample log from alerts.json
One additional concern:
By tying local rule with parent rule’s ID, it only applies to RDP-related events. If I later need to whitelist logs from another Windows host or event type, I’d have to write a new rule each time. Is there a way to keep the rule more generic—so that it checks win.eventdata.ipAddress against the CDB list without depending on a specific parent rule?
Parent Rule :I understand that this was added to make rule 100300 generic (i.e., to match all Windows EventChannel logs), but this won’t work as expected.
In your current rule chain:
100109 has 60122 as its parent.
100300 has 100109 as its parent.
Rule 60122 is triggered for Windows event IDs 529 and 4625 (Failed Logons).
So, rule 100300 will only evaluate events already matched by rule 100109, which in turn depends on 60122. This ensures that the whitelist logic is only applied to relevant failed logon events.
I have also attached a screenshot of my testing for your reference.
For more information on writing custom rules, you can refer to the Wazuh rules syntax documentation.
