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

message

keyword

core

true

Hello World

Log message optimized for viewing in a log viewer.

checksum.hash.sha1

keyword

custom

true

SHA1 hash used as checksum of the data collected by the agent.

file.attributes

keyword

extended

array

true

["readonly", "system"]

Array of file attributes.

file.device

keyword

extended

true

sda

Device that is the source of the file.

file.gid

keyword

extended

true

1001

Primary group ID (GID) of the file.

file.group

keyword

extended

true

alice

Primary group name of the file.

file.hash.md5

keyword

extended

true

MD5 hash.

file.hash.sha1

keyword

extended

true

SHA1 hash.

file.hash.sha256

keyword

extended

true

SHA256 hash.

file.inode

keyword

extended

true

256383

Inode representing the file in the filesystem.

file.mtime

date

extended

true

Last time the file content was modified.

file.owner

keyword

extended

true

alice

File owner's username.

file.path

keyword

extended

true

/home/alice/example.png

Full path to the file, including the file name.

file.permissions

keyword

custom

array

true

List of permissions related to the file.

file.size

long

extended

true

16384

File size in bytes.

file.uid

keyword

extended

true

1001

The user ID (UID) or security identifier (SID) of the file owner.

state.document_version

integer

custom

true

Version of the document.

state.modified_at

date

custom

true

Date/time when the state was last modified.

wazuh.agent.groups

keyword

custom

array

true

["group1", "group2"]

List of groups the agent belongs to.

wazuh.agent.host.architecture

keyword

core

true

x86_64

Operating system architecture.

wazuh.agent.host.hostname

keyword

core

true

Hostname of the host.

wazuh.agent.host.ip

ip

core

array

true

Host ip addresses.

wazuh.agent.host.os.name

keyword

extended

true

Mac OS X

Operating system name, without the version.

wazuh.agent.host.os.platform

keyword

extended

true

darwin

Operating system platform (such centos, ubuntu, windows).

wazuh.agent.host.os.type

keyword

extended

true

macos

Which commercial OS family (one of: linux, macos, unix, windows, ios or android).

wazuh.agent.host.os.version

keyword

extended

true

10.14.1

Operating system version as a raw string.

wazuh.agent.id

keyword

core

true

8a4f500d

Unique identifier of this agent.

wazuh.agent.name

keyword

core

true

foo

Custom name of the agent.

wazuh.agent.version

keyword

core

true

6.0.0-rc2

Version of the agent.

wazuh.cluster.name

keyword

custom

true

Wazuh cluster name.

wazuh.cluster.node

keyword

custom

true

Wazuh cluster node name.

wazuh.schema.version

keyword

custom

true

Wazuh schema version.

wazuh-states-fim-registry-keys

Monitored Windows registry keys.

Field

Type

Level

Normalization

Indexed

Example

Description

message

keyword

core

true

Hello World

Log message optimized for viewing in a log viewer.

checksum.hash.sha1

keyword

custom

true

SHA1 hash used as checksum of the data collected by the agent.

registry.architecture

keyword

custom

true

Architecture associated with the entity

registry.gid

keyword

custom

true

Group ID associated with the entity

registry.group

keyword

custom

true

Name of the group that owns the entity

registry.hive

keyword

core

true

HKLM

Abbreviated name for the hive.

registry.key

keyword

core

true

SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\winword.exe

Hive-relative path of keys.

registry.mtime

date

custom

true

Last modified timestamp of the entity

registry.owner

keyword

custom

true

Name of the owner of the entity (user)

registry.path

keyword

core

true

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\winword.exe\Debugger

Full path, including hive, key and value

registry.permissions

keyword

custom

array

true

Permissions associated with the registry key.

registry.uid

keyword

custom

true

User ID associated with the entity

state.document_version

integer

custom

true

Version of the document.

state.modified_at

date

custom

true

Date/time when the state was last modified.

wazuh.agent.groups

keyword

custom

array

true

["group1", "group2"]

List of groups the agent belongs to.

wazuh.agent.host.architecture

keyword

core

true

x86_64

Operating system architecture.

wazuh.agent.host.hostname

keyword

core

true

Hostname of the host.

wazuh.agent.host.ip

ip

core

array

true

Host ip addresses.

wazuh.agent.host.os.name

keyword

extended

true

Mac OS X

Operating system name, without the version.

wazuh.agent.host.os.platform

keyword

extended

true

darwin

Operating system platform (such centos, ubuntu, windows).

wazuh.agent.host.os.type

keyword

extended

true

macos

Which commercial OS family (one of: linux, macos, unix, windows, ios or android).

wazuh.agent.host.os.version

keyword

extended

true

10.14.1

Operating system version as a raw string.

wazuh.agent.id

keyword

core

true

8a4f500d

Unique identifier of this agent.

wazuh.agent.name

keyword

core

true

foo

Custom name of the agent.

wazuh.agent.version

keyword

core

true

6.0.0-rc2

Version of the agent.

wazuh.cluster.name

keyword

custom

true

Wazuh cluster name.

wazuh.cluster.node

keyword

custom

true

Wazuh cluster node name.

wazuh.schema.version

keyword

custom

true

Wazuh schema version.

wazuh-states-fim-registry-values

Monitored Windows registry values.

Field

Type

Level

Normalization

Indexed

Example

Description

message

keyword

core

true

Hello World

Log message optimized for viewing in a log viewer.

checksum.hash.sha1

keyword

custom

true

SHA1 hash used as checksum of the data collected by the agent.

registry.architecture

keyword

custom

true

Architecture associated with the entity

registry.data.hash.md5

keyword

custom

true

MD5 hash of the file or registry value content

registry.data.hash.sha1

keyword

custom

true

SHA-1 hash of the file or registry value content

registry.data.hash.sha256

keyword

custom

true

SHA-256 hash of the file or registry value content

registry.data.type

keyword

core

true

REG_SZ

Standard registry type for encoding contents

registry.hive

keyword

core

true

HKLM

Abbreviated name for the hive.

registry.key

keyword

core

true

SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\winword.exe

Hive-relative path of keys.

registry.path

keyword

core

true

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\winword.exe\Debugger

Full path, including hive, key and value

registry.size

long

custom

true

Size of the file or registry value (in bytes)

registry.value

keyword

core

true

Debugger

Name of the value written.

state.document_version

integer

custom

true

Version of the document.

state.modified_at

date

custom

true

Date/time when the state was last modified.

wazuh.agent.groups

keyword

custom

array

true

["group1", "group2"]

List of groups the agent belongs to.

wazuh.agent.host.architecture

keyword

core

true

x86_64

Operating system architecture.

wazuh.agent.host.hostname

keyword

core

true

Hostname of the host.

wazuh.agent.host.ip

ip

core

array

true

Host ip addresses.

wazuh.agent.host.os.name

keyword

extended

true

Mac OS X

Operating system name, without the version.

wazuh.agent.host.os.platform

keyword

extended

true

darwin

Operating system platform (such centos, ubuntu, windows).

wazuh.agent.host.os.type

keyword

extended

true

macos

Which commercial OS family (one of: linux, macos, unix, windows, ios or android).

wazuh.agent.host.os.version

keyword

extended

true

10.14.1

Operating system version as a raw string.

wazuh.agent.id

keyword

core

true

8a4f500d

Unique identifier of this agent.

wazuh.agent.name

keyword

core

true

foo

Custom name of the agent.

wazuh.agent.version

keyword

core

true

6.0.0-rc2

Version of the agent.

wazuh.cluster.name

keyword

custom

true

Wazuh cluster name.

wazuh.cluster.node

keyword

custom

true

Wazuh cluster node name.

wazuh.schema.version

keyword

custom

true

Wazuh schema version.