Overview
Chronos-DFIR integrates offline detection engines that evaluate forensic data against Sigma and YARA rules during ingestion. All detection happens locally — no internet connection required.Current rule coverage: 86+ Sigma rules (MITRE ATT&CK TA0001-TA0011 + OWASP Top 10) + 7 YARA rule files (ransomware, C2, infostealers, LOLBins, webshells, macOS persistence).
Sigma Rules
What is Sigma?
Sigma is a generic signature format for SIEM systems, developed by Florian Roth and the SigmaHQ community. It allows analysts to write detection logic once and convert it to multiple query languages (Splunk, Elastic, QRadar, etc.). Chronos-DFIR implements a native Sigma engine (engine/sigma_engine.py) that compiles YAML rules directly to Polars expressions for evaluation against forensic DataFrames.
How Sigma Rules Work
During evidence ingestion (README.md line 33):Rule Loading
On startup, Chronos loads all Result: 86+ rules cached in-memory for fast evaluation
.yml and .yaml files from rules/sigma/ directory tree.Implementation (engine/sigma_engine.py line 40):Detection Compilation
Each Sigma rule’s Compiled to Polars (
detection block is compiled to Polars expressions.Example rule: rules/sigma/mitre/ta0002_execution/T1059_001_powershell_encoded.ymlengine/sigma_engine.py line 139):Row-by-Row Evaluation
As each row is processed during ingestion, all Sigma expressions are evaluated.Matching rows:
Sigma_Tagcolumn populated with rule titleMITRE_Techniquecolumn populated with TTPs from rule tags- Row IDs stored in
matched_rowslist for evidence retrieval
Sigma Rule Structure
Every Sigma rule follows this format:Supported Sigma Features
Field Modifiers (v1.2)
Field Modifiers (v1.2)
Implemented modifiers:
Not yet implemented (Roadmap):
| Modifier | Description | Example | |
|---|---|---|---|
contains | Substring match | CommandLine|contains: "mimikatz" | |
contains|any | Match any value in list | Image|contains|any: ["cmd.exe", "powershell.exe"] | |
contains|all | Match all values | CommandLine|contains|all: ["-enc", "-nop"] | |
startswith | Prefix match | Image|startswith: "C:\\\\Windows\\\\Temp" | |
endswith | Suffix match | Image|endswith: ".exe" | |
re | Regex match | `CommandLine|re: “\b(password\ | passwd)\b”` |
base64offsetcidr(IP range matching)windash(normalize command-line dashes)
Boolean Conditions
Boolean Conditions
Supported:
condition: selection(single block)condition: selection1 and selection2(AND logic)condition: selection1 or selection2(OR logic)condition: selection and not filter(negation)condition: 1 of selection_*(match any block starting withselection_)condition: all of selection_*(match all blocks)
Temporal Correlation (Partial)
Temporal Correlation (Partial)
Roadmap feature (not yet implemented):Status:
timeframe and count() aggregation are deferred to v1.3.Workaround: Use post-processing with Polars aggregations:Sigma Rule Directory Structure
Fromrules/README.md:
Creating Custom Sigma Rules
Identify Detection Logic
Question to answer: What combination of fields indicates malicious activity?Example: Detect PsExec lateral movement
- Service creation (Event ID 7045)
- Service name matches PsExec pattern (
PSEXE*) - Service binary path is
*.exein ADMIN$ share
Test Rule
Restart Chronos-DFIR server (rules loaded on startup):Ingest test data containing PsExec events.Verify:
Sigma_Tagcolumn shows rule title- Forensic Insight modal shows detection under “Sigma Rule Detections”
Field Name Mapping
Sigma rules use case-insensitive field lookups with dot-notation fallback (engine/sigma_engine.py line 84):
- Rule field
Imagematches DataFrame columnimage,IMAGE, orImage - Rule field
EventData.CommandLinematches columnCommandLine(common in Windows logs) - If field doesn’t exist in data, rule silently skips (no error thrown)
YARA Rules
What is YARA?
YARA is a pattern-matching tool for identifying malware based on textual or binary patterns. Originally designed for file scanning, Chronos-DFIR applies YARA rules to forensic event fields (CommandLine, file paths, message content).How YARA Rules Work
YARA evaluation happens during forensic analysis (engine/forensic.py → run_yara_scan()):
YARA Rule Structure
Example:rules/yara/ransomware/qilin_agenda.yar (truncated)
YARA Rule Directory Structure
Creating Custom YARA Rules
Define String Patterns
Identify unique strings from known malware samples.Example: Custom backdoor detection
Detection Workflow Integration
Where Detections Appear
Timeline Grid
Timeline Grid
Columns added:
Sigma_Tag: Rule title(s) that matched this rowMITRE_Technique: Comma-separated TTPs (e.g.,T1059.001, T1027)YARA_Match: Rule name(s) from YARA scan
- Rows with detections may be highlighted (future UI enhancement)
- Sort by
Sigma_Tagto group all detected rows
Forensic Insight Modal
Forensic Insight Modal
Click Context button or Forensic Insight Report to open modal.Sigma Detections section:
- Table of all triggered rules
- Severity level (Critical/High/Medium/Low)
- Hit count per rule
- Expandable evidence table (150 sample rows with forensic context columns)
- “View all in Grid” button → filters main timeline to show all matching rows
- List of matched YARA rules
- Rule metadata (family, severity, MITRE mapping)
Dashboard Cards
Dashboard Cards
Top Tactic card: Shows MITRE tactics by detection frequencyRisk Score: Calculated from Sigma hit severity + count (
engine/forensic.py → calculate_smart_risk_m4())TTP Summary Strip (below dashboard):- Severity badges:
CRITICAL: N,HIGH: N - Top 6 MITRE technique pills (e.g.,
T1003,T1059.001)
Exports
Exports
CSV/Excel exports: Include HTML/PDF reports: Formatted detection summaries with evidence tables
Sigma_Tag, MITRE_Technique, YARA_Match columnsContext JSON export: Full detection details:Advanced Detection Techniques
Chaining Multiple Rules
Scenario: Detect full attack chain (initial access → execution → persistence)Initial Access Detection
Sigma rule detects phishing email attachment execution:
- Rule:
T1204_user_execution_malicious_file.yml - Matches: Process creation from
%TEMP%with suspicious parent (Outlook, browser)
Execution Detection
Sigma rule detects encoded PowerShell:
- Rule:
T1059_001_powershell_encoded.yml - Matches:
powershell.exe -EncodedCommand
Persistence Detection
Sigma rule detects registry Run key modification:
- Rule:
T1547_001_registry_run_keys.yml - Matches: Registry changes to
HKCU\Software\Microsoft\Windows\CurrentVersion\Run
Manual Correlation
Current workflow:
- Filter timeline to rows with
Sigma_Tagpopulated - Group by
UserorComputerto identify affected hosts - Manually trace event sequence using timestamps
- Automatic correlation chains based on shared entities (User, Process, IP)
- Visual attack graph showing detection relationships
Custom Aggregation Logic
Example: Brute force detection (not yet supported in Sigma v1.2) Current workaround using Polars post-processing:timeframe and count() support (v1.3) will enable:
Rule Management
Disabling Rules
Option 1: Set rule status todeprecated
rules/sigma/ directory
Rule Updates
Updating existing rules:- Edit
.ymlfile inrules/sigma/ - Restart Chronos-DFIR server (rules cached on startup)
- Reingest test data to verify changes
Not all SigmaHQ rules are compatible with Chronos’ Polars engine. Test rules after import and adjust field names if needed.
Next Steps
Case Management
Organize detections across multiple files with case-based investigations
Filtering & Searching
Navigate detected events efficiently with advanced filtering
Evidence Ingestion
Learn which forensic columns improve detection accuracy