Hi
Carlos Arturo Erazo NarváezModify the configuration settings to limit the types of events that trigger alerts. You can specify which directories or files to monitor more selectively. This can be done by editing the ossec.conf file on your Wazuh agent. You can use the ignore option to ignore a path. It allows one entry of either file or directory per line. However, you can use multiple lines to add exclusions for multiple paths.
https://documentation.wazuh.com/current/user-manual/capabilities/file-integrity/basic-settings.html#adding-exclusionsWazuh allows for customization of alert rules. You can create or modify existing rules to suppress alerts based on specific criteria such as event type, source, or severity. This involves editing the rules files located in /var/ossec/etc/rules/. You can also modify or create custom rule using ignore or overwrite for that you can refer to
https://documentation.wazuh.com/current/user-manual/ruleset/rules/custom.html https://documentation.wazuh.com/current/user-manual/ruleset/ruleset-xml-syntax/rules.htmlIf you want to exclude logs collection, go to ossec.conf of Wazuh agent on your endpoint
You can remove these lines related to the event channel log or log file collection
<localfile>
<location>Application</location>
<log_format>eventchannel</log_format>
</localfile>
<localfile>
<location>Security</location>
<log_format>eventchannel</log_format>
<query>Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and
EventID != 4656 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]</query>
</localfile>
<localfile>
<location>System</location>
<log_format>eventchannel</log_format>
</localfile>
Additionally in windows, for specific event id, you can use expressions like !=, <>: The left-hand expression is not equal to the right-hand expression. like:
<query>Event/System[EventID != 5145 and EventID != 5156 and EventID != 5447 and
EventID != 4656 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]</query>
In this case, the Wazuh agent will send system-related events, excluding the specified event IDs.
Refer to
https://documentation.wazuh.com/current/user-manual/capabilities/log-data-collection/configuration.html#windowsYou can do this by following these steps:
Run PowerShell as administrator
Open the configuration file with
notepad.exe 'C:\Program Files (x86)\ossec-agent\ossec.conf'
Then remove the configuration and save the file.
After that restart the agent
Restart-Service -Name wazuh
In Linux you can use ignore and excluded options
For example, to ignore events related to configuration changes in the audit log:
<localfile>
<log_format>audit</log_format>
<location>/var/log/audit/audit.log</location>
<ignore type="PCRE2">type=.+_CHANGE</ignore>
<ignore type="osregex">type=CONFIG_\.+</ignore>
</localfile>
For example, we may want to read all the files from a directory, but exclude those files whose name starts with an e.
<localfile>
<log_format>syslog</log_format>
<location>/var/logs/*</location>
<exclude>/var/logs/e*</exclude>
</localfile>
Then restart the wazuh-agent using the command systemctl restart wazuh-agent
Refer To
https://documentation.wazuh.com/current/user-manual/reference/ossec-conf/localfile.htmlHope this helps