Attackers almost always change something on a system they compromise: a configuration file, a startup script, a web page, a binary. File integrity monitoring (FIM) detects those changes. Wazuh includes a powerful FIM module, called syscheck, that can alert on changes in real time and even tell you who made them.
How Wazuh FIM works
- The agent records a baseline of the monitored files: hashes, size, permissions, owner and timestamps.
- On a schedule, or in real time, it checks the files again.
- When something differs, the agent sends an event to the Wazuh server.
- Built-in rules raise alerts such as file modified (rule 550), file deleted (rule 553) and file added (rule 554).
Step 1: Choose what to monitor
Monitoring everything creates noise. Focus on locations attackers care about:
- Linux:
/etc,/usr/bin,/usr/sbin,/bin,/sbinand your web root. - Windows: system binaries, startup folders and important registry keys.
- Applications: configuration files and deployed code.
Skip folders that change constantly, such as logs, caches and temporary directories.
Step 2: Configure the agent
FIM is configured in the <syscheck> block of the agent configuration file, /var/ossec/etc/ossec.conf on Linux:
<syscheck>
<frequency>43200</frequency>
<directories realtime="yes" report_changes="yes">/etc</directories>
<directories realtime="yes">/usr/bin,/usr/sbin</directories>
<directories realtime="yes" report_changes="yes">/var/www/html</directories>
<ignore>/etc/mtab</ignore>
<ignore type="sregex">.log$|.swp$</ignore>
</syscheck>
What these options do:
frequencyruns a full scan every 12 hours as a safety net.realtime="yes"alerts immediately when a file changes instead of waiting for the next scan.report_changes="yes"includes the actual text that changed for text files, which makes investigation much faster.ignoreremoves files that change legitimately and would create noise.
Restart the agent after saving the file.
Step 3: Find out who made the change
Real-time monitoring tells you what changed. To also see who changed it and which process was used, enable who-data. On Linux it relies on the audit system:
<directories whodata="yes">/etc</directories>
Alerts then include the user, the process name and its ID, which is invaluable during an investigation.
Step 4: Test it
On a monitored lab machine, make a harmless change:
echo "# test" | sudo tee -a /etc/hosts
Within seconds, the dashboard shows a file modified alert with the path, the new hash and, with report_changes, the line that was added.
Avoiding alert fatigue
- Start with a small list of critical paths and expand gradually.
- Ignore files that are expected to change.
- Raise the level of alerts on your most sensitive files with a custom rule.
- Expect bursts of alerts during patching and schedule maintenance windows accordingly.
Why it matters
FIM is required by standards such as PCI DSS, but more importantly it catches real attacks: web shells dropped into a web root, backdoored binaries and tampered configurations. Combined with log analysis and active response, it gives defenders a clear view of what happened on a host.
In our Wazuh XDR SIEM course you configure FIM, simulate tampering in a lab and build the rules to catch it.
Learn this hands-on
Wazuh XDR SIEM
Deploy, tune and run Wazuh in the cloud, from install to custom rules.
View course