Playbook Defense
Honeypot findings, turned into alerts, an allowlist and a trap · Sigma and Terraform on Google Cloud · Nov 2026
In short
- Where it starts: the Rust telnet honeypot recorded 839 bot logins and the steps they took afterwards, from default passwords to malware downloads. Its report ends with what defenders should do. This project does it.
- What I built: 17 Sigma alert rules, one or more for every step of that playbook; Google Cloud firewall rules in Terraform that only let approved addresses reach admin ports and only let IoT devices reach the servers they need; and an internal decoy NAS, running the honeypot's own fake shell, that no real person or system is meant to use.
- Why it holds together: a single file,
allowlist.yaml, lists who is allowed in, where IoT devices may go and where the decoy lives. Terraform builds the firewall from it, and a script writes the same addresses into the alert rules, so both come from one list.
Three layers
- Designed to stop bots at the edge. Admin ports (SSH, RDP, VNC and device web pages) only answer the VPN, static office addresses and Google's Identity-Aware Proxy. Telnet, the door every bot on the honeypot came through, is closed to everyone by default, the allowlist included.
- Approved people still get in. One door, preferably the VPN. Losing a laptop means revoking one VPN account, not editing the firewall.
- IoT devices are blocked from calling out. Every dropper the honeypot saw fetched its payload from a raw IP address on the internet. IoT devices may only reach the few servers they need, so that download would fail, and the blocked attempt would raise an alert.
- Anything that touches the decoy is an alert. The NAS decoy sits inside the network with an ordinary server name. No real person or system is meant to use it, so a connection most likely means someone inside is exploring: a compromised device, a bot past the edge, or a person who shouldn't be there.
Every playbook step, as an alert
The honeypot recorded the same playbook again and again. Each step became at least one rule, written in Sigma so it converts to Splunk, Sentinel, Elastic and other SIEMs. Rules that read firewall logs work everywhere; the rest need process or login logs from the device itself, which many IoT devices can't provide.
| Playbook step | MITRE ATT&CK | Rule | Reads | Level |
|---|---|---|---|---|
| Log in with factory defaults | T1110.001, T1078.001 | Telnet or admin port from outside the allowlist; login as root, admin, guest… | Firewall, login | high |
| Break out of a router's limited menu | T1059.008, T1059.004 | Shell started under telnetd or login | Processes | medium |
| Try a router CLI | T1059.008 | Shell started under telnetd or login | Processes | medium |
| Inject a shell into a ping tool | T1059.004 | Shell syntax in a ping or diagnostics request | Web server | high |
| Look around | T1082, T1087.001, T1033, T1083 | CPU, mount and user checks | Processes | low |
| Find a writable folder, then check with a hex echo | T1083 | Mount checks, and echo -e with hex | Processes | high |
| Check for a real BusyBox | T1497.001 | BusyBox with a made-up applet name | Processes | high |
| Check that echo works | T1497.001 | Shell-check commands people don't type | Processes | high |
The SHELL_TEST check | T1497.001 | SHELL_TEST anywhere in a command | Processes | high |
| Download and run | T1105, T1222.002, T1059.004 | Download from a raw IP; IoT device calling out, critical on dropper ports | Processes, firewall | critical |
| Remove rival bots | T1489 | kill -9 aimed at other malware | Processes | medium |
| Clean up | T1070.004 | Dropped file or shell history deleted | Processes | medium |
| Write a payload with hex echoes, instead of downloading | T1140, T1059.004 | Long runs of hex escapes in echo -ne or printf | Processes | medium |
| The whole playbook | — | Telnet from outside, then the same device calls out within 10 minutes | Firewall | critical |
| The trap | — | Any connection to the decoy; a login attempt on it; the decoy trying to connect out | Firewall | critical |
The first 12 rows are the 12 steps on the honeypot page, with the same names and ATT&CK IDs. The last three go further: a payload written with hex echoes instead of downloaded, seen in one honeypot session; the whole playbook; and the trap. Each rule's file is in the repo's rules folder.
The trap
- It's the honeypot, moved inside. The decoy runs the same Rust fake shell, with the same safety design: every reply is fixed text, and nothing a visitor sends is ever run. What changes is where it sits and what it's called. It has no public IP, an ordinary NAS hostname, and a bland network tag.
- Twelve NAS ports, one that answers. Only telnet answers, with the fake shell. FTP, SMB, AFP, NFS, rsync and the usual NAS admin pages have nothing behind them, but the cloud firewall still logs every attempt to reach them, and that's all an alert needs.
- It's built so it can't become a foothold. The decoy can't start a connection: outbound traffic is denied by the cloud firewall and again by nftables on the host. If it ever tries, that's its own critical alert, and the answer is to shut it down.
Why this is worth having. The allowlist and the IoT rules are designed to stop bots at the door, and the decoy is there to catch what gets past them. Because nothing legitimate should connect to it, its alerts should have few false positives, which is rare for detection inside a network. The one exception is an approved vulnerability scanner, and the allowlist file has a place to exclude those.
What's tested, and what isn't
- Tested on every push. GitHub Actions checks every rule, including its ATT&CK tags, and fails the build on any issue. It then converts all 17 rules to Splunk searches and validates the Terraform. While building it, that check caught two real problems: tags that a newer ATT&CK release had renamed, and a correlation rule that was silently swallowing two of the rules it was built from.
- Not tested yet. It hasn't been deployed to a real company network. The rules have been converted, not run against live logs, and the Terraform has been validated, not applied. The repo ships with placeholder addresses, and its README lists the checks to run once the real ones are filled in.
The code
The rules, the Terraform, the allowlist script and a step-by-step README, including how to keep the trap a trap.