| namespace | aiwg |
| name | sigma-hunting |
| description | Apply Sigma rules against log sources for threat hunting; convert rules to Elasticsearch, Splunk, and grep queries |
| tools | Bash, Read, Write, Glob, Grep |
| platforms | ["all"] |
sigma-hunting
Applies Sigma detection rules against collected log sources to identify threat activity. Supports the bundled forensics-complete Sigma rule library and custom rules. Converts Sigma rules to backend-specific queries for Elasticsearch, Splunk, and grep, enabling hunting across both real-time platforms and offline log files.
Triggers
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
- "ATT&CK [technique]" / "MITRE [TID]" → technique-specific threat hunt
- "T1059" / "T1053" (etc.) → ATT&CK technique ID lookups
- "Sigma rules" → rule-based threat hunting
Purpose
Sigma provides a vendor-neutral rule format for expressing detection logic. Writing backend-specific queries for every log source and SIEM is time-consuming and error-prone. This skill translates Sigma rules to the appropriate query format for the available tooling, applies them against collected logs, and reports matches with ATT&CK technique context.
Behavior
When triggered, this skill:
-
Identify available rule sources:
- Bundled rules:
agentic/code/frameworks/forensics-complete/sigma/
- Custom rules:
.aiwg/forensics/sigma/custom/
- Check for sigma-cli or pySigma installation:
sigma --version 2>/dev/null
- If sigma-cli is unavailable, use built-in grep-based conversion for simple rules
-
Identify target log sources and backends:
- Detect available log sources: journald, flat files, Elasticsearch index, Splunk index
- Match Sigma
logsource categories to available sources:
category: process_creation → syslog, auditd logs, or EDR telemetry
category: network_connection → firewall logs, VPC flow logs, Zeek conn.log
category: webserver → nginx/Apache access logs
product: linux → auth.log, syslog, journal
product: windows → Windows Event Log exports (.evtx or JSON)
-
Select applicable rules:
- Filter rule library by
logsource compatibility with available sources
- If a specific MITRE technique is requested (e.g., "hunt for T1059"), filter by
tags: attack.t1059*
- Apply severity filter: default to
medium, high, critical rules only
- List selected rules and their ATT&CK technique mappings before execution
-
Convert rules to grep (offline log files):
-
Convert rules via sigma-cli (when available):
Usage Examples
Example 1 — Full hunt against local logs
sigma hunt
Example 2 — Hunt for specific technique
hunt for T1078
Example 3 — Convert rules for Elasticsearch
sigma rules --backend elasticsearch --output hunt-queries.txt
Output Locations
- Hunt report:
.aiwg/forensics/findings/<hostname>-sigma-hunt.md
- Converted queries:
.aiwg/forensics/sigma/converted/
- Rule hit evidence:
.aiwg/forensics/evidence/sigma-hits.txt
Configuration
sigma_hunting:
bundled_rules_path: agentic/code/frameworks/forensics-complete/sigma/
custom_rules_path: .aiwg/forensics/sigma/custom/
default_severity_filter:
- medium
- high
- critical
default_backend: grep
available_backends:
- grep
- elasticsearch
- splunk
sigma_cli_path: sigma
References
- @$AIWG_ROOT/agentic/code/addons/aiwg-utils/rules/research-before-decision.md — Identify available log sources and rule libraries before executing hunts; check tool availability
- @$AIWG_ROOT/agentic/code/frameworks/forensics-complete/rules/evidence-integrity.md — Hunting must not modify log sources; run rules against read-only copies
- @$AIWG_ROOT/agentic/code/frameworks/forensics-complete/rules/red-flag-escalation.md — Escalate to human when Sigma hits indicate active compromise or critical severity findings
- @$AIWG_ROOT/agentic/code/frameworks/forensics-complete/skills/ioc-extraction/SKILL.md — Cross-reference Sigma rule hits against extracted IOCs for confirmation
- @$AIWG_ROOT/agentic/code/frameworks/forensics-complete/skills/log-analysis/SKILL.md — Log analysis skill provides the correlated timeline that Sigma hunting adds detection coverage to