Detection-as-code
Detections for SSH and Telnet attacks and the network traffic around them, written once in Sigma and converted to Splunk SPL and Microsoft Sentinel KQL. Every rule is tested in CI against attack events that must match and look-alike events that must not. The behaviour comes from the live honeypot: Cowrie's shell sessions and the Suricata IDS beside it, joined by source IP where a rule needs both.
How a rule gets here
- Sigma rule in
rules/, tagged with ATT&CK - Validation: pySigma's 31 validators, and every regex checked to be RE2-safe for KQL
- Tests: an evaluator runs the rule on
match.jsonl(must fire) andnomatch.jsonl(must not) - Conversion to SPL and KQL, committed in
dist/; CI fails if they're stale - Splunk and Sentinel checks: the generated SPL runs in Splunk and the KQL in Microsoft Sentinel on the same test events, and both must agree with the evaluator
- Deploy: the rules run as Sentinel analytics rules on the live honeypot feed, which arrives every 10 minutes
Automated response
Every incident these rules raise in Microsoft Sentinel goes through SOAR playbooks (Logic Apps, deployed with Bicep). The honeypot only sees attacks, so they triage rather than block: each incident is enriched with AbuseIPDB and the source's activity on the honeypot, Low-severity incidents from widely reported sources are closed, and High ones are assigned and sent to my phone. An incident is High only when its source brought a file or an exploit the honeypot hasn't seen in two days; the same botnets' daily droppers are Medium.
ATT&CK coverage
Rules
-
echo -e / echo -ne with \xNN escapes redirected into a file: the attacker writes a binary or script chunk by chunk because the device has no wget, curl or tftp.
-
A session installs a cron job, either through crontab or by writing to /etc/cron* or /var/spool/cron, so the payload restarts after a reboot or after being killed.
-
Miner binaries (xmrig, minerd, cpuminer), mining pool protocols (stratum+tcp, stratum+ssl) or pool names in a command.
-
A single command line fetches a file with wget, curl, tftp or ftpget and runs it: piped into a shell, made executable with chmod +x, or started with sh.
-
A session logs in and transfers a tool within the same five-minute window: the automated dropper chain of IoT and Linux botnets.
-
Suricata (ET Open) flags traffic that tries to exploit a service: an ET EXPLOIT, WEB_SERVER or WEB_SPECIFIC_APPS signature, or a rule classed as an attempted privilege gain or a web application attack.
-
A command writes to or locks an authorized_keys file.
-
Cowrie flags a Telnet connection that sends an environment variable meant to skip the password, such as USER=-f root (CVE-2026-24061 in GNU InetUtils telnetd, through 2.7).
-
Blocklisted Source Logs In medium
A source on an ET reputation list (CINS, Spamhaus DROP, known compromised hosts) logs in to Cowrie within the same hour as Suricata flags it.
-
A command line runs a file (./name, sh name, or a path under /tmp, /var/tmp, /var/run or /dev/shm) and then deletes with rm.
-
The session flushes iptables, disables ufw or SELinux, or stops firewalld, AppArmor or a cloud provider's security agent (Alibaba Cloud's aegis / aliyun-service), clearing the way for the payload and its outbound connections.
-
One source tries five or more different passwords within ten minutes.
-
A command makes a file executable (chmod +x or a numeric mode) and runs it in the same line, without a download in that line, or removes the immutable or append-only attribute with chattr -i / -a.
-
Scanned Then Logged In medium
One source sets off a Suricata scan signature and logs in to Cowrie within the same hour: reconnaissance and initial access from the same address, joined across the two sensors by src_ip.
-
history -c, deleting or truncating .bash_history, unsetting HISTFILE or pointing it at /dev/null: the attacker removes the record of the commands they just ran.
-
The bot creates an empty dot-file in a directory and runs it with sh, for example `echo > /dev/shm/.b && sh /dev/shm/.b`.
-
A Telnet or SSH session sends the bare words that break out of a router or IoT vendor CLI into a Linux shell (enable, system, shell, sh, linuxshell).
-
One command line reads the kernel and architecture (uname) together with the CPU count or CPU details (nproc, lscpu, /proc/cpuinfo).