# Zeek on a Raspberry Pi: how to build a network sensor for Wazuh

How to build our open-source Zeek Pi node: the hardware, the operating system, installing Zeek and the Wazuh agent, joining it to a Wazuh cluster, and what it reports when the network it watches is an industrial one.

By Peter Bassill · Guide · Published 2026-12-05 · Last changed 2026-12-05

A security operations centre can only watch what sends it logs. Laptops and servers run agents; a programmable logic controller, a building management controller or a ten-year-old switch does not. The way to see what those devices are doing is to watch the network they sit on, and for a branch office, a vessel, a site office or a small plant a rack server is out of proportion to the job. So we built a network sensor on a Raspberry Pi. It runs Zeek, reports to Wazuh through an ordinary Wazuh agent, and the whole build is public and free to use at [github.com/UK-Cyber-Defence/wazuh-zeek-pinode](https://github.com/UK-Cyber-Defence/wazuh-zeek-pinode).

This guide covers what the sensor is, how to build the Pi, how to install Zeek and the agent, how to join it to a Wazuh cluster, and what it reports when the network it watches is an industrial one. The examples of alerts come from a test bench, described below, and use a demonstration organisation.

## What the Zeek Pi node is

Zeek is an open-source network security monitoring framework. It blocks nothing. It reads traffic and writes a structured record of what happened: connections, DNS lookups, web requests, TLS handshakes, file transfers and more. The Pi node puts Zeek 9.0 on a Raspberry Pi, adds our own Zeek scripts for scans, DNS tunnelling and threat intelligence, and installs a Wazuh agent that forwards a selection of Zeek's logs to the Wazuh managers. The Zeek rules in [our public Wazuh ruleset](https://www.cyber-defence.io/services/wazuh-consulting/wazuh-support/open-source) turn those records into alerts.

*[Image: Diagram: how the Zeek Pi node works in six steps, from a switch mirror port through Zeek and the Wazuh agent to an alert]*

*How the sensor works. The capture port takes no address, so the Pi can hear the network it watches but cannot be reached from it.*

Three decisions shape the design. The sensor is passive: the Pi's built-in Ethernet port receives a copy of the traffic from a switch's mirror port or a network TAP and never has an address, so nothing on the watched network can talk to it. It is installed directly on the Pi, with no containers. And it sends Wazuh only what the rules use, while the full Zeek logs stay on the Pi, compressed, for seven days by default.

## What you need

| Item | What the repository recommends |
|---|---|
| Raspberry Pi | A Pi 5 with 8 GB. A Pi 5 with 4 GB or a Pi 4 with 4 GB suits quieter networks, and 2 GB is the minimum |
| Power supply | The official one for the model. An under-powered Pi slows itself down and drops packets |
| Cooling | The Active Cooler on a Pi 5, or a fan or heatsink case on a Pi 4. Zeek keeps one core busy all the time |
| Storage | An NVMe or USB 3 SSD of 128 GB or more. A microSD card works for a trial but wears out |
| Management connection | A USB 3 Gigabit Ethernet adapter, or the Pi's Wi-Fi, because the built-in port becomes the capture port |
| Traffic source | A managed switch with port mirroring, or a network TAP |
| Another computer | With Raspberry Pi Imager and an SSH client |

As planning figures, the README suggests a Pi 4 for sustained traffic up to about 100 Mbit/s and a Pi 5 up to about 250 Mbit/s with the default settings. They are starting points, not limits. The sensor measures its own packet loss and raises an alert in Wazuh if it cannot keep up, and that is the figure to trust on a particular network.

## Build the Pi

*[Image: Diagram: eight steps to build the Zeek Pi node, from hardware and operating system to installing and checking it]*

*The build in eight steps. The first five prepare the Pi and the network; the last three install the sensor and prove it works.*

### Write the operating system

The sensor runs on a 64-bit operating system only: Raspberry Pi OS Lite (64-bit), based on Debian 13, or Ubuntu Server 26.04 LTS (64-bit). In Raspberry Pi Imager, choose the Pi model, the operating system and the SSD, and accept the offer to customise the image. Set the hostname to the sensor's name, for example `zeek-otyhea-01`, because it becomes the Wazuh agent's name. Create an administrator account that is not called `pi`, set the time zone to `Etc/UTC`, and enable SSH with public-key authentication only.

### First boot and updates

Connect the Pi to a network where it can get an address, log in over SSH, and bring it up to date. On Raspberry Pi OS, update the firmware as well.

```bash
sudo apt update && sudo apt full-upgrade -y
sudo rpi-eeprom-update -a        # Raspberry Pi OS only
sudo reboot
```

### Set up the management connection

The built-in port, `eth0`, is going to be the capture port, so the Pi needs a second connection for SSH and for reporting to Wazuh. With Wi-Fi set in Imager, that is already done once `eth0` is unplugged. A USB Ethernet adapter on Raspberry Pi OS is configured automatically. On Ubuntu Server the repository includes an example netplan file to copy and edit. Whichever you use, confirm that the Pi's default route no longer goes through `eth0`:

```bash
ip route show default            # must not mention eth0
```

The installer refuses to use an interface for capture while it carries the default route, because doing so would cut you off from the Pi.

### Mirror the traffic to the Pi

Connect `eth0` to the switch port that will receive the mirrored traffic, or to the monitor port of a TAP. On the switch, mirror the port that carries the traffic you want to watch, in both directions. That is normally the uplink to the firewall or router, which sees everything entering and leaving the site. On a Cisco IOS switch the commands look like this:

```
monitor session 1 source interface GigabitEthernet1/0/1 both
monitor session 1 destination interface GigabitEthernet1/0/24
```

Most managed switches call the setting port mirroring or a monitor port. Mirror no more than the Pi can analyse: one uplink, not the whole switch.

## Install Zeek and the Wazuh agent

Clone the repository on the Pi and run the installer. The first run checks the Pi, writes an example configuration file and stops so that you can fill it in.

```bash
sudo apt install -y git
git clone https://github.com/UK-Cyber-Defence/wazuh-zeek-pinode.git
cd wazuh-zeek-pinode
sudo ./install.sh
sudo nano /etc/zeek-pinode/zeek-pinode.conf
```

Three settings matter most. `ZEEK_INTERFACES` is the capture interface, normally `eth0`. `ZEEK_LOCAL_NETS` lists the site's internal address ranges, which Zeek uses to tell inbound traffic from outbound, and the rules depend on it being right. `ZEEK_CLIENT` is a short code for the organisation that is added to every record. A fourth, `WAZUH_MANAGER`, points at our managers by default: if you run your own Wazuh, set it to your manager or its load balancer.

Store the enrolment password in its own file, readable by root alone, and run the installer again:

```bash
sudo install -m 0600 /dev/null /etc/zeek-pinode/wazuh-registration.pass
sudo nano /etc/zeek-pinode/wazuh-registration.pass        # paste the password, save
sudo ./install.sh --firewall 192.168.1.0/24 --watchdog
sudo reboot
```

`--firewall` takes the management network's range and closes every inbound port except SSH from that range. `--watchdog` makes the Pi restart itself if it ever hangs. On the second run the installer does the real work:

- It checks the Pi model, operating system, memory, storage and network time, and refuses a 32-bit system.
- It tells the operating system to leave the capture interface without an address.
- It adds the Zeek and Wazuh package repositories, each trusted only through a signing key whose fingerprint is fixed in the script.
- It installs Zeek 9.0 and the Wazuh agent, holding the agent at the managers' version so that an automatic update cannot make it newer than they are.
- It creates a `zeek` user, installs the sensor's scripts and systemd services, writes the Zeek and agent configuration, and starts both.

Zeek never runs as root. It runs as the `zeek` user with only the two Linux capabilities that packet capture needs, inside a systemd sandbox. The agent refuses remote commands and has active response disabled, so nothing on the Pi can be run from a manager.

## Join it to the Wazuh cluster

The agent enrols itself during installation, so joining the cluster is mostly a matter of preparing the manager side first. Three things have to be in place.

**An agent group.** By default the sensor asks to join the group `Linux_<code>`, where the code is the value of `ZEEK_CLIENT`. The group must exist or enrolment fails. Create it on the master node:

```bash
sudo /var/ossec/bin/agent_groups -a -g Linux_OTYHEA -q
```

**An enrolment password.** The agent enrols on port 1515 with the password you stored on the Pi, and then sends events on port 1514. If your managers do not yet require a password, the repository's own test shows the two changes that turn it on: `<use_password>yes</use_password>` in the manager's `ossec.conf`, and the password in `/var/ossec/etc/authd.pass`. To make the agent verify the manager's certificate before it enrols, set `WAZUH_MANAGER_CA_FILE` on the Pi.

**The Zeek rules.** The managers need `rules/132700-zeek.xml` and `rules/150000-zeek_sensor.xml` from our ruleset repository, with its two seed lists, `zeek-approved-inbound-hosts` and `zeek-domain-controllers`, declared. Our page on [open source Wazuh support](https://www.cyber-defence.io/services/wazuh-consulting/wazuh-support/open-source) explains how to deploy the ruleset, including the step that catches people out in a cluster: lists have to be declared on every node, because a cluster does not copy `ossec.conf` between them. No custom decoder is needed. Zeek writes JSON, Wazuh's JSON decoder reads it, and the rules use Zeek's own field names. Our guide to [Wazuh rules](https://www.cyber-defence.io/insights/wazuh-rules) explains how rules like these are built, chosen and tested.

If we monitor your organisation, the SOC supplies the enrolment password and the client code and makes sure the group exists, and the default manager address is already the right one.

## Check that it works

After the restart, work through the README's checks in order. Zeek should be running, the capture port should be up with no address, connection records should be appearing, and the agent should be connected:

```bash
sudo -u zeek /opt/zeek/bin/zeekctl status
ip -br addr show eth0
sudo tail -n 3 /opt/zeek/logs/current/conn.log
sudo grep status= /var/ossec/var/run/wazuh-agentd.state      # status='connected'
```

Then prove the whole chain with one harmless test. From any computer whose traffic the Pi watches, open `https://dns.google` in a browser. Within a minute or two Wazuh raises rule 150030, for a connection to a DNS-over-HTTPS service, with the Pi's name in the `_sensor` field. If it does, the mirror port, Zeek, the agent, the managers and the rules are all working.

## What it reports on an industrial network

Controllers and building systems rarely run an agent, which makes a passive sensor on a plant switch a good fit. To show what the Pi node reports there, we built a test bench: Zeek 9.0.2 with the sensor's scripts and configuration, a Wazuh 4.14.11 manager with our public ruleset, and a synthetic capture of a small plant network belonging to our demonstration organisation, OTY Heavy Industries. The capture holds ordinary protocol reads and handshakes, and the two internet addresses in it are entries from our published indicator lists. Nothing below comes from a client.

From that capture the manager raised these ten alerts about the plant network. An eleventh, the sensor's own warning that its capture port had gone quiet, followed when the capture ended.

| What happened on the wire | Rule | Level |
|---|---|---|
| An internet address tried fifteen ports on a controller within five minutes | 150051, port scan | 10 |
| The same address completed a connection to a controller on port 502, Modbus | 150000, internet host reached an internal administrative service | 10 |
| The same, to port 102, which Siemens S7 uses | 150000 | 10 |
| The same, to port 44818, EtherNet/IP | 150000 | 10 |
| The same, to port 20000, DNP3 | 150000 | 10 |
| The same, to port 47808, BACnet | 150000 | 10 |
| An engineering workstation logged in to a controller over Telnet | 150004, cleartext service | 5 |
| An operator station queried a building controller over SNMP with the community string "public" | 150088, default SNMP community | 6 |
| A workstation signed in to a controller's web page with basic authentication over plain HTTP | 150025 | 5 |
| The operator station connected out to an address on our malicious address list | 150077, threat intelligence | 12 |

The next figure is the manager's own test tool processing the Modbus record. Zeek recognised the conversation as Modbus, the sensor's script marked the connection as an internet host reaching an internal administrative service, and rule 150000 fired at level 10.

*[Image: Terminal output of wazuh-logtest: a Zeek record of an internet host reaching Modbus port 502 raises rule 150000 at level 10]*

*Output of wazuh-logtest on the Wazuh 4.14.11 test manager for the Modbus connection, abridged. The record is the one Zeek wrote; the rule, level and description are the manager's.*

The one after it shows the same ten alerts where an analyst would meet them, on the sensor's page in [Pulse](https://www.cyber-defence.io/services/pulse), the front end our SOC works in.

*[Image: Pulse demonstration view of a Zeek Pi node's agent page listing ten alerts from a plant network, for a demo organisation]*

*A demonstration view of the sensor's page in Pulse. The ten events are the test manager's alerts, with their real rule numbers, levels and descriptions; the organisation and everything else on the page are invented.*

It is worth being exact about what these alerts are. The sensor reports who is talking to a controller, from where, and over which service. It does not, today, raise alerts on what is said inside an industrial protocol. Rule 150000 fires because an internet address reached port 502, not because of the Modbus command it sent. Zeek does parse Modbus and DNP3 itself, and on the bench it wrote a `modbus.log` recording the function used, a read of holding registers. That log stays on the Pi for investigation and is not sent to Wazuh. Parsers for S7, EtherNet/IP and BACnet exist as separate Zeek packages from CISA's ICSNPP project and are not part of the sensor.

Two practical points follow. If a supplier legitimately reaches a controller from outside, add the controller to the `zeek-approved-inbound-hosts` list on the managers so that rule 150000 stays quiet for it. And remember what a mirror port shows: the sensor sees only the traffic copied to it, so mirror the link that joins the plant network to everything else.

## Looking after the sensor

The Pi node is built to be left alone. Every five minutes a timer archives Zeek's logs and runs a health check, which restarts Zeek if it has stopped. Once a day another timer refreshes the threat intelligence from our published lists. The health check reports to Wazuh, so a sensor in trouble raises an alert of its own:

| Condition | Wazuh rule |
|---|---|
| Disk 90% full, CPU too hot, under-voltage or throttling, or the clock not synchronised | 150118, sensor degraded |
| A Zeek process is not running | 150119, sensor down |
| Zeek is missing 10% or more of packets | 150115, packet loss |
| The capture port sees almost no traffic | 150069, which nearly always means the mirror port has stopped delivering |

To update the sensor, pull the repository and run the installer again; it never overwrites the configuration or the password. Zeek's patch releases arrive with the operating system's normal updates. The agent stays held at the managers' version until you upgrade it deliberately, after the managers.

Keep the Pi physically secure. Anyone holding its storage holds a record of the network it watched.

## If you want a hand

The repository is released under the MIT licence and needs nothing from us. The sensor was built for the clients of our own [SOC365](https://www.cyber-defence.io/services/soc) service and reports to our managers by default. For organisations that run their own Wazuh there are our [Wazuh support plans](https://www.cyber-defence.io/services/wazuh-consulting/wazuh-support) and [Wazuh consulting](https://www.cyber-defence.io/services/wazuh-consulting). We are not a Wazuh partner. To see which of your control systems can be reached from the internet before you build anything, our free [OT exposure checker](https://www.cyber-defence.io/tools/ot-exposure) is a quicker first step, and our account of [the attack on French supermarket refrigeration](https://www.cyber-defence.io/insights/cyberattack-defrosts-fridges-french-supermarkets) shows why it is worth knowing.

## Questions about the Zeek Pi node

### Can Zeek run on a Raspberry Pi?

Yes. The Pi node runs Zeek 9.0 on a Raspberry Pi 4 or 5 with a 64-bit operating system. The repository suggests a Pi 4 for sustained traffic up to about 100 Mbit/s and a Pi 5 up to about 250 Mbit/s, and the sensor alerts if it is losing packets.

### How does Zeek send data to Wazuh?

Zeek writes its logs as JSON files on the Pi. A Wazuh agent on the same Pi reads a selection of those files and forwards each record to the Wazuh managers, where rules turn records into alerts. No custom decoder is needed.

### Does the sensor need an address on the network it watches?

No. The capture port has no address and only receives traffic copied to it by a mirror port or TAP. The Pi reports to Wazuh over a separate management connection.

### Does it detect attacks on industrial control systems?

It reports exposure and risky behaviour around them: internet hosts reaching Modbus, S7, EtherNet/IP, DNP3 or BACnet ports, scans, cleartext logins, default SNMP communities and connections to known malicious addresses. It does not yet alert on the commands inside those protocols.

### Which Wazuh version does it need?

The installer fits Wazuh agent 4.14.11 by default and holds it at that version. An agent must never be newer than its manager, so pass the installer your managers' version if it differs.

### Is the Zeek Pi node free?

Yes. It is public on GitHub under the MIT licence. Zeek and the Wazuh agent are installed from their publishers' repositories and remain under their own licences.

## Sources

- UK Cyber Defence, [wazuh-zeek-pinode](https://github.com/UK-Cyber-Defence/wazuh-zeek-pinode): the README, the installer, the Zeek scripts and the test, read on 5 December 2026.
- UK Cyber Defence, [Wazuh rules repository](https://github.com/UK-Cyber-Defence/wazuh): the Zeek sensor rules and their description in the README.
- Zeek documentation, [Log files](https://docs.zeek.org/en/lts/script-reference/log-files.html): the Modbus and DNP3 logs.
- CISA, [Industrial Control Systems Network Protocol Parsers](https://github.com/cisagov/ICSNPP).
- IANA, [Service Name and Transport Protocol Port Number Registry](https://iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=502).
- The test bench: Zeek 9.0.2 and Wazuh manager 4.14.11, run on 5 December 2026 with a synthetic capture.

*Checked against these sources on 5 December 2026.*

---

Source: https://www.cyber-defence.io/insights/zeek-raspberry-pi-wazuh-network-sensor
