Rule Management
Rules are the heart of CHAD. They define what security events to detect using the Sigma rule format.Understanding Sigma Rules
Sigma is a generic signature format for SIEM systems. It’s vendor-agnostic, meaning rules written in Sigma can be translated to any backend. A basic Sigma rule:The Rule Editor
CHAD provides a Monaco-based editor with:- Syntax highlighting for YAML
- Schema validation against Sigma specification
- Autocomplete for common fields
- Error highlighting with helpful messages
Editor Features
| Feature | Shortcut | Description |
|---|---|---|
| Format | Shift+Alt+F | Auto-format YAML |
| Find | Ctrl+F | Search within rule |
| Comment | Ctrl+/ | Toggle line comment |
| Autocomplete | Ctrl+Space | Show suggestions |
Creating a Rule
- Navigate to Rules in the sidebar
- Click Create Rule
- Write your Sigma rule in the editor
- Click Validate to check for errors
- Click Save to store the rule (not yet detecting)
- Click Deploy to activate detection
Required Fields
Every rule needs:Optional Fields
Detection Logic
Selection Blocks
Selections define field conditions:Modifiers
Modifiers change how values are matched:| Modifier | Description | Example |
|---|---|---|
contains | Substring match | CommandLine|contains: 'whoami' |
startswith | Prefix match | Path|startswith: 'C:\\Temp' |
endswith | Suffix match | FileName|endswith: '.exe' |
re | Regex match | CommandLine|re: '.*mimikatz.*' |
all | All values must match | Tags|all: ['admin', 'sensitive'] |
Conditions
Conditions combine selections:and- Both must matchor- Either must matchnot- Must not match1 of selection*- Any selection matchesall of selection*- All selections match
Field Mapping
CHAD translates Sigma field names to your actual log field names using ECS (Elastic Common Schema) mappings. For example:- Sigma
CommandLine→ Your logsprocess.command_line - Sigma
User→ Your logsuser.name
Testing Rules
Before deploying, test your rule:Sample Log Test
- Click Test Rule in the editor
- Paste a sample log (JSON format)
- See if the rule would match
Historical Test (Dry Run)
Test against real historical data:- Click Historical Test
- Select time range (last hour, day, week)
- See matching documents without creating alerts
Deploying Rules
Deployment creates a percolator in OpenSearch that matches incoming logs in real-time.Deploy a Single Rule
- Open the rule in the editor
- Click Deploy
- Rule status changes to “Deployed”
Bulk Deploy
- Go to Rules list
- Select multiple rules with checkboxes
- Click Bulk Actions > Deploy
Rule Status
| Status | Icon | Meaning |
|---|---|---|
| Deployed | 🟢 | Actively detecting |
| Undeployed | ⚪ | Saved but not detecting |
| Snoozed | 💤 | Temporarily disabled |
Version Control
Every save creates a new version. View history in the Activity panel:- See all previous versions
- View diff between versions
- One-click rollback to any version
Rollback
- Open the rule
- Click Activity panel
- Find the version to restore
- Click View Diff to compare
- Click Restore to rollback
Rule Snoozing
Temporarily disable a rule during maintenance:- Open the rule
- Click Snooze
- Choose duration:
- 1 hour to 168 hours (7 days)
- Indefinite (until manually re-enabled)
Best Practices
Start with low severity
Start with low severity
New rules should start as
level: low until you understand false positive rates.Test before deploying
Test before deploying
Always run historical tests to estimate alert volume.
Use descriptive titles
Use descriptive titles
Include what and why: “Mimikatz Execution via CommandLine” not “Suspicious Activity”.
Add MITRE ATT&CK tags
Add MITRE ATT&CK tags
Document false positives
Document false positives
Use the
falsepositives field to help analysts understand expected noise.Next Steps
Exception Rules
Tune out false positives
SigmaHQ Import
Import community rules
Threshold Alerting
Count-based detections
Field Mappings
Configure field translation