File integrity monitoring
The File Integrity Monitoring (FIM) indices store the monitored files and Windows registry entries, with attributes such as hashes, permissions, and owners.
The following example shows a document from the wazuh-states-fim-files index. It records the attributes of a monitored file on the Ubuntu endpoint:
{
"_index" : "wazuh-states-fim-files",
"_id" : "wazuh_003_9a30e2494a7578925cde57179ccce87978f8af3e",
"_score" : 1.0,
"_source" : {
"file" : {
"inode" : "2886305",
"owner" : "root",
"path" : "/etc/grub.d/README",
"uid" : "0",
"gid" : "0",
"size" : 483,
"permissions" : [
"rw-r--r--"
],
"mtime" : "2025-03-17T13:20:09.000Z",
"device" : "64770",
"hash" : {
"sha1" : "7330684105b8e3df69f7a7a0af1436610f254f58",
"sha256" : "cd72738c7dfd3b205e4e91528c0d25169bb3e8e6ebeec11c916662d8d0c3e47c",
"md5" : "be58f42dfe74feb6eeb98c6a843c743f"
},
"group" : "root"
},
"checksum" : {
"hash" : {
"sha1" : "343e5b87c9be19207c585fc09bcf86877ce4324f"
}
},
"wazuh" : {
"cluster" : {
"name" : "wazuh"
},
"agent" : {
"host" : {
"hostname" : "ubuntu-QEMU-Virtual-Machine",
"os" : {
"name" : "Ubuntu",
"type" : "linux",
"version" : "24.04.4 LTS (Noble Numbat)",
"platform" : "ubuntu"
},
"architecture" : "aarch64"
},
"name" : "Ubuntu",
"groups" : [
"default"
],
"id" : "003",
"version" : "v5.0.0"
}
},
"state" : {
"document_version" : 298,
"modified_at" : "2026-10-29T08:01:45.264Z"
}
}
}
Example: Detect a file by its hash, then find every endpoint that has it
WCS uses the same field names in events and in state indices. file.hash.sha256 is in the FIM events that the Wazuh agent sends when a file changes, and in the wazuh-states-fim-files index that keeps the current state of each file. First a rule flags the hash in a FIM event, then a query finds every endpoint that still has the file. Replace the hash with one from your threat report.
Create the rule in Ruleset management > Detection > Rules. The rule's logsource.product must match the title of the integration you create it in. The events come from the built-in wazuh-fim integration, so create the rule in a custom integration titled wazuh-fim. Then promote it to the custom space and add it to a custom detector in Ruleset management > Detection > Detectors. In the query, replace <WAZUH_INDEXER_IP_ADDRESS>, <USERNAME>, and <PASSWORD> with your values. The highlighted lines show where file.hash.sha256 is used and where it appears in the output.
1. Rule on FIM events
logsource:
product: wazuh-fim
level: high
status: experimental
enabled: true
detection:
condition: selection
selection:
event.dataset: wazuh.fim
file.hash.sha256: 382b8ae959c6eefb675e465b49222eca3b63e4dcf6cba4cdd20e816a823b14a5
metadata:
title: File with a known malicious hash
author: Security Team
description: Detects a monitored file whose SHA256 hash matches a hash from a threat report.
2. Finding (excerpt)
{
"event": { "dataset": "wazuh.fim", "action": "created" },
"file": {
"path": "/home/ubuntu/Downloads/brctl-copy",
"hash": {
"sha256": "382b8ae959c6eefb675e465b49222eca3b63e4dcf6cba4cdd20e816a823b14a5"
}
},
"wazuh": {
"agent": { "name": "Ubuntu" },
"rule": { "title": "File with a known malicious hash", "level": "high" }
}
}
3. Query on the state index
curl -k -u <USERNAME>:<PASSWORD> -X GET "https://<WAZUH_INDEXER_IP_ADDRESS>:9200/wazuh-states-fim-files/_search?pretty" \
-H 'Content-Type: application/json' -d '
{
"query": { "term": { "file.hash.sha256": "382b8ae959c6eefb675e465b49222eca3b63e4dcf6cba4cdd20e816a823b14a5" } },
"_source": [ "wazuh.agent.name", "file.path", "file.hash.sha256" ]
}'
4. Result (excerpt)
"hits": [
{
"_index": "wazuh-states-fim-files",
"_source": {
"wazuh": { "agent": { "name": "Ubuntu" } },
"file": {
"path": "/usr/sbin/brctl",
"hash": { "sha256": "382b8ae959c6eefb675e465b49222eca3b63e4dcf6cba4cdd20e816a823b14a5" }
}
}
},
{
"_index": "wazuh-states-fim-files",
"_source": {
"wazuh": { "agent": { "name": "Ubuntu" } },
"file": {
"path": "/home/ubuntu/Downloads/brctl-copy",
"hash": { "sha256": "382b8ae959c6eefb675e465b49222eca3b63e4dcf6cba4cdd20e816a823b14a5" }
}
}
}
]
Note
The finding tells you when a copy of the file appeared. The state index tells you every place it is now, including the original
/usr/sbin/brctl, which was there before the rule existed.On the Wazuh dashboard, the same search in Discover is
file.hash.sha256: "382b8ae9…".
wazuh-states-fim-files
Monitored files.
Field |
Type |
Level |
Normalization |
Indexed |
Example |
Description |
|---|---|---|---|---|---|---|
|
|
|
|
|
Log message optimized for viewing in a log viewer. |
|
|
|
|
|
SHA1 hash used as checksum of the data collected by the agent. |
||
|
|
|
|
|
|
Array of file attributes. |
|
|
|
|
|
Device that is the source of the file. |
|
|
|
|
|
|
Primary group ID (GID) of the file. |
|
|
|
|
|
|
Primary group name of the file. |
|
|
|
|
|
MD5 hash. |
||
|
|
|
|
SHA1 hash. |
||
|
|
|
|
SHA256 hash. |
||
|
|
|
|
|
Inode representing the file in the filesystem. |
|
|
|
|
|
Last time the file content was modified. |
||
|
|
|
|
|
File owner's username. |
|
|
|
|
|
|
Full path to the file, including the file name. |
|
|
|
|
|
|
List of permissions related to the file. |
|
|
|
|
|
|
File size in bytes. |
|
|
|
|
|
|
The user ID (UID) or security identifier (SID) of the file owner. |
|
|
|
|
|
Version of the document. |
||
|
|
|
|
Date/time when the state was last modified. |
||
|
|
|
|
|
|
List of groups the agent belongs to. |
|
|
|
|
|
Operating system architecture. |
|
|
|
|
|
Hostname of the host. |
||
|
|
|
|
|
Host ip addresses. |
|
|
|
|
|
|
Operating system name, without the version. |
|
|
|
|
|
|
Operating system platform (such centos, ubuntu, windows). |
|
|
|
|
|
|
Which commercial OS family (one of: linux, macos, unix, windows, ios or android). |
|
|
|
|
|
|
Operating system version as a raw string. |
|
|
|
|
|
|
Unique identifier of this agent. |
|
|
|
|
|
|
Custom name of the agent. |
|
|
|
|
|
|
Version of the agent. |
|
|
|
|
|
Wazuh cluster name. |
||
|
|
|
|
Wazuh cluster node name. |
||
|
|
|
|
Wazuh schema version. |
wazuh-states-fim-registry-keys
Monitored Windows registry keys.
Field |
Type |
Level |
Normalization |
Indexed |
Example |
Description |
|---|---|---|---|---|---|---|
|
|
|
|
|
Log message optimized for viewing in a log viewer. |
|
|
|
|
|
SHA1 hash used as checksum of the data collected by the agent. |
||
|
|
|
|
Architecture associated with the entity |
||
|
|
|
|
Group ID associated with the entity |
||
|
|
|
|
Name of the group that owns the entity |
||
|
|
|
|
|
Abbreviated name for the hive. |
|
|
|
|
|
|
Hive-relative path of keys. |
|
|
|
|
|
Last modified timestamp of the entity |
||
|
|
|
|
Name of the owner of the entity (user) |
||
|
|
|
|
|
Full path, including hive, key and value |
|
|
|
|
|
|
Permissions associated with the registry key. |
|
|
|
|
|
User ID associated with the entity |
||
|
|
|
|
Version of the document. |
||
|
|
|
|
Date/time when the state was last modified. |
||
|
|
|
|
|
|
List of groups the agent belongs to. |
|
|
|
|
|
Operating system architecture. |
|
|
|
|
|
Hostname of the host. |
||
|
|
|
|
|
Host ip addresses. |
|
|
|
|
|
|
Operating system name, without the version. |
|
|
|
|
|
|
Operating system platform (such centos, ubuntu, windows). |
|
|
|
|
|
|
Which commercial OS family (one of: linux, macos, unix, windows, ios or android). |
|
|
|
|
|
|
Operating system version as a raw string. |
|
|
|
|
|
|
Unique identifier of this agent. |
|
|
|
|
|
|
Custom name of the agent. |
|
|
|
|
|
|
Version of the agent. |
|
|
|
|
|
Wazuh cluster name. |
||
|
|
|
|
Wazuh cluster node name. |
||
|
|
|
|
Wazuh schema version. |
wazuh-states-fim-registry-values
Monitored Windows registry values.
Field |
Type |
Level |
Normalization |
Indexed |
Example |
Description |
|---|---|---|---|---|---|---|
|
|
|
|
|
Log message optimized for viewing in a log viewer. |
|
|
|
|
|
SHA1 hash used as checksum of the data collected by the agent. |
||
|
|
|
|
Architecture associated with the entity |
||
|
|
|
|
MD5 hash of the file or registry value content |
||
|
|
|
|
SHA-1 hash of the file or registry value content |
||
|
|
|
|
SHA-256 hash of the file or registry value content |
||
|
|
|
|
|
Standard registry type for encoding contents |
|
|
|
|
|
|
Abbreviated name for the hive. |
|
|
|
|
|
|
Hive-relative path of keys. |
|
|
|
|
|
|
Full path, including hive, key and value |
|
|
|
|
|
Size of the file or registry value (in bytes) |
||
|
|
|
|
|
Name of the value written. |
|
|
|
|
|
Version of the document. |
||
|
|
|
|
Date/time when the state was last modified. |
||
|
|
|
|
|
|
List of groups the agent belongs to. |
|
|
|
|
|
Operating system architecture. |
|
|
|
|
|
Hostname of the host. |
||
|
|
|
|
|
Host ip addresses. |
|
|
|
|
|
|
Operating system name, without the version. |
|
|
|
|
|
|
Operating system platform (such centos, ubuntu, windows). |
|
|
|
|
|
|
Which commercial OS family (one of: linux, macos, unix, windows, ios or android). |
|
|
|
|
|
|
Operating system version as a raw string. |
|
|
|
|
|
|
Unique identifier of this agent. |
|
|
|
|
|
|
Custom name of the agent. |
|
|
|
|
|
|
Version of the agent. |
|
|
|
|
|
Wazuh cluster name. |
||
|
|
|
|
Wazuh cluster node name. |
||
|
|
|
|
Wazuh schema version. |