Hello Yashwanth,
Thanks for reaching out again.
If there are specific files or folders you do not want the FIM module to scan, you can create exclusions. For example, if you set Wazuh to scan a directory but want to exclude a particular file in the directory from being scanned, you can create an exclusion for that file (
reference). It can be done in either of two methods:
- Using the ignore option: It allows one entry of either file or directory per line. However, you can use multiple lines to add exclusions for multiple paths. The example below shows how you can ignore the regex match for the file extensions .log and .tmp. Replace FILEPATH/OF/MONITORED/FILE with your own filepaths. Add the below settings to the Wazuh agent configuration file:
Linux:
/var/ossec/etc/ossec.conf Windows:
C:\Program Files (x86)\ossec-agent\ossec.conf macOS:
/Library/Ossec/etc/ossec.conf <syscheck>
<ignore>FILEPATH/OF/MONITORED/FILE</ignore>
<ignore type="sregex">.log$|.tmp$</ignore>
</syscheck> Restart the Wazuh agent with admin privilege to apply any configuration change:
Linux:
systemctl restart wazuh-agent Windows:
Restart-Service -Name wazuh macOS:
/Library/Ossec/bin/wazuh-control restart- Using custom rules: Another alternative is using rules of alert level 0. This method ignores the alerting of specific files and directories scanned by the FIM module. Alerts for level 0 rules are silent and the Wazuh server doesn't report them. In the configuration example below, you can see how to monitor the /var/www/htdocs/ directory on a Linux endpoint and use silent alerts for the /var/www/htdocs/private.html file. On a linux endpoint endpoint for example, add the below settings to the Wazuh agent /var/ossec/etc/ossec.conf configuration file:
<syscheck>
<directories>/var/www/htdocs</directories>
</syscheck>
Restart the Wazuh agent with the administrator privilege to apply any configuration change:
systemctl restart wazuh-agent.
On the Wazuh server, create the fim_ignore.xml file in the /var/ossec/etc/rules/ directory on the Wazuh server:
touch /var/ossec/etc/rules/fim_ignore.xml
Add the below rules to the fim_ignore.xml file:
<group name="syscheck">
<rule id="100345" level="0">
<if_group>syscheck</if_group>
<field name="file">/var/www/htdocs/private.html</field>
<description>Ignore changes to $(file)</description>
</rule>
</group>
The rule silences the FIM alert for the /var/www/htdocs/private.html file.
Restart the Wazuh manager to apply the configuration changes:
systemctl restart wazuh-manager
I'd also share some links below which could be helpful too:
I hope this was helpful. Do not hesitate to reach out again if you still need any other thing.
Best regards.