Hello,
I want to audit unsuccessful attempts to access directories and files. This is achieved by auditing event 4656 but it is filtered out by default in Windows Wazuh agent:
<localfile>
<location>Security</location>
<log_format>eventchannel</log_format>
<query>Event[System/EventID != 5145 and EventID != 5156 and EventID != 5447 and
EventID != 4658 and EventID != 4663 and EventID != 4660 and
EventID != 4670 and EventID != 4690 and EventID != 4703 and EventID != 4907 and
EventID != 5152 and EventID != 5157 and EventID != 4656]</query>
</localfile>
Removing "and EventID != 4656" simply generates a lot of audit success events in Wazuh that I don't want to deal with. I would like to receive the events with ID 4656 and audit failure which leads me to filter by Event ID plus Keyword field.
Keyword 0x8020000000000000 corresponds to audit success
And Keyword 0x8010000000000000 corresponds to audit failure
I tried the following query but the I don't get any Security event:
<localfile>
<location>Security</location>
<log_format>eventchannel</log_format>
<query>Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and
EventID != 4658 and EventID != 4663 and EventID != 4660 and
EventID != 4670 and EventID != 4690 and EventID != 4703 and EventID != 4907 and
EventID != 5152 and EventID != 5157 and (EventID != 4656 and Keywords != '0x8020000000000000')]</query>
</localfile>
I also tried with Keyword in decimal as follows. Then I get Security events but none with Event ID 4656
:
<localfile>
<location>Security</location>
<log_format>eventchannel</log_format>
<query>Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and
EventID != 4658 and EventID != 4663 and EventID != 4660 and
EventID != 4670 and EventID != 4690 and EventID != 4703 and EventID != 4907 and
EventID != 5152 and EventID != 5157 and (EventID != 4656 and Keywords != '9007199254740992')]</query>
</localfile>
Any ideas on how to filter negatively on EventID and Keywords in the Wazuh agent side?
Best regards.