# Detection Engineering with Sigma

> Write, test and maintain detection rules as code using the vendor-neutral Sigma format and convert them for your SIEM. Free notes, key concepts, resources and...

Canonical: https://www.internhack.in/roadmaps/tracks/cybersecurity/detection-engineering-sigma
Last updated: 2026-11-28

Write, test and maintain detection rules as code using the vendor-neutral Sigma format and convert them for your SIEM.

Advanced · about 12 hours · difficulty 4/5

Learn first: [Log Analysis and Alert Triage](https://www.internhack.in/roadmaps/tracks/cybersecurity/alert-triage), [Git and GitHub for Security Work](https://www.internhack.in/roadmaps/tracks/cybersecurity/git)

**Detection engineering** treats alert rules like software: written deliberately, version controlled, tested and improved. **Sigma** is an open, YAML-based rule format that describes suspicious log patterns once and converts them to Splunk, Elastic, Microsoft Sentinel and other backends.

### Anatomy of a Sigma rule

- `title`, `id`, `status`, `description`, `author`, `references`.
- `logsource`: product, category and service, for example Windows process creation.
- `detection`: named selections of field conditions plus a `condition` line combining them.
- `falsepositives` and `level` so analysts know what to expect.
- `tags` mapping to MITRE ATT&CK techniques.

### The engineering loop

1. Start from a behaviour you want to catch, often an ATT&CK technique relevant to you.
2. Confirm you have the log source and fields needed.
3. Write the rule, convert it with **pySigma / sigma-cli**, and run it against lab data that contains both the behaviour and normal activity.
4. Tune: add filters for known benign cases rather than weakening the whole rule.
5. Store in Git, peer review changes, and track which rules fire and how often.

### Quality signals

- Clear title and triage guidance.
- Tested against real benign data.
- Resilient to trivial changes (not just one exact filename).

### Pitfalls

- Rules that depend on fields your pipeline does not collect.
- Copying community rules without testing, then disabling them when they get noisy.

Move on when you can write a Sigma rule for a suspicious process pattern, convert it for your SIEM and show it firing on lab data.

## Key concepts

- **Detection-as-code mindset**
- **Sigma rule structure**
- **logsource and detection logic**
- **Converting with sigma-cli / pySigma**
- **Testing with lab data**
- **Tuning and filters**
- **Rule review in Git**
- **Detection coverage tracking**

## Mini project

Write three Sigma rules for Windows process-creation behaviours you care about, convert them to your SIEM query language, test against benign lab data, and publish them with notes in a Git repo.

## Check yourself

Why is adding a narrow filter for a known benign case better than loosening the whole detection?

## Free resources

- [Sigma documentation](https://sigmahq.io/docs/) (SigmaHQ)
- [SigmaHQ rule repository](https://github.com/SigmaHQ/sigma) (SigmaHQ)
- [sigma-cli](https://github.com/SigmaHQ/sigma-cli) (SigmaHQ)

Previous: [Log Analysis and Alert Triage](https://www.internhack.in/roadmaps/tracks/cybersecurity/alert-triage) · Next: [Threat Intelligence for Defenders](https://www.internhack.in/roadmaps/tracks/cybersecurity/threat-intelligence)

## More in Security Operations (Blue Team)

- [How a SOC Works](https://www.internhack.in/roadmaps/tracks/cybersecurity/soc-fundamentals)
- [Log Sources and Telemetry](https://www.internhack.in/roadmaps/tracks/cybersecurity/log-sources)
- [SIEM with Splunk](https://www.internhack.in/roadmaps/tracks/cybersecurity/siem-splunk)
- [SIEM with the Elastic Stack](https://www.internhack.in/roadmaps/tracks/cybersecurity/siem-elastic)
- [Log Analysis and Alert Triage](https://www.internhack.in/roadmaps/tracks/cybersecurity/alert-triage)
- [Detection Engineering with Sigma](https://www.internhack.in/roadmaps/tracks/cybersecurity/detection-engineering-sigma)
- [Threat Intelligence for Defenders](https://www.internhack.in/roadmaps/tracks/cybersecurity/threat-intelligence)
- [MITRE ATT&CK for Defenders](https://www.internhack.in/roadmaps/tracks/cybersecurity/mitre-attack-defenders)

## Related

- [Roadmaps](https://www.internhack.in/roadmaps)
- [Cybersecurity Roadmap](https://www.internhack.in/roadmaps/tracks/cybersecurity)
