Sigma Rules: A Practitioner's Guide
What Sigma rules are, how a rule is built, how pySigma converts it for your SIEM, where portability breaks, and how to test and review rules before you deploy them.
Last reviewed November 2026
Sigma is an open, vendor-neutral format for writing SIEM detection rules once, as plain text files, and converting them into the query language of whichever SIEM you run.
A Sigma rule says three things: which kind of log it applies to, which field values indicate the behavior, and how those conditions combine. A converter turns that into a Splunk search, a KQL query for Microsoft Sentinel or Defender, an Elastic query, or one of dozens of other targets. Sigma was started in 2017 by Florian Roth and Thomas Patzke, and the public SigmaHQ repository now holds thousands of community rules.
That is the whole pitch, and it is a good one. The catch is that the logic travels and the data does not. This guide covers both halves: how the format works, and what it takes to make a converted rule fire on your own telemetry. For where Sigma sits in the wider discipline, see our detection engineering guide.
Anatomy of a Sigma rule
A rule is a short structured text file with four parts that matter: metadata, the log source, the detection block, and the condition. Here is a small but realistic one, annotated.
title: Lsass memory dump via procdump
id: 5afee48e-67dd-4e03-a783-f74259dcf998 # stable identifier; keep it when you edit
status: test # experimental, test, stable, deprecated or unsupported
description: Detects procdump writing a full memory dump of lsass, a common credential theft step.
references:
- https://attack.mitre.org/techniques/T1003/001/
author: Your name
date: 2026-11-29
tags:
- attack.credential-access
- attack.t1003.001 # ATT&CK mapping, used for coverage reporting
logsource: # which telemetry the rule expects
category: process_creation
product: windows
detection:
selection_img: # a map: every field in it must match (and)
Image|endswith: # a value modifier changes how the value is compared
- '\procdump.exe' # a list: any value may match (or)
- '\procdump64.exe'
selection_cli:
CommandLine|contains|all: # all of these substrings must appear
- ' -ma '
- 'lsass'
condition: all of selection_* # how the named selections combine
falsepositives:
- Administrators capturing lsass dumps for crash analysis
level: high # informational, low, medium, high or critical
Metadata (title, id, status, description, references, author, tags, falsepositives, level) is what makes a rule reviewable and reportable. The status field tells you how much testing the author did, and falsepositives is the author's honest guess at what else will match.
The logsource names a category (here process_creation), a product, and sometimes a service. It is abstract on purpose: it says "process creation events from Windows", and leaves it to conversion to decide whether that means Sysmon event 1, Security event 4688, or an EDR table.
The detection block holds named selections. Within a selection, keys combine with and; within a list of values, entries combine with or. Modifiers such as contains, startswith, endswith, all, re, cidr and windash change how a value is compared. The field names are Sigma's own taxonomy, mostly borrowed from Sysmon: Image, CommandLine, ParentImage, TargetFilename.
The condition combines selections with boolean logic: selection and not filter, 1 of selection_*, all of them. Filters are where most tuning happens.
How conversion works: pySigma, backends and pipelines
The reference toolchain is pySigma, a Python library, and sigma-cli, the command-line tool built on it. It replaced the older sigmac converter, which you will still see in old blog posts. Conversion has two moving parts.
A backend knows one query language. It turns the parsed rule into syntax: Splunk SPL, Kusto for Sentinel and Defender, Lucene, EQL and ES|QL for Elastic, YARA-L for Google SecOps, and many more maintained by vendors and the community.
A processing pipeline knows one data model. Before the backend writes anything, the pipeline rewrites the rule to match how your logs are shaped. It maps field names (Image becomes process.executable for Elastic Common Schema, or FolderPath for Defender), adds conditions the logsource implies (a Sysmon pipeline adds EventID=1 for process creation), sets index or table names, and rejects rules that reference fields it cannot map. Pipelines stack, so a team usually runs a vendor pipeline plus a small one of its own.
A typical run looks like this:
sigma convert -t splunk -p sysmon lsass_procdump.yml
and produces something along these lines:
EventID=1 Image IN ("*\\procdump.exe", "*\\procdump64.exe") CommandLine="* -ma *" CommandLine="*lsass*"
The same rule through the Kusto backend with a Defender pipeline comes out against DeviceProcessEvents, with Image mapped to FolderPath and CommandLine to ProcessCommandLine. Same logic, different field names, different table. Field mapping happens in the pipeline, and the pipeline encodes assumptions about your data that nobody has checked yet.
Where portability breaks
A converted rule can be valid syntax, deploy cleanly, show as enabled, and match nothing for months. No error is raised, because nothing is wrong with the query. It is asking about data that is not there. In the Detection Debt Report, 29% of deployed, enabled rules across six SIEM platforms were broken, and this class of silent mismatch is one of the most common reasons.
The usual causes:
- Wrong source behind the logsource. The Sysmon pipeline assumes Sysmon. If your process creation events come from Security event 4688, the executable path lives in
NewProcessName, the query asks forImage, and every search comes back empty. - Normalisation that differs from the pipeline's. The
ecs_windowspipeline writesprocess.command_line. If your ingest keeps the rawwinlog.event_data.CommandLinefield and never maps it to the Elastic Common Schema, the converted rule is checking a field your index does not populate. - Value shape. The rule expects a full path and your source logs only the file name, or the reverse.
endswith '\procdump.exe'never matches the bare stringprocdump.exe. - Case and escaping. Splunk compares case-insensitively; an Elastic
keywordfield does not by default; Kusto==is case-sensitive whilecontainsis not. Backslashes in Windows paths get escaped differently by every backend. - Partial coverage. The field exists on servers and is empty on laptops because a different agent version ships there. The rule works in one place and nobody notices it is blind in the other.
None of this is a flaw in Sigma. A portable format has to assume a data shape, and your data is under no obligation to match it. Conversion is the start of deployment, and the pipeline is where most of the engineering effort belongs.
Sigma correlation rules
Single-event rules cannot express "many of these in a short window" or "this, then that". Sigma's version 2 specification added correlation rules for that. A correlation rule references one or more base rules by name or id and adds:
event_count: the base rule fires at least N times, grouped by a field, within a timespan (ten failed logons per user in five minutes).value_count: N distinct values of a field (one source address touching 50 hosts).temporal: several different base rules fire for the same group within a window, in any order.temporal_ordered: the same, in a set order.
Correlation rules close part of the gap with native languages, and backend support is uneven, so check that your backend converts them before you design around them.
What native languages still do that Sigma cannot express, or expresses poorly:
- Joins against lookups, asset inventories and identity data.
- Statistical baselines and anomaly scoring over weeks of history.
- Long stateful sequences across several data sources.
- Platform performance features, such as Splunk data model acceleration or Sentinel watchlists.
- Risk-based alerting, where many weak signals add up to one alert.
The pragmatic split most mature teams land on: keep the behavior description portable, and write natively where the platform gives you something Sigma cannot. Our pillar guide covers that trade-off in more depth.
Testing a converted rule on your own data
Treat every converted rule as a draft until it has been seen to work on your own telemetry. A short routine catches most problems.
- Validate the rule.
sigma checkcatches syntax and specification errors before conversion. - Read the generated query. Every time. Look at the field names, the table or index, and anything the pipeline added. If you would not have written that query by hand, find out why it looks the way it does.
- Prove the fields exist. Before running the full rule, count events in the last week where each referenced field is populated, for the logsource the rule assumes. Zero is your answer, and it is the most common one.
- Run a positive control. Generate the behavior in a lab or on a test host (an Atomic Red Team test usually exists for the technique) and confirm the converted rule fires on the events it produces.
- Backtest for noise. Run the rule over 30 to 90 days of history. The hit count tells you whether it is quiet enough to alert on or needs filters first.
- Re-test after pipeline changes. When you upgrade pySigma, change a pipeline, or a log source changes format, reconvert and repeat steps 2 to 4. A rule that worked at deployment can stop working without anyone touching it.
Where to find Sigma rules, and how to review them
The main source is the SigmaHQ rules repository, organised by product and category, with rules mapped to ATT&CK. Vendors and researchers publish more alongside their threat write-ups. Community rules are released under the Detection Rule License, which allows commercial use and requires attribution, so keep the author and reference fields when you adapt one.
Before deploying a community rule, review it as you would a pull request:
- Status and level.
experimentalmeans little real-world testing. Start those in a hunting or low-severity queue. - Logsource against your telemetry. Do you collect this source, through the pipeline you are converting with? If you cannot answer, stop here.
- False positives. Read the author's list, then think about your own estate: admin tooling, software deployment, backup agents.
- Evasion. Rules keyed on a file name are easy to dodge by renaming the binary. Prefer selections on command-line behavior, original file name, or parent-child relationships where your data supports them.
- References. Read the source the rule was written from. It often contains variants the rule does not cover.
- Ownership. Once deployed, the rule is yours. Give it an owner, a test, and a place in your coverage map.
Where Sigma fits
Sigma is the best format we have for sharing detection logic, and a converted rule is only as good as the field mapping behind it. The research that produced a rule (what the behavior is, what evidence it leaves, which telemetry can see it) is worth even more than the rule, and it is the part we publish openly in Delta Tradecraft: portable detection knowledge. Spectrum's detection engineering platform writes native queries to your own schema, and Sigma when a portable rule is what a team needs.
Whichever way you write it, the test is the same: does the rule fire on your data today, and will you find out when it stops?
Related guides
See what your environment is actually detecting
Spectrum maps your coverage, builds the detections you are missing, and keeps them working.