Skip to content
Category: Forensics9 min read

SIEM Detection Engineering with Sigma Rules: A Practical Blue-Team Guide

Por Lucas Andrade ·

Build reliable, portable detections with Sigma and your SIEM: how the format works, how to tune for signal over noise, and detection-as-code.

In this article

Detection engineering is the discipline of turning knowledge about adversary behavior into reliable, maintainable alerts that fire on real threats and stay quiet on everything else. Sigma is the open, vendor-neutral rule format that has become the lingua franca of this work: you write a detection once in YAML and convert it to the query language of whatever SIEM you run. This guide is a defensive, forensics-oriented walkthrough of how to build detections with Sigma and your SIEM — how the format works, how to source good detection ideas, how to tune for signal over noise, how to test that a rule actually fires, and how to operate the whole thing as code so your detections stay versioned, reviewed, and reproducible.

What detection engineering is

A SIEM (Security Information and Event Management) platform aggregates logs from across your estate — endpoints, servers, network devices, cloud services, identity providers — and lets you query and correlate them. Detection engineering is what makes that data useful: it is the deliberate process of hypothesizing an adversary technique, identifying the telemetry that would reveal it, encoding that logic as a rule, validating the rule against real and simulated data, and maintaining it over time. Done well, it produces a curated library of high-fidelity detections mapped to a framework like MITRE ATT&CK. Done poorly, it produces a flood of low-value alerts that analysts learn to ignore, which is worse than no alert at all.

Why Sigma and how the format works

Before Sigma, every detection was locked to one vendor's query syntax, so sharing detections across teams or migrating SIEMs meant rewriting everything. Sigma solves this by describing detections in a structured YAML format that a converter translates into your backend's native query. A Sigma rule has a few core sections. logsource declares which telemetry the rule applies to, for example process-creation events on Windows. The detection block contains named selections — sets of field-value conditions — and a condition that combines them with boolean logic, including negation to carve out known-good activity. Rules also carry metadata: a title, a stable id, a level (severity), a description, tags that map to ATT&CK techniques, and falsepositives that document expected benign triggers. Because the logic is declarative and portable, a well-written Sigma rule is both a detection and a piece of documentation.

Sourcing good detection ideas

Strong detections start from an understanding of adversary behavior, not from random log fields. Anchor your work to MITRE ATT&CK so every rule maps to a named technique and you can see your coverage as a matrix. Draw ideas from threat intelligence reports, public detection repositories, incident post-mortems, and red-team or purple-team exercises. Prefer detections based on behavior over brittle indicators: hashes and IP addresses change with every campaign, but the technique — for example a service being created to establish persistence, or a tool spawning an unexpected child process — is far more durable. A useful mental model is the pyramid of pain: detections that force an adversary to change their tools and tradecraft cost them far more than detections they can evade by swapping an indicator.

Detection sources and required telemetry

A rule is only as good as the log it queries, so detection engineering is inseparable from logging strategy. On Windows, rich process telemetry (including command-line arguments and parent-child relationships), PowerShell script-block logging, and authentication events are foundational; a well-configured endpoint agent or Sysmon dramatically improves visibility. On Linux, audit logs and endpoint telemetry play the same role. Cloud and identity sources — control-plane audit logs, sign-in logs, and API activity — are essential for modern detections. The practical implication is that before writing a rule you must confirm the required fields are actually being collected and normalized; a beautiful detection over telemetry you do not ingest is a detection that never fires. Build a log-source inventory and treat gaps in it as detection debt.

Tuning: signal over noise

The hardest part of detection engineering is not writing a rule that catches the threat, it is writing one that does not drown analysts in false positives. Every rule should be tuned against your real environment. Start broad to confirm the behavior is detectable, then add exclusions for legitimate sources — the specific service accounts, administrative tools, or scheduled tasks that generate the same pattern benignly — using Sigma's negation in the condition. Document each exclusion in the falsepositives field so the next engineer understands why it exists. Set the level honestly: reserve high severity for detections that warrant immediate response, and route noisier, lower-confidence rules to enrichment or correlation rather than a pager. Track each rule's alert volume and true-positive rate over time; a rule that only ever fires false positives is a candidate for tuning or retirement, and a rule that never fires at all may be broken.

Testing that a detection actually works

A rule you have never seen fire is a hope, not a detection. Validate rules the way you validate code. Use recorded or synthetic log samples that contain the target behavior and confirm the rule matches them, and use benign samples to confirm it does not. Adversary-emulation frameworks let you safely generate the telemetry a technique produces in a controlled lab so you can verify end-to-end that the event is logged, ingested, and alerted on — this is the essence of purple teaming. Crucially, include a negative test and a deliberate known-good sample: a detection that matches everything is as useless as one that matches nothing. Re-run your test suite whenever log formats, field mappings, or the rule itself change, because a silent schema drift can disable a detection without any error.

Detection-as-code operations

Treat detections as software. Keep your Sigma rules in version control so every change is reviewed, attributed, and revertible. Run a CI pipeline that lints rule syntax, validates the schema, checks that each rule converts cleanly to your SIEM's query language, and runs the rule against test data. Require peer review before a detection reaches production, just as you would for application code. Deploy through automation rather than hand-editing rules in the SIEM console, so production always matches the repository and there is no undocumented drift. Track coverage against ATT&CK as a living metric, record each rule's tuning history, and schedule periodic reviews to retire dead rules and revisit noisy ones. This detection-as-code approach turns a fragile pile of console rules into a maintainable, auditable, and portable detection library.

Common pitfalls

Detection programs stumble in predictable ways. They write rules against telemetry they do not actually collect, producing detections that can never fire. They chase brittle indicators — specific hashes and IPs — and wonder why coverage evaporates with each new campaign. They deploy rules without tuning, bury analysts in false positives, and then disable the noise instead of refining it. They never test, so a field-mapping change silently blinds a critical detection. They optimize for the number of rules rather than the value of alerts, mistaking a large rule count for good coverage. And they let rules rot without review, accumulating dead detections that create false confidence. The antidote to all of these is behavior-based rules, verified telemetry, honest tuning, real testing, and detection-as-code discipline.

Detection engineering checklist

Use this as a recurring workflow. Map each detection to an ATT&CK technique and track coverage as a matrix. Confirm the required telemetry is collected and normalized before writing the rule. Write portable Sigma with clear selections, honest severity, ATT&CK tags, and documented false positives. Tune against your real environment and add exclusions with rationale. Test every rule with positive and negative samples, and validate end-to-end with adversary emulation in a lab. Store rules in version control with peer review and CI validation. Deploy through automation so production matches the repo. Monitor each rule's volume and true-positive rate. Schedule periodic reviews to retire dead rules and refine noisy ones. Repeat continuously as your environment and the threat landscape change.

FAQ: Does Sigma replace my SIEM's native rules?

No — Sigma is a portable source format that compiles down to your SIEM's native queries; it does not replace the platform, it makes your detection logic vendor-neutral and shareable. You author and manage detections as Sigma in version control, then convert them into whatever query language your SIEM uses for deployment. The benefit is that your detection library survives a SIEM migration, can be shared with the community and consumed from public repositories, and is reviewed and tested as code rather than clicked together in a console. Some detections that need platform-specific correlation may still be authored natively, but the portable core belongs in Sigma.

FAQ: How many detection rules should we have?

The right question is not how many rules but how much high-fidelity coverage of the techniques relevant to your threat model. A few hundred well-tuned, tested rules mapped to ATT&CK and generating actionable alerts are worth far more than thousands of noisy, untested ones that analysts ignore. Measure success by coverage of the techniques adversaries actually use against organizations like yours, by true-positive rate, and by mean time to detect — not by raw rule count. Prune aggressively: a dead or perpetually false-positive rule is a liability, not an asset.

Conclusion

Detection engineering with Sigma turns adversary knowledge into durable, portable, testable defenses. By anchoring rules to ATT&CK, confirming you collect the telemetry they need, tuning honestly for signal over noise, testing that each detection actually fires, and operating the whole library as code, you build a detection capability that improves over time instead of decaying into alert fatigue. The format is open and the practices are well established; what separates a strong program from a weak one is discipline — behavior over indicators, verified telemetry over assumptions, and continuous testing over hope. Build detections you have seen fire, keep them in version control, and your SIEM becomes an instrument that finds real threats rather than a firehose your analysts have learned to tune out.

Related posts

No comments yet

Be the first to comment.

Leave a comment

Sign in with your Canverly account to comment. You can use the same account on any site in the network.

Sign in with Canverly