Stream Activity Events to Wazuh
Updated
Wire NetBird's Event Streaming → Generic HTTP integration to a Wazuh manager so every audit event and traffic event lands in Wazuh as a searchable alert.
Prerequisites
- A running Wazuh stack (4.14 or later): manager, indexer and dashboard.
- A webhook receiver: a small service you run between NetBird and the Wazuh manager. It needs to:
- serve a public HTTPS endpoint that NetBird Cloud can reach;
- reject every request whose
X-API-Keyheader doesn't carry your shared secret (generate a long random value, for example withopenssl rand -hex 32); - write each event as one JSON line, wrapped in the envelope described under Schema reference, to a file that the Wazuh manager tails through a
<localfile>block with<log_format>json</log_format>.
- Custom Wazuh rules that match those events. The verification steps below use the rule groups
netbird(audit events) andtraffic(traffic events), and the rule IDs shown are examples from a starter ruleset (100100–100106for audit,100200–100202for traffic). Adjust them to your own ruleset. - No other Event Streaming integration enabled on the account. NetBird allows only one enabled integration at a time.
Step 1: Configure NetBird's Generic HTTP integration
- Go to Integrations → Event Streaming, find Generic HTTP and click Connect.
- Fill the General tab:
- Endpoint URL:
https://YOUR-HOSTNAME/events - Authentication: Custom Authentication
- HTTP Header Name & Value:
X-API-Keyin the name field, the shared secret from the prerequisites in the value field
- Endpoint URL:
- Click Continue through Headers and Body Template, leaving both at their defaults.
- Click Connect.

Don't use a custom body template. In testing, NetBird's body-template engine HTML-escapes string values (so + becomes +, mangling ISO-8601 timestamps and URLs with special characters), and there's no JSON-encoding helper for meta. The default body is the right choice for Wazuh.
When you click Connect (or Save Changes on an existing integration), NetBird POSTs a synthetic test event to your endpoint and rejects the change with a 412 if the receiver doesn't return 2xx. A successful save also generates an "integration created" audit event that streams back through the same integration; that's NetBird logging its own configuration change. Subsequent edits produce "integration updated" the same way.
Step 2: Verify in the Wazuh dashboard
Open the Wazuh dashboard, log in, then ☰ → Explore → Discover.
Audit events
Set the index pattern to wazuh-alerts-* and run this KQL:
rule.groups : "netbird" and not data.nb.Message : TYPE_*
Set the time picker to Last 15 minutes and add these columns from the field selector: rule.id, rule.level, rule.description, data.nb.InitiatorID, data.nb.target_id.
You should see one row per audit event (peer add/remove, policy change, group create, etc.) with rule.description reading like NetBird group event: group created.
If data.nb.* doesn't appear in the field selector, the index pattern's field cache is stale. Go to ☰ → Stack Management → Index Patterns → wazuh-alerts-* and click the ↻ Refresh fields icon at the top right, then return to Discover; all data.nb.* fields will appear.
Traffic events
If you've also enabled Traffic Events Logging for one or more groups, switch the KQL to:
rule.groups : "traffic"
Useful columns: rule.id, rule.level, rule.description, data.nb.meta.source_name, data.nb.meta.destination_addr, data.nb.meta.num_of_drops, data.nb.meta.tx_bytes.
Streamed traffic events are aggregated flow records: Message is always TYPE_UNKNOWN, and what happened during the reporting window is in the counters num_of_starts, num_of_ends and num_of_drops (see Streamed event fields). Write traffic rules against those counters, not against Message. The starter ruleset raises any record with dropped attempts to level 7 so denied traffic stands out from normal flow telemetry:
<rule id="100202" level="7">
<if_sid>100200</if_sid>
<field name="nb.meta.num_of_drops" type="pcre2">^[1-9][0-9]*$</field>
<description>NetBird traffic dropped: $(nb.meta.num_of_drops) attempts from $(nb.meta.source_addr) to $(nb.meta.destination_addr)</description>
<group>traffic,</group>
</rule>
Keep type="pcre2": with Wazuh's default rule regex, ^[1-9] does not match, so dropped attempts fall through to the parent rule.
Schema reference
NetBird emits two distinct event shapes through the same integration. Both arrive wrapped in a small envelope so they don't collide with Wazuh's index template:
{
"_stream": "netbird-events",
"received_at": "<receiver-side ISO 8601 timestamp>",
"nb": { "the NetBird payload": "..." }
}
received_at is the receiver's local timestamp at the moment the POST was accepted. Compare it against nb.Timestamp (set by NetBird Cloud) to spot clock skew or buffering delays in the streaming path.
Audit events
{
"ID": 22456950,
"Timestamp": "2026-05-08T12:57:57.00483949Z",
"Message": "integration created",
"InitiatorID": "oauth2|azure-oauth2|<user-uuid>",
"target_id": "event_streaming:1172",
"meta": { "platform": "generic_http" },
"reference": "https://app.netbird.io/activity?id=22456950"
}
- Casing is mixed on the wire:
ID,Timestamp,Message,InitiatorIDare PascalCase;target_id,meta,referenceare snake_case. KQL queries against the indexer are case-sensitive, so match the on-the-wire form exactly:data.nb.Message,data.nb.target_id, etc. IDmay be a number or a string (test events use a string identifier; real audit events use a numeric ID). Wazuh normalises both to strings in the indexeddata.nb.ID, so KQL queries don't need to handle the mixed type.Messageis the most reliable field to pivot rules on; it's a stable English phrase like "peer added" or "policy created".referenceis the canonical URL into NetBird's activity log; useful as a click-through pivot from a Wazuh alert back to the source event.metais event-type-specific. Peer events carrymeta.fqdnandmeta.ip, setup-key events carrymeta.type, integration events carrymeta.platform. Anynameoremailkey is removed before streaming. Treat unknown keys as opaque.
Traffic events
A ping from peer client to peer server, as reported by client:
{
"ID": "<event uuid>",
"Timestamp": "2026-11-06T11:03:49.647637725Z",
"Message": "TYPE_UNKNOWN",
"InitiatorID": "",
"target_id": "",
"reference": "",
"meta": {
"flow_id": "<uuid>",
"reporter_id": "<peer-id-of-client>",
"direction": "EGRESS",
"protocol": 1,
"icmp_type": 8,
"icmp_code": 0,
"source_id": "<peer-id-of-client>",
"source_name": "client",
"source_dns_label": "client",
"source_addr": "100.85.134.48:0",
"source_connection_ip": "203.0.113.10",
"source_geo_city": "Stockholm",
"source_geo_country": "SE",
"source_type": "UNKNOWN",
"destination_id": "<peer-id-of-server>",
"destination_name": "server",
"destination_dns_label": "server",
"destination_addr": "100.85.232.180:0",
"destination_connection_ip": "203.0.113.20",
"destination_geo_city": "Stockholm",
"destination_geo_country": "SE",
"destination_type": "UNKNOWN",
"num_of_starts": 0,
"num_of_ends": 2,
"num_of_drops": 0,
"tx_bytes": 1008,
"tx_packets": 12,
"rx_bytes": 0,
"rx_packets": 0,
"policy_id": "",
"policy_name": "",
"user_id": "",
"received_timestamp": "2026-11-06T11:04:40.54122069Z"
}
}
Traffic events keep the same envelope as audit events: ID and Timestamp are populated; InitiatorID, target_id, and reference are empty (the actor lives in meta.user_id, source and destination identity in meta.source_* and meta.destination_*).
- Each event is one aggregated record from one reporting peer (
reporter_id). Both peers of a connection can report it, so one connection can arrive as anEGRESSrecord from the source and anINGRESSrecord from the destination. source_typeanddestination_typecurrently stream asUNKNOWNfor aggregated records. Use the traffic events API or Dashboard when you need the endpoint type.protocolis an IANA number (1=ICMP,6=TCP,17=UDP,58=ICMPv6).- Volume is an order of magnitude higher than audit events on a busy mesh; size your retention and rate limits accordingly.
Wazuh's JSON decoder strips empty-string and empty-object fields when it extracts events into data.nb.*. Fields shown as "" or {} in the schema examples above (such as policy_name, user_id, an empty meta on some audit events) won't appear in indexed alerts, so KQL queries like data.nb.meta.policy_name : * return zero hits. The original wire payload is preserved in full_log if you ever need the raw form; for queryable fields, filter on a populated one instead.
Next steps
- Monitor the receiver's availability by pointing an external uptime monitor (UptimeRobot, Prometheus blackbox-exporter, etc.) at a health endpoint on your receiver. Generic HTTP retries a failed delivery only twice, a few seconds apart, before dropping the event from the stream (see Delivery), so a receiver that is down for longer loses those events from Wazuh, and external monitoring is the quickest way to notice. An availability check only shows that the receiver is up: it can't detect that events stopped arriving or stopped reaching the Wazuh indexer, so also alert on a gap in
rule.groups : "netbird"alerts.

