# Forwarding to a SIEM

Source: https://docs.neode.sk/operations/siem-forwarding/
Last updated: 2026-12-03

> Send the audit log and every sign-in to a SIEM or log server over syslog with TLS, TCP or UDP, as JSON or CEF, and set up rsyslog to receive them.

NeoDesk sends every entry of the console's audit log and every sign-in to a
SIEM or log server as syslog messages, over TLS, TCP or UDP. Each message
carries the entry's place in the audit log's
[hash chain](https://docs.neode.sk/console/activity.md#hash-chain): its chain number, its own hash
and the hash of the entry before it. The copy in the SIEM is out of reach of
anyone who can change NeoDesk's database, so it is the witness when an entry
in NeoDesk was rewritten.

You set it up on the **Forwarding** tab of the audit log, or with the
`neodesk` command line. Both need permission to change the server's
configuration, which Super admin and Server admin accounts have by default.

## What goes out

Every audit entry becomes one event, in the order of the audit log. Sign-in
steps become `signin.*` events, every other entry an `audit.entry`:

| Event | When |
|---|---|
| `audit.entry` | Every audit entry that is no sign-in step: changes to devices, people and settings, approvals, bans, sessions and the rest |
| `signin.succeeded` | Someone signed in |
| `signin.failed` | A sign-in failed: wrong name or password, or a banned device |
| `signin.blocked` | A sign-in was refused because the account or the address is locked out |
| `signin.locked_out` | The failed sign-in that reached the limit and started the lockout |
| `signin.second_factor_required` | The password was right and the second factor is asked for |
| `signin.second_factor_failed` | The second factor was wrong or couldn't be checked |

The sign-ins are those in the console with a password, LDAP, OIDC, SAML or a
passkey, the account sign-in of the RustDesk client and NeoDesk Desktop, and
NeoDesk Desktop's operator sign-in.

The entry goes out as the audit log stores it: passwords, secrets, tokens and
keys in the details are already three stars, and the name of a failed
sign-in is shortened to its first and last letter, so `jane.doe` reads
`j***e`.

A target gets the entries written after it was added. Older entries stay in
NeoDesk. Targets limited to an organization or a device group get no audit
entries and no sign-ins, since these belong to the whole server. With several
NeoDesk servers on one database, one of them sends the entries, and each entry
goes out once.

The other events of NeoDesk, such as `alert.raised` or `device.offline`, can
go to a syslog target too. `neodesk integrations events` lists them all.
Webhooks can subscribe to the audit and sign-in events like to any other
event; see [neodesk integrations](https://docs.neode.sk/command-line/reference/integrations.md).

## The syslog target

A syslog target is a receiver's address, the format of the messages and the
events it gets. The address picks the transport:

| Address | Transport |
|---|---|
| `tls://<host>:6514` | TCP with TLS (RFC 5425). Without a port: 6514 |
| `tcp://<host>:514` | Plain TCP, each message with its length in front (octet counting, RFC 6587). Without a port: 514 |
| `udp://<host>:514` | UDP, one message per datagram (RFC 5426). Without a port: 514 |

Use TLS when the messages cross a network you don't control. NeoDesk checks
the receiver's certificate against the system's certificates, or against
**CA certificates** when you give some, and wants TLS 1.2 or newer. It sends
no client certificate of its own.

UDP can't tell whether a message arrived: a message counts as delivered when
it was sent, and one longer than 65,000 bytes is given up.

The host is a name or an IP address. Addresses in private ranges are fine.
Loopback, link-local, multicast and cloud metadata addresses are refused, so a
receiver on the NeoDesk server itself needs the machine's network address, not
`127.0.0.1` or `localhost`.

### Settings

| Setting | Key | Default | What it does |
|---|---|---|---|
| **Format** | `format` | `json` | `json` or `cef`, see below |
| **Facility** | `facility` | `13` (log audit) | The syslog facility, 0 to 23 |
| **App name** | `app_name` | `neodesk` | The APP-NAME field, at most 48 characters without spaces |
| **Host name** | `hostname` | the console's name (Branding) | The HOSTNAME field, at most 255 characters; spaces become `_` |
| **CA certificates** | `ca_pem` | The system's certificates | PEM certificates the receiver's certificate must chain to. TLS only |
| **Certificate name** | `tls_server_name` | The address's host | The name the receiver's certificate must carry. TLS only |

### The message

Every message has an RFC 5424 header and the event after it:

```text quoted
<PRI>1 <time> <host-name> <app-name> - <event-type> - <message>
```

- `PRI` is the facility times 8 plus the severity: 4 (warning) for
  `signin.locked_out`, `signin.blocked` and `alert.raised`, 5 (notice) for
  `signin.failed` and `signin.second_factor_failed`, 6 (informational) for
  the rest. With the default facility, a failed sign-in is `<109>`.
- The time is when the event happened, in UTC with six decimals of the
  second, as RFC 5424 allows. For an audit entry it is the entry's time.
- The message ID is the event type, so a receiver can filter on it without
  reading the message. There is no structured data.

## JSON

With **Format** JSON, the message is the same JSON object a webhook gets:
`version`, `delivery_id`, `event` and `server`. The event's `data.audit` holds
the entry; for sign-ins, `data.signin` says how it happened:

| Field | What it holds |
|---|---|
| `data.audit.id` | The entry's ID in the audit log |
| `data.audit.seq` | Its chain number |
| `data.audit.hash` | Its hash |
| `data.audit.prev_hash` | The hash of the entry before it |
| `data.audit.action` | The action, such as `login_failed` or `user_created` |
| `data.audit.details` | The details, masked as stored |
| `data.audit.ip_address` | The address the request came from |
| `data.audit.created_at` | When the entry was written, in UTC with microseconds, as the hash chain holds it |
| `data.audit.user_id`, `username` | The account that acted, when there is one |
| `data.audit.target_user_id`, `target_username` | The account it was about, when there is one |
| `data.signin.method` | `password`, `ldap`, `oidc`, `saml` or `passkey` |
| `data.signin.second_factor` | `totp`, `recovery` or `passkey`, when a second factor was given or failed |
| `data.signin.channel` | `console`, `client` (the account sign-in of the RustDesk client and NeoDesk Desktop) or `operator` (NeoDesk Desktop's operator sign-in) |

`event.id` is the same for every target; `delivery_id` is each target's own.
A failed sign-in as it reached the receiver, all on one line:

```text quoted
<109>1 2026-11-29T22:18:31.000000Z NeoDesk neodesk - signin.failed - {"version":1,"delivery_id":"dlv_01a22963-6ea6-7986-903f-8a42c90726ef","event":{"id":"evt_01a22963-6e77-713d-8bc1-27497d559046","type":"signin.failed","occurred_at":"2026-11-29T22:18:31.000Z","subject":"Sign-in failed","link":"https://desk.example.com/security-audit","data":{"audit":{"action":"login_failed","created_at":"2026-11-29T22:18:31.000000Z","details":"Username: j***e; ip=172.24.0.11; ua=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0","hash":"13a0eb83bce78bf019c9e6a1c919b821843359011050ad554433eb5bd033e22f","id":119,"ip_address":"172.24.0.11","prev_hash":"dfc4cc410b035ce0a0b6c41ccca77659c8f55dbdd930c94f9d1893e5a8221823","seq":119,"target_user_id":null,"user_id":null},"signin":{"channel":"console","method":"password"}}},"server":{"name":"NeoDesk","url":"https://desk.example.com"}}
```

## CEF

With **Format** CEF, the message is a line of the Common Event Format, which
ArcSight, QRadar and other SIEMs read:

```text quoted
CEF:0|NeoDesk|NeoDesk Server|<version>|<event-type>|<subject>|<severity>|<extension>
```

The severity is 7 for the warnings, 5 for the notices and 3 for the rest. The
extension has these keys, each only when it has a value:

| Key | What it holds |
|---|---|
| `rt` | When the event happened, in milliseconds since 1970 |
| `externalId` | The event's ID |
| `act` | The audit action |
| `suser`, `suid` | The account that acted, its name and ID |
| `duser`, `duid` | The account it was about, its name and ID |
| `src` | The address the request came from |
| `msg` | The details, masked as stored |
| `cn1` (`chainSeq`) | The chain number |
| `cs1` (`entryHash`) | The entry's hash |
| `cs2` (`prevHash`) | The hash of the entry before it |
| `cs3` (`signInMethod`) | How someone signed in, for sign-ins |
| `cs5` (`secondFactor`) | The second factor, for sign-ins that had one |
| `cs6` (`channel`) | `console`, `client` or `operator`, for sign-ins |
| `outcome` | `success` or `failure`, for sign-ins |
| `request` | The console page the event leads to |
| `cs4` (`deviceId`), `dhost` | The device, for device events |

Each custom field comes with its label, such as `cn1Label=chainSeq`. A new
account, as it reached the receiver:

```text quoted
<110>1 2026-11-29T22:18:50.000000Z NeoDesk neodesk - audit.entry - CEF:0|NeoDesk|NeoDesk Server|4.0.0-rc.2|audit.entry|user_created|3|rt=1795990730000 externalId=evt_01a22963-b811-7b62-ba2f-9342641ed97f act=user_created suser=admin suid=1 duser=jane.doe duid=13 src=127.0.0.1 msg=Created user: jane.doe (operator) cn1Label=chainSeq cn1=122 cs1Label=entryHash cs1=57e05afcc0a89ab7029f7808ae5c2d38c91a63109fad710d395d0125e44c817d cs2Label=prevHash cs2=3e46be4e4b00115a24cb8f4acecf2c70f88bd42a2183339ba40b02fd1ac19474 request=https://desk.example.com/security-audit
```

## Order and catch-up

Each target gets its events one after the other, in the order they happened.
NeoDesk tries only the oldest event a target hasn't taken yet; the ones after
it wait. When the receiver is down, NeoDesk tries again, waiting longer each
time up to 5 minutes, and once the receiver is back it gets everything it
missed, in order. An event that couldn't be delivered for 30 days is given up,
and the next one goes.

A syslog target isn't switched off when deliveries fail. Its state on the
**Forwarding** tab says since when it fails, and the delivery log lists each
message with its result.

Over TCP and TLS, a message counts as delivered once NeoDesk has written it to
the connection. A receiver that closed the connection is noticed before the
next message, and the message goes again on a new connection.

## In the console

Open **Activity**, **Audit log**, then the **Forwarding** tab. It has three
parts: **Retention** and **Hash chain**, which the
[Activity page](https://docs.neode.sk/console/activity.md#forwarding) explains, and
**SIEM targets**.

![The Forwarding tab: the audit log kept for 365 days, a whole hash chain with the last entry's number and hash, and SIEM targets over TLS, TCP and UDP](https://docs.neode.sk/shots/audit-forwarding-light.png)

**SIEM targets** lists each target with **Name**, **Address**, **Format** and
**State**. **Add target** opens the form:

- **Name**: shown in the list.
- **Address**: **Transport** (**TLS (encrypted)**, **TCP** or **UDP**),
  **Host** and **Port**. Pasting a whole address such as
  `tls://siem.example.com:6514` into **Host** splits it up.
- **Format**: **JSON (the whole event)** or **CEF (Common Event Format)**.
- **Events**: **Audit log**, **Sign-ins** and **Other events**. A new target
  has the audit log and all sign-ins ticked.
- **More**: **Facility**, **App name**, **Host name**, and for TLS
  **CA certificates** and **Certificate name**.

Each target's menu has **Test**, which sends a test message at once, edit,
**Switch off** or **Switch on**, **Delivery log** with the last 50 messages,
and delete. Over UDP the test can only say that the message was sent; check
on the receiver that it arrived.

## With the command line

```bash
neodesk integrations create -f kind=syslog -f name=SIEM -f url=tls://<receiver-host>:6514 -F 'events=["audit.entry","signin.succeeded","signin.failed","signin.blocked","signin.locked_out","signin.second_factor_required","signin.second_factor_failed"]' -F 'settings={"format":"cef"}'
```

Put the receiver's host name in place of `<receiver-host>`. The answer shows
the target with its `id`. With it:

```bash
neodesk integrations test <id>
neodesk integrations deliveries <id> --limit 20
neodesk integrations update <id> -F 'settings={"format":"json"}'
neodesk integrations update <id> -F enabled=false
```

Put the target's ID in place of `<id>`. `neodesk integrations list` lists the
targets. A CA certificate is easier to give from a file, as in the example
below.

## Example: rsyslog over TLS

rsyslog receives the events over TLS and writes each one as a line of JSON to
`/var/log/neodesk/events.jsonl`. This ran on Debian 12 with rsyslog 8.2302.
The receiver's host name goes in place of `<receiver-host>` below; the NeoDesk
server must reach it on port 6514.

### On the receiver

Install rsyslog with its TLS driver:

```bash
sudo apt install rsyslog rsyslog-gnutls
```

Make a certificate for the receiver. When it already has one from a
certificate authority the NeoDesk server trusts, use that instead and leave
**CA certificates** empty later. Otherwise make your own small certificate
authority and sign the receiver's certificate with it:

```bash
sudo mkdir -p /etc/rsyslog.d/tls
cd /etc/rsyslog.d/tls
sudo openssl req -x509 -newkey rsa:3072 -nodes -days 3650 -subj "/CN=SIEM CA" -keyout ca-key.pem -out ca.pem
sudo openssl req -newkey rsa:3072 -nodes -subj "/CN=<receiver-host>" -keyout siem-key.pem -out siem.csr
printf 'subjectAltName = DNS:%s\n' '<receiver-host>' | sudo tee siem.ext
sudo openssl x509 -req -in siem.csr -CA ca.pem -CAkey ca-key.pem -CAcreateserial -days 825 -extfile siem.ext -out siem.pem
```

Put the receiver's host name in place of `<receiver-host>`, both times. NeoDesk
checks the name in the certificate's subject alternative names, which the
last two lines add. Keep `ca-key.pem` safe or move it off the machine: with it,
anyone can make certificates NeoDesk trusts.

Save this as `/etc/rsyslog.d/neodesk.conf`:

```conf
# Receive NeoDesk's events over TLS on port 6514
global(
  DefaultNetstreamDriver="gtls"
  DefaultNetstreamDriverCAFile="/etc/rsyslog.d/tls/ca.pem"
  DefaultNetstreamDriverCertFile="/etc/rsyslog.d/tls/siem.pem"
  DefaultNetstreamDriverKeyFile="/etc/rsyslog.d/tls/siem-key.pem"
  maxMessageSize="64k"
)

module(load="imtcp" StreamDriver.Name="gtls" StreamDriver.Mode="1" StreamDriver.AuthMode="anon")
input(type="imtcp" port="6514" ruleset="neodesk")

# One JSON payload per line
template(name="neodesk-json" type="string" string="%msg%\n")

ruleset(name="neodesk") {
  action(type="omfile" file="/var/log/neodesk/events.jsonl" template="neodesk-json")
}
```

`StreamDriver.Mode="1"` makes the port TLS only, and `AuthMode="anon"` lets
clients in without a certificate of their own, as NeoDesk sends none. Allow
port 6514 in the receiver's firewall only from the NeoDesk server's address.
The ruleset keeps NeoDesk's messages out of the machine's own logs, and
`maxMessageSize` makes room for entries with long details. Check the
configuration and restart rsyslog:

```bash
sudo mkdir -p /var/log/neodesk
sudo rsyslogd -N1
sudo systemctl restart rsyslog
```

### In NeoDesk

On the **Forwarding** tab, **Add target**: **TLS (encrypted)**, the
receiver's host name, port 6514, **JSON (the whole event)**, and under
**More**, the content of `ca.pem` in **CA certificates**. Then **Test**.

With the command line, write the target to a file first. `jq` puts the
certificate into the JSON:

```bash
jq -n --rawfile ca ca.pem '{kind: "syslog", name: "SIEM", url: "tls://<receiver-host>:6514", events: ["audit.entry", "signin.succeeded", "signin.failed", "signin.blocked", "signin.locked_out", "signin.second_factor_required", "signin.second_factor_failed"], settings: {format: "json", ca_pem: $ca}}' > siem-target.json
neodesk integrations create --data @siem-target.json
neodesk integrations test <id>
```

Put the receiver's host name in place of `<receiver-host>`, and the `id` from
the answer of the create command in place of `<id>`. The test answers with
the delivery:

```text quoted
attempts: 1
created_at: 29 Nov 2026, 23:27 CET
duration_ms: 0 secs
event_id: evt_01a2296c-0bc3-7094-81a9-7ceea2272d47
event_type: webhook.test
id: dlv_01a2296c-0bf6-7b95-b5a8-9450a23c352a
last_error:
last_status: 0
next_attempt_at: -
response_excerpt:
sink: endpoints
status: succeeded
target_id: db59dab7-1f37-4e4b-b76b-9ec0b0ef5b30
updated_at: 29 Nov 2026, 23:27 CET
```

`status: succeeded` means the receiver took the message over TLS.

### Check that it arrived

On the receiver, list the newest events:

```bash
sudo jq -r '[.event.occurred_at, .event.type, (.event.data.audit.username // "-"), .event.subject] | @tsv' /var/log/neodesk/events.jsonl | tail -n 5
```

After the test and a sign-in:

```text quoted
2026-11-29T22:25:08.233Z	webhook.test	-	Test from NeoDesk
2026-11-29T22:25:08.000Z	audit.entry	admin	integration_tested
2026-11-29T22:25:08.000Z	audit.entry	admin	api_token_write
2026-11-29T22:25:11.000Z	signin.succeeded	admin	Signed in
2026-11-29T22:25:11.000Z	audit.entry	admin	session_replaced
```

One whole event, a failed sign-in:

```bash
sudo tail -n 1 /var/log/neodesk/events.jsonl | jq .
```

```json quoted
{
  "version": 1,
  "delivery_id": "dlv_01a22963-6e9c-72b0-8482-630ff3efd804",
  "event": {
    "id": "evt_01a22963-6e77-713d-8bc1-27497d559046",
    "type": "signin.failed",
    "occurred_at": "2026-11-29T22:18:31.000Z",
    "subject": "Sign-in failed",
    "link": "https://desk.example.com/security-audit",
    "data": {
      "audit": {
        "action": "login_failed",
        "created_at": "2026-11-29T22:18:31.000000Z",
        "details": "Username: j***e; ip=172.24.0.11; ua=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0",
        "hash": "13a0eb83bce78bf019c9e6a1c919b821843359011050ad554433eb5bd033e22f",
        "id": 119,
        "ip_address": "172.24.0.11",
        "prev_hash": "dfc4cc410b035ce0a0b6c41ccca77659c8f55dbdd930c94f9d1893e5a8221823",
        "seq": 119,
        "target_user_id": null,
        "user_id": null
      },
      "signin": {
        "channel": "console",
        "method": "password"
      }
    }
  },
  "server": {
    "name": "NeoDesk",
    "url": "https://desk.example.com"
  }
}
```

The chain numbers in the file follow each other without a gap. When rsyslog
was stopped in the same run, NeoDesk kept the events that came in meanwhile
and sent them, in order, within 20 seconds of rsyslog coming back.

When nothing arrives, the delivery log on the **Forwarding** tab, or
`neodesk integrations deliveries <id>`, shows the error of the last attempt,
such as a refused connection or a certificate NeoDesk doesn't trust.
