# Configuration reference

> Every setting the realm's shared sensor configuration takes (folders to watch, logs to read, assessment and tamper-check schedules), what each does, and what is refused.

The realm's [group configuration](../group-configuration/) is one text, in XML, that every sensor in the realm runs
on top of its own defaults. This page lists what you can put in it: the folders file integrity watches, the logs
the sensor reads, and when assessments and tamper checks run. Anything not listed here is refused or has no effect
you can rely on.

## Before you begin

- **Who:** an administrator of the realm, in a group holding `RealmOwner` (or `RealmViewer`, which today can write it
  too; see [Group configuration](../group-configuration/#before-you-begin)).
- **Where:** the API, as [Group configuration](../group-configuration/) shows.
- **First:** read the configuration as it is, so you can add to it rather than replace it.

## The shape

The text is one or more `<agent_config>` blocks. Each block holds sections, and every section is optional. Blocks
are read in order, so you can keep each change in a block of its own, and remove it later by removing the block.

```xml
<agent_config>
  <syscheck>
    <directories realtime="yes" check_all="yes">/opt/billing/config</directories>
  </syscheck>
  <localfile>
    <location>/var/log/billing/app.log</location>
    <log_format>syslog</log_format>
  </localfile>
</agent_config>
```

A new realm's configuration is empty: every device runs its defaults (see [File integrity](../../detection/file-integrity/),
[Log collection](../../detection/log-collection/)) until you add to them.

## File integrity: `<syscheck>`

| Setting | Takes | What it does |
|---|---|---|
| `<directories>` | Folders, comma-separated, or one per element | Adds the folders to those the sensor watches, with everything below them |
| `realtime="yes"` (on `<directories>`) | `yes` or `no` | Reports a change in those folders as it happens, instead of at the next scan |
| `check_all="yes"` (on `<directories>`) | `yes` or `no` | Records every checksum, the owner, the group, the permissions, the size and the time of each file |
| `report_changes="yes"` (on `<directories>`) | `yes` or `no` | For text files, adds what changed in the file's content to the alert (`file.diff`) |
| `<ignore>` | A path | Leaves the file or folder out of what's watched |
| `<frequency>` | Seconds | How often the full scan runs; changes outside real-time folders surface at the next one |
| `<scan_on_start>` | `yes` or `no` | Whether a scan runs when the sensor starts |

## Logs: `<localfile>`

One `<localfile>` per log to read.

| Setting | Takes | What it does |
|---|---|---|
| `<location>` | A file path; `*` matches any part of a name | The log file to read |
| `<log_format>` | `syslog` (one event per line), `json` (one JSON object per line), `journald` (the Linux system journal; `<location>` is `journald`) | How each event in the log is read |

A log read from a command's output is refused (see below).

## Configuration assessment: `<sca>`

| Setting | Takes | What it does |
|---|---|---|
| `<enabled>` | `yes` or `no` | Turns assessment on or off |
| `<interval>` | A time, such as `12h` or `1d` | How often the device's policies are checked |
| `<scan_on_start>` | `yes` or `no` | Whether a check runs when the sensor starts |

## Rootkit detection: `<rootcheck>`

| Setting | Takes | What it does |
|---|---|---|
| `<disabled>` | `yes` or `no` | Turns the checks off or on |
| `<frequency>` | Seconds | How often the checks run |

## What is refused

A write is checked before it goes anywhere, and refused with `400` and the reason:

| Refused | Why |
|---|---|
| A `<command>` or `<full_command>` element, anywhere | It would run a command on your devices |
| A `<log_format>` of `command` or `full_command` | It would read a log from a command's output |
| A module that runs commands | Same |
| A tag, comment or section left open | The rest of the text can't be read |
| A setting the sensor doesn't know, or a value it can't take | The answer names it and its line |
| More than 512 KB of text | Answered `413` |

## How a change reaches a device

When you save, each connected device receives the new configuration over its own connection, checks it, applies it
and restarts its sensor; this usually takes a minute or two. A device that is offline gets it when it reconnects.
To see what one device runs now, read its running configuration (see [Device view](../../security-log/device-view/)).

## Limits and defaults

| Limit | Value |
|---|---|
| Size of the configuration | 512 KB |
| Time for a change to reach a connected device | Usually under two minutes |
| Configurations per realm | One, shared by every device in the realm |

## Troubleshooting

| Symptom | Cause | Fix |
|---|---|---|
| `400` naming a line | A setting or value the sensor doesn't take | Fix the line the answer names, or remove it |
| `400` "can't run commands" | A command, or a log read from a command | Remove it; there's no way to run a command on a device from the realm |
| `412` | Someone saved since you read it | Read it again, redo your change, and save with the new `revision` |
| A folder isn't in a device's running configuration | The device hasn't received the change, or is offline | Check the device is `active`; restart its sensor (see [Sensor actions](../sensor-actions/)) |
| A real-time folder reports only at scans | The folder didn't exist on the device when the sensor started | Create the folder, then restart the sensor |

## Audit record

None yet. A configuration write isn't recorded in the realm's audit trail; keep the text you replaced (as
[Watch another folder on your devices](../../guides/watch-another-folder/) does) so you can put it back.

## Related

- [Group configuration](../group-configuration/): reading and writing the configuration.
- [Watch another folder on your devices](../../guides/watch-another-folder/): a change, start to finish.
- [File integrity](../../detection/file-integrity/): what's watched by default.
