Hello Daniel! Hope you are doing great.
What I can suggest to you is to use CDB lists, allowing you to match any field extracted during the decoding phase, for example srcip. You can create your own black/white list. I think that if you want to not receive alerts from certain IPs what you can do is create a black list with those IPs(if you mean to only receive alerts from your known nodes, just do the opposite, create a white list with your desired IPs).
Create your list like follows:
192.168.1.10:
192.168.1.11:
192.168.1.12:
192.168.1.13:
sample.domain.com:
You can specify the known IP or domain. You can match the IPs with subnets using the dot notation and :. 192.168.: is the same than 192.168.0.0/16, so it matches with 192.168.0.0 - 192.168.255.255
Do not forget to store your lists in /var/ossec/etc/lists and define it in the ruleset section within ossec.conf file:
<ossec_config>
<ruleset>
<list>etc/lists/your_list</list>
You can use the lists in both custom and default rules. In your case, as you want to look for the srcip field, you have to also specify lookup="address_match_key"in the desired rules:
<list field="srcip" lookup="address_match_key">etc/lists/your_list</list>
Finally, restart Wazuh:
systemctl restart wazuh-manager
Here you have a CDB lists overview. Also, here you have a use case of ignoring/blocking IPs using CDB lists.
Do not hesitate to ask for help or any doubt.
Hope this helps you,
Luis.
Hello again, sorry for the late response.
I have replicated your case and the rule has been muted successfully:
Create the black_list with this content:
192.168.5.55:
Add the list to the ruleset section within /var/ossec/etc/ossec.conf file.
Then, modify the rule in /var/ossec/etc/rules/local_rules.xml:
<rule id="100002" level="0">
<if_sid>5706</if_sid>
<list field="srcip" lookup="address_match_key">etc/lists/black_list</list>
<description>Rule to ignore known hosts</description>
<group>pci_dss_10.2.5,pci_dss_10.2.2,gpg13_7.6,gpg13_7.8,gpg13_7.13,gdpr_IV_32.2,</group>
</rule>
Finally, check the muted rule with wazuh-logtest:
root@manager:/home/vagrant# /var/ossec/bin/wazuh-logtest
Starting wazuh-logtest v4.2.5
Type one log per line
Apr 8 10:34:43 omissis sshd[20220]: Did not receive identification string from 192.168.5.55
**Phase 1: Completed pre-decoding.
full event: 'Apr 8 10:34:43 omissis sshd[20220]: Did not receive identification string from 192.168.5.55'
timestamp: 'Apr 8 10:34:43'
hostname: 'omissis'
program_name: 'sshd'
**Phase 2: Completed decoding.
name: 'sshd'
parent: 'sshd'
srcip: '192.168.5.55'
**Phase 3: Completed filtering (rules).
id: '100002'
level: '0'
description: 'Rule to ignore known hosts'
groups: '['local', 'syslog', 'sshd']'
firedtimes: '1'
gdpr: '['IV_32.2']'
gpg13: '['7.6', '7.8', '7.13']'
mail: 'False'
pci_dss: '['10.2.5', '10.2.2']'
You have to change each rule manually that you want to mute. If I figure out how to mute them all more easily, I’ll tell you here.
Hope this helps you,
Luis.