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.
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.
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 turn those records into alerts.
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
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.
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:
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.
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:
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
zeekuser, 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:
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 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 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:
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.
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, the front end our SOC works in.
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 service and reports to our managers by default. For organisations that run their own Wazuh there are our Wazuh support plans and 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 is a quicker first step, and our account of the attack on French supermarket refrigeration 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: the README, the installer, the Zeek scripts and the test, read on 5 December 2026.
- UK Cyber Defence, Wazuh rules repository: the Zeek sensor rules and their description in the README.
- Zeek documentation, Log files: the Modbus and DNP3 logs.
- CISA, Industrial Control Systems Network Protocol Parsers.
- IANA, Service Name and Transport Protocol Port Number Registry.
- 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.
Written by

Founder and Head of Threat Disruption
Founder of UK Cyber Defence. Fellow of the BCS and Chartered IT Professional; former CISO for FTSE 250 organisations and for Microsoft Europe; founded Hedgehog Security in 2009.
Next step
Want this looked at in your own estate?
Thirty minutes with an analyst, not a salesperson. We will tell you whether it matters to you and what to do first.
Related insights
Wazuh rules: how they work, why they fail quietly, and 4,600 of ours to use
A Wazuh rule decides whether a line of log becomes an alert. This guide explains how rules are built and chosen, the six faults that stop one firing without any error, and how to use the 4,676 rules our own SOC runs, which we have published on GitHub.
Seeing what your SOC sees: the new SIEM section in Pulse
Managed security has a quiet flaw: when it works, there is nothing to look at. The latest release of Pulse, our client portal, changes that. You can now watch the activity our Security Operations Centre records across your estate as it happens, see every monitored machine, and open the same page for each one that our analysts use. Here is what has changed, why we built it this way, and how to get the most from it.
One click, one new administrator: the Elementor CSRF flaw explained
A flaw in Elementor 4.3.0 and 4.3.1 lets anyone who can get a WordPress administrator to click a link create themselves an administrator account. No JavaScript, no form, no exploit kit: a plain link. Around two million sites were exposed. Here is how it works, why it is worse than it sounds, what to do this morning, and the Wazuh rules our SOC is using to see it.