Detection engineering lab: Suricata rules, Sigma rules and Zeek-style logs on one private Ubuntu VM
This lab gives each student the work of a detection engineer in one Ubuntu VM: write a rule, test it on data where the answer is known, tune it until it misses nothing and stays quiet, and measure it. Every capture and log is made up for the lab and written from fixed text, so every student sees the same thing, and two pieces of work the student writes are marked by a script on traffic and logs it makes afresh.
Suricata, the open-source intrusion detection system, is the real one, installed from Ubuntu’s archive. The Sigma tools, sigma-cli and pySigma with a SQLite backend, are the real ones too, installed from PyPI. Zeek is not in Ubuntu’s archive, so the lab has zeek-lite, its own small model of Zeek that writes conn.log, dns.log and http.log in Zeek’s format with a subset of its fields. Defensive only: a student uses these tools on their own copy, and on a real network only with written permission.
What students learn
How a detection is made and looked after. A capture of a made-up office becomes Zeek-style logs, read with zeek-cut. Suricata rules for a made-up tool called updater are run on it: a first try that fires on names that only look like the tool’s, a tuned rule anchored with dotprefix and endswith, and a rule with a threshold of one alert per machine an hour. Sigma rules for Windows process events are converted into SQL and run on a small table of events. A test harness runs every rule on a known-bad and a known-good capture, and the counts give precision and recall.
The five parts
First the capture as logs, with zeek-lite and zeek-cut. Second the example Suricata rules, counted and read with det, the lab’s helper. Third the Sigma rules, converted with sigma convert and run with det sigma. Fourth the test captures, with det test. Fifth two pieces of work the student writes: rules/local.rules, Suricata rules for a second made-up tool called quietbird, and beacon.py, a program that finds hosts calling home at a steady rhythm in a Zeek conn.log. The comment at the top of each says exactly what it must do, and README.md in the home folder gives none of the answers.
Run it in your browser
VM labs are set as a lab task in a module, and the sample is on the lab’s page. The machine is small: one CPU, 1 GB of memory and 10 GB of disk. The setup installs from PyPI, which a visitor without an account cannot reach, so the lab needs a free or college account.
- Add the lab. In a module you teach, add a task and choose the Ubuntu VM lab card. The page shows a short description of the machine instead of a compose file.
- Start from the sample. The page offers ready-made labs to start from. Choose Detection engineering. Using a sample replaces the text, and Undo brings yours back.
- Publish and start your own copy. Publish, then Start. The lab’s own setup script installs Suricata from Ubuntu’s archive and the Sigma tools from PyPI, and writes the captures, the logs, the rules, the det helper and the README, the first time the VM starts, in about a minute.
- Open the terminal. Open its terminal and read README.md in the home folder. Nothing opens in the browser: the lab is the terminal.
A basic lesson on this lab
Detection Engineering Basics is a small lesson worked in this lab, which is an Ubuntu VM. It has a hook, an I can outcome, key words, a starter, a check after each idea, a common mistake and an exit check, and each step has a Run button that types its command into the machine’s terminal. A student turns the capture into logs, counts the example rules’ alerts, tests them on the two test captures and runs a Sigma rule.
The lesson looks around and leaves the lab’s own task, the quietbird rules and the beacon program, to the student, so it hands out no answers. The undergraduate module Detection engineering with Sigma, Suricata and Zeek is worked in this lab, six lessons and a teacher guide.
How it is marked
The lab has a check. It runs on a copy of the saved machine and makes a fresh capture of an office with machines, names and counts nobody has seen: some lookups of quietbird’s names, some look-alike names that belong to somebody else, and one to three machines sending quietbird’s check-ins, again and again, beside software whose name only looks like it. The real Suricata runs rules/local.rules on it, and passes only one alert for every quietbird lookup, one for each infected machine however many check-ins it sent, and nothing else. It then makes a fresh conn.log with one or two hidden beacons of a random interval, decoys and its columns in a new order, and a quiet log with none: beacon.py must find each beacon with its median gap and its count, and print NO BEACON on the quiet one. A beacon.py that starts another program or reads the lab’s own files is refused. The first line of what the check printed says why.
- Hand it out. Assign the lab like any task, with a due date if you want one. Each student gets a VM of their own, kept between sessions.
- Run the check. On a student’s row in the class list, press Run the check. It starts a copy of their saved machine that is not saved back, runs the lab’s check script as root and shows whether it passed, what it printed and when. The student is not told the result.
- Mark it. Read the first line of what the check printed: it says what is not right, such as a look-alike name a rule alerted on, a machine that gave seven alerts instead of one, or a beacon the program missed. Send the work back with a reason if it needs more.
The definition on GitHub
The file is the whole lab definition, the same text the platform runs: size, setup script, the helper, the generator of the captures and events, the model of Zeek, the rules, the README and the check. Copy it and change the made-up tools, the names or the office to make a lab of your own.
Try this lab, and what it costs
A free personal account can work through the basic lessons in this lab, with enough free credit each month to follow most lessons and no card. For a class, a school or college has its first 365 days free for up to 50 students, then pays per student a year, with every lab included and staff free.
Questions people ask
- Does the lab need a licence?
- No. Suricata and scapy are GPL-2.0, sigma-cli and pySigma are LGPL, the SQLite backend is LGPL-3.0, and SQLite is public domain. They are installed on the student’s VM when it starts, from Ubuntu’s archive and from PyPI, so we distribute none of them.
- Is it real Zeek?
- No. Zeek is not in Ubuntu’s archive and has no binary on a source a lab VM may reach, so the lab has zeek-lite, a short Python program of ours that writes conn.log, dns.log and http.log in Zeek’s tab-separated format with a subset of Zeek’s field names. Reading the logs, zeek-cut and the field names are as in Zeek. Real Zeek writes more fields and more logs.
- Can students harm anything?
- Only their own copy. The traffic is generated inside the VM from fixed text and never touches a network, and the machine reaches Ubuntu’s archive and the Python package index and nothing else. If a student breaks a file, det reset puts it back as it was given.
- Was the lab tested in a real student VM?
- The setup, the lessons’ commands and the check, with each way of faking it, were run in an Ubuntu 26.04 container standing in for the VM, on an arm64 machine. A booted student VM and the amd64 install are worth one try before a class.