docs/ref/modules/rootcheck/configuration.md
This document describes all configuration options for the rootcheck module.
Rootcheck is configured in the agent's ossec.conf file within the <rootcheck> section:
<rootcheck>
<!-- Configuration options -->
</rootcheck>
disabledEnable or disable the rootcheck module.
| Attribute | Value |
|---|---|
| Type | Boolean |
| Default | no |
| Allowed values | yes, no |
Example:
<rootcheck>
<disabled>no</disabled>
</rootcheck>
frequencyTime interval between rootcheck scans, specified in seconds.
| Attribute | Value |
|---|---|
| Type | Integer |
| Default | 43200 (12 hours) |
| Allowed values | Any positive integer |
Example:
<rootcheck>
<frequency>86400</frequency> <!-- 24 hours -->
</rootcheck>
check_devEnable or disable checking of the /dev directory for suspicious files.
| Attribute | Value |
|---|---|
| Type | Boolean |
| Default | yes |
| Allowed values | yes, no |
| Platform | Unix/Linux only |
The /dev directory should only contain device-specific files. Rootcheck inspects all files in this directory because malware can use this partition to hide files.
Example:
<rootcheck>
<check_dev>yes</check_dev>
</rootcheck>
check_sysEnable or disable checking for anomalous file system objects.
| Attribute | Value |
|---|---|
| Type | Boolean |
| Default | yes |
| Allowed values | yes, no |
Scans the system for unusual files, permissions, and hidden files. Checks include:
Example:
<rootcheck>
<check_sys>yes</check_sys>
</rootcheck>
check_pidsEnable or disable checking for hidden processes.
| Attribute | Value |
|---|---|
| Type | Boolean |
| Default | yes |
| Allowed values | yes, no |
Inspects all process IDs (PIDs) using different system calls to detect processes hidden from standard listing tools like ps.
Example:
<rootcheck>
<check_pids>yes</check_pids>
</rootcheck>
check_portsEnable or disable checking for hidden network ports.
| Attribute | Value |
|---|---|
| Type | Boolean |
| Default | yes |
| Allowed values | yes, no |
Scans for ports not visible in netstat output by attempting to bind to each port.
Example:
<rootcheck>
<check_ports>yes</check_ports>
</rootcheck>
check_ifEnable or disable checking network interfaces for promiscuous mode.
| Attribute | Value |
|---|---|
| Type | Boolean |
| Default | yes |
| Allowed values | yes, no |
Detects network interfaces running in promiscuous mode, which can capture all network traffic and may indicate packet sniffing malware.
Example:
<rootcheck>
<check_if>yes</check_if>
</rootcheck>
skip_nfsEnable or disable scanning of network-mounted filesystems.
| Attribute | Value |
|---|---|
| Type | Boolean |
| Default | yes |
| Allowed values | yes, no |
| Platform | Linux, FreeBSD |
When enabled, rootcheck will skip checking files on CIFS or NFS mounts to avoid performance issues.
Example:
<rootcheck>
<skip_nfs>yes</skip_nfs>
</rootcheck>
base_directoryBase directory that will be prefixed to the /dev directory scan.
| Attribute | Value |
|---|---|
| Type | String (path) |
| Default (Unix) | / |
| Default (Windows) | C:\ |
| Allowed values | Any valid directory path |
Note: In Wazuh 5.0, this option only affects
/devdirectory scanning since file check and trojan scan features have been removed.
Example:
<rootcheck>
<base_directory>/</base_directory>
</rootcheck>
ignoreList of files or directories to ignore during scans (one entry per line).
| Attribute | Value |
|---|---|
| Type | String (regex) |
| Allowed values | Simple regex (sregex) |
| Valid for | check_sys, check_dev |
Attributes:
type="sregex": Simple regex expressionExample:
<rootcheck>
<ignore type="sregex">^/etc/mtab$</ignore>
<ignore type="sregex">^/etc/hosts.deny$</ignore>
<ignore type="sregex">^/etc/mail/statistics$</ignore>
<ignore type="sregex">^/etc/random-seed$</ignore>
</rootcheck>
The following options existed in previous versions but no longer have any effect in Wazuh 5.0:
scanallDeprecated in 5.0: This option was used for comprehensive rootkit file scanning, which has been removed.
readallDeprecated in 5.0: This option controlled whether rootcheck would read all system files to compare bytes read with file size, which has been removed.
<rootcheck>
<disabled>no</disabled>
<!-- Detection options -->
<check_dev>yes</check_dev>
<check_sys>yes</check_sys>
<check_pids>yes</check_pids>
<check_ports>yes</check_ports>
<check_if>yes</check_if>
<!-- Scan every 12 hours -->
<frequency>43200</frequency>
<!-- Skip network filesystems -->
<skip_nfs>yes</skip_nfs>
<!-- Ignore specific paths -->
<ignore type="sregex">^/etc/mtab$</ignore>
<ignore type="sregex">^/etc/hosts.deny$</ignore>
</rootcheck>
<rootcheck>
<disabled>no</disabled>
<frequency>43200</frequency>
</rootcheck>
For environments requiring more frequent checks:
<rootcheck>
<disabled>no</disabled>
<check_dev>yes</check_dev>
<check_sys>yes</check_sys>
<check_pids>yes</check_pids>
<check_ports>yes</check_ports>
<check_if>yes</check_if>
<!-- Scan every 6 hours -->
<frequency>21600</frequency>
<skip_nfs>yes</skip_nfs>
</rootcheck>
Enable only specific detection types:
<rootcheck>
<disabled>no</disabled>
<!-- Only check for hidden processes and ports -->
<check_dev>no</check_dev>
<check_sys>no</check_sys>
<check_pids>yes</check_pids>
<check_ports>yes</check_ports>
<check_if>no</check_if>
<frequency>43200</frequency>
</rootcheck>
Rootcheck scans can be resource-intensive. Consider your system's capabilities when setting the frequency.
skip_nfs enabled to avoid performance issuesCheck if rootcheck is enabled:
grep -A 5 "<rootcheck>" /var/ossec/etc/ossec.conf
Check logs for errors:
grep rootcheck /var/ossec/logs/ossec.log
/var/ossec/bin/wazuh-control restart
Use the <ignore> option to exclude known benign files or directories:
<rootcheck>
<ignore type="sregex">/path/to/benign/file</ignore>
</rootcheck>
skip_nfs if not already enabled