# Rootkit detection

> Signs of tampering on each device (known rootkit files, altered binaries, hidden files, processes and ports, interfaces listening to traffic that isn't theirs), raised as alerts.

A rootkit hides itself from the tools you'd use to find it. The sensor looks for the traces it leaves: known rootkit
files, altered system binaries, files hidden in device folders, processes and ports the system hides, and network
interfaces listening to traffic that isn't theirs.

## Before you begin

- **Who:** an administrator of the realm, in a group holding `RealmOwner` or `RealmViewer` on the realm or a realm
  above it (see [Delegated administration](../../../platform/realms/delegated-administration/)). Reading needs no
  more than `RealmViewer`.
- **Where:** the [Security events](../../security-log/events/) API.
- **First:** an enrolled device.

## How it works

The sensor runs its checks on a schedule, set in the [group configuration](../../sensors/group-configuration/), and
reports what it finds. Each finding becomes an alert in the realm's [security events](../../security-log/events/),
in the rule group `rootcheck`. A clean device raises nothing.

## Set it up

Nothing to turn on. Findings appear in the security events. In the API, filter them on the rule group:

```sh
curl "https://foobar.cvyuh.com/api/v0/endpoint/dar/v1/events?from=<RFC 3339 time>&to=<RFC 3339 time>" \
  -H "Cookie: x-cvyuh-token=$CVYUH_SESSION" \
  -H "Content-Type: application/json" \
  -d '{"page": 1, "pageSize": 20, "qbe": {"filter": {"field": "groups", "op": "=", "value": "rootcheck"}}}'
```

## Limits and defaults

| Limit | Default | Can you change it? |
|---|---|---|
| Checks | All of the above | Turn them off or on in the [configuration reference](../../sensors/configuration-reference/#rootkit-detection-rootcheck) |
| Schedule | Set in the group configuration | Yes, `<frequency>` |
| Coverage | Local disks | Container images and network shares aren't covered |

## Good to know

- **A finding is a lead, not a verdict.** A hidden file or port can have an innocent cause; look at the device's
  [file changes](../file-integrity/) around the same time before you act.

## Troubleshooting

| Symptom | Cause | Fix |
|---|---|---|
| No rootkit findings at all | The device is clean, or offline | Check its status in the [device view](../../security-log/device-view/) |

## Audit record

Findings are alerts in the [security log](../../security-log/events/); reading them writes no audit record.

## Related

- [File integrity](../file-integrity/): changes to the same binaries.
- [Handle an alert on a device](../../guides/handle-an-alert/): what you can do about a finding.
