What is a detection rule? Sigma explained for beginners
A detection rule describes one kind of suspicious activity in logs. Sigma is the shared, tool-independent way to write such rules, so teams can exchange detections and convert them for whatever log system they run.
Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?
Every server, application and network device writes logs: who logged in, which process started, which file was read, which request arrived. Almost every security incident leaves traces in those logs. The problem is volume: a small environment produces millions of lines a day, and nobody can read them. A detection rule is the answer. It is a precise description of one pattern that is worth a human’s attention, written so that a machine can check every incoming log line against it and raise an alert when the pattern matches.
An analogy
Think of a smoke detector. It does not understand fire; it watches for one measurable signal, particles in the air above a threshold, and makes noise when it sees it. A detection rule is a smoke detector for logs: it watches for one signal, for example a user account created and added to the administrators group within a minute, and raises an alert. A good security team runs hundreds of such detectors, each tuned to one kind of smoke, and treats the alerts as the start of an investigation rather than proof that something is wrong.
Why a shared format matters
Until recently every log tool had its own query language. A rule written for Splunk could not be used in Elastic, and a rule written for Elastic was useless to a team running Grafana Loki. Detections were locked inside products, and every team wrote the same ones from scratch. Sigma fixes this by separating the description of the pattern from the query that implements it. You write the rule once in Sigma’s plain YAML format, and a converter turns it into the query language of your tool. The same rule file can therefore be published on GitHub, reviewed by other people, and adopted by teams running completely different systems. The public SigmaHQ rule library contains thousands of rules contributed this way, and many vendors ship Sigma support in their products.
What a Sigma rule contains
You do not need to write rules to benefit from them, but it helps to know the parts. Every Sigma rule has a title and a short description; a logsource section that says which kind of log it applies to, for example Windows security events or a web server access log; a detection section that states which field values, alone or in combination, make an event a match; and a level that says how serious a hit is, from informational to critical. Rules also carry metadata: an author, references to the research the rule is based on, tags that map it to the MITRE ATT&CK catalogue of attacker techniques, and a status that tells you whether it is experimental or well tested.
Where Sigma fits next to your log system
Sigma does not store or search logs. That remains the job of your log platform, whether that is Grafana Loki, Elastic, Splunk, Microsoft Sentinel or a plain Linux journal. The workflow looks like this:
- Logs are collected and shipped to a central store, as described in the monitoring topic of this encyclopedia.
- You pick rules from the public library or write your own in Sigma format.
- A converter, normally
sigma-cli, translates each rule into a query for your platform. - You run the query, either on a schedule as an alert rule in the platform or on demand when hunting through old data.
- Matches become alerts; a person looks at them and decides whether they are real.
You can see the library’s shape without installing anything beyond Git; the directory names alone show which platforms and log sources have community coverage:
git clone --depth 1 https://github.com/SigmaHQ/sigma.git
ls sigma/rules/
ls sigma/rules/linux/
Because the conversion depends on field names, most backends also need a small pipeline that maps Sigma’s standard field names onto the names your logs actually use. The how-to Try Sigma rules against your own logs shows this in practice.
What detection rules are not
- They are not proof. A match means the pattern occurred, not that an attacker caused it; many rules fire on legitimate administration.
- They are not complete. Attackers change their methods, and a rule library only covers what someone has already seen and described.
- They are not a replacement for hardening. A well-configured system produces fewer alerts and gives the ones that remain more meaning.
Official documentation
Did this work for you?
No votes yet. Be the first.
If it did not work, the report form below tells the editors what went wrong.
See also
- 0374 Alert rules that do not wake you for nothing How to design alerts people trust: alert on symptoms not causes, use for durations, separate page from ticket severities, group and inhibit… Intermediate · Explains an idea · Any system Article Alerting & dashboards 15 Oct 2026
- 0375 Fix: disk full, find what is eating the space A Linux filesystem reports 100 percent used or No space left on device. Find the culprit with df and du, check journals,… Intermediate · Fixes an error · Linux Article Alerting & dashboards · Disks, LVM & filesystems 15 Oct 2026
- 0432 Try Sigma rules against your own logs Install the sigma-cli converter, take a rule from the public SigmaHQ library, convert it into a query for a log tool you… Intermediate · Step by step · Linux, macOS Article Logs · Security resources & detection 15 Oct 2026
- 0433 What is an awesome list? Awesome lists are hand-curated link collections on GitHub, one per subject, that follow a shared convention. How they work, how to tell… Beginner · Explains an idea · Any system Article Security resources & detection 15 Oct 2026
- 0455 Which security tool does what? A map for beginners A beginner's map of open source security tool families: vulnerability scanners, secret detection, static analysis, host audits, web application testing, network inventory… Beginner · Explains an idea · Any system Article Security resources & detection · Server hardening 15 Oct 2026
Repos in the wild
- Uptime Kuma: self-hosted uptime monitoring louislam/uptime-kuma Uptime Kuma is a self-hosted monitoring tool with a web UI that checks websites, TCP ports, DNS, Docker containers and more, draws uptime history and sends alerts. One container is all it needs. GitHub
- Netdata: real-time, per-second monitoring with zero configuration netdata/netdata The Netdata repository: an agent that auto-discovers hundreds of metrics on Linux hosts, containers and common services, shows them per second in a built-in dashboard and ships with preconfigured alerts. GitHub
- Sigma: the open detection-rule format for log data SigmaHQ/sigma The SigmaHQ repository holds the vendor-neutral Sigma rule specification and a community library of thousands of detection rules that converters translate into queries for Splunk, Elastic, Loki and other log tools. GitHub
- awesome-security: a curated map of security tools and learning resources sbilly/awesome-security A long-running awesome list that groups security software, reading material, courses, conferences and communities by area, from network and endpoint defence to threat intelligence and usable security. GitHub
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Dominik +4,337 chars