Detection-as-code
Detections for SSH and Telnet attacks, 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.
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 check (local): the generated SPL runs in Splunk on the same test events and must agree with the evaluator
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.
-
A command writes to or locks an authorized_keys file.
-
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.
-
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).