Hello Hishman,
If we take a look at the provided event we can see that it corresponds to a
DNS Query event. This event would trigger the
61650 rule. However, this alert has a level 0, so it will not be logged by the manager. For this reason, you can not see it in the dashboard or stored in the alert.log file. Check this documentation page about alert threshold:
https://documentation.wazuh.com/current/user-manual/manager/alert-threshold.html.
Logtest could be a great tool for testing your ruleset in this case. Windows event logs are not supported by the logtest tool. However, you can work around this issue by changing the base Windows rule 60000. In the rule file
0575-win-base_rules.xml, change the rule id 60000, removing the category tag and changing the decoded_as tag value for json.
It should look like this:
<rule id="60000" level="0">
<decoded_as>json</decoded_as>
<field name="win.system.providerName">\.+</field>
<options>no_full_log</options>
<description>Group of windows rules.</description>
</rule>Now, using the logtest tool with your gathered event (stored in the full_log field) we can see even the level 0 alert triggered by your alert:
**Phase 3: Completed filtering (rules).
id: '61650'
level: '0'
description: 'Sysmon - Event 22: DNS Query event'
groups: '['windows', 'sysmon', 'sysmon_event_22']'
firedtimes: '1'
mail: 'False'Regarding your rules, you should integrate them with the default Wazuh ruleset. In this case, if you want to overwrite the 61650 rule you can follow this approach:
<group name="sysmon_event1,">
<rule id="255001" level="8">
<if_sid>61650</if_sid>
<description>Sysmon - Event 22: DNS Query to: $(win.eventdata.queryName) by $(win.eventdata.user)</description>
<group>sysmon_event_22,</group>
</rule>
</group>
We have added the if_sid option, so, this rule will match when rule 61650 is triggered.
Using the logtest we can see that our custom rule is triggering correctly:
**Phase 3: Completed filtering (rules).
id: '255001'
level: '8'
description: 'Sysmon - Event 22: DNS Query to: forms-cdn.clickup.com by HISHAM-MSI\\Hisham'
groups: '['sysmon_event1', 'sysmon_event_22']'
firedtimes: '1'
mail: 'False'
**Alert to be generated.
Remember to reset the Windows-base rule to the default in order to trigger real Windows events in the production environment.
If you have any doubts do not hesitate to ask.