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.

11rules
13ATT&CK techniques
44attack test events
57look-alike test events

How a rule gets here

  1. Sigma rule in rules/, tagged with ATT&CK
  2. Validation: pySigma's 31 validators, and every regex checked to be RE2-safe for KQL
  3. Tests: an evaluator runs the rule on match.jsonl (must fire) and nomatch.jsonl (must not)
  4. Conversion to SPL and KQL, committed in dist/; CI fails if they're stale
  5. Splunk check (local): the generated SPL runs in Splunk on the same test events and must agree with the evaluator

ATT&CK coverage

TacticTechniqueRules
Initial AccessT1078Valid AccountsLogin Followed By Tool Transfer
ExecutionT1053.003CronCron Job Added From Interactive Session
T1059.004Unix ShellDownload And Execute In One Command, Writable And Executable Directory Probe
T1059.008Network Device CLINetwork Device CLI Escape Attempt
PersistenceT1053.003CronCron Job Added From Interactive Session
T1078Valid AccountsLogin Followed By Tool Transfer
T1098.004SSH Authorized KeysSSH Authorized Keys Modified
Privilege EscalationT1053.003CronCron Job Added From Interactive Session
T1078Valid AccountsLogin Followed By Tool Transfer
T1098.004SSH Authorized KeysSSH Authorized Keys Modified
StealthT1027Obfuscated Files or InformationBinary Written With Hex-Escaped Echo
T1070.003Clear Command HistoryShell History Cleared Or Disabled
T1078Valid AccountsLogin Followed By Tool Transfer
Defense ImpairmentT1685Disable or Modify ToolsFirewall Or Security Agent Disabled
T1686Disable or Modify System FirewallFirewall Or Security Agent Disabled
Credential AccessT1110.001Password GuessingPassword Guessing From One Source
DiscoveryT1083File and Directory DiscoveryWritable And Executable Directory Probe
Command and ControlT1105Ingress Tool TransferDownload And Execute In One Command, Binary Written With Hex-Escaped Echo, Login Followed By Tool Transfer
ImpactT1496Resource HijackingCryptocurrency Miner Indicators

Rules