← Glossary

Threat Intel Concepts

Sigma rule

Also: Sigma · Sigma rules · SigmaHQ · generic signature format · pySigma · sigma-cli

In one sentence

A Sigma rule is a detection written once, in a small YAML format, that describes what to look for in which kind of log — and is then converted into the query language of whatever SIEM you happen to run.

Why it matters

Sigma is to log detections what STIX is to indicators and YARA is to files: the shared format. Before it, a detection written for Splunk was useless to a Sentinel shop and had to be reverse-engineered from a blog post. Now the SigmaHQ repository holds thousands of community rules, each tagged with the ATT&CK technique it detects, and a converter emits the SPL, KQL, AQL or Elastic query for your platform. Change SIEM and the rules come with you.

It also disciplines the writing. A rule must say which log source it needs, which makes the telemetry gap explicit: a rule for process_creation on Windows needs Sysmon Event 1 or audited 4688 with command lines, and if you do not collect that, the rule is fiction.

Anatomy of a rule

title: Office Application Spawning a Shell
id: 6f2a4e0c-3b1d-4d8e-9c7a-2f5e8b1a9d03
status: experimental
description: Detects Word, Excel or PowerPoint starting a command interpreter — typical macro phishing.
references:
  - https://attack.mitre.org/techniques/T1059/
author: Your SOC
date: 2026-09-19
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    ParentImage|endswith:
      - '\WINWORD.EXE'
      - '\EXCEL.EXE'
      - '\POWERPNT.EXE'
    Image|endswith:
      - '\cmd.exe'
      - '\powershell.exe'
      - '\wscript.exe'
  filter_signed_tool:
    CommandLine|contains: '\Program Files\FinanceMacro\'
  condition: selection and not filter_signed_tool
falsepositives:
  - Legitimate macros that launch scripts
level: high
tags:
  - attack.execution
  - attack.t1059
  - attack.initial_access
  - attack.t1566.001
  • logsource — abstract: category (process_creation, network_connection, dns_query, file_event…), product (windows, linux, aws…), service. The converter's pipeline maps this to the real index and field names.
  • detection — named selections of field/value pairs, with modifiers: |contains, |startswith, |endswith, |re, |all, |cidr, |base64offset. A list of values is OR; keys within one selection are AND.
  • condition — boolean logic over the selection names; 1 of selection_*, all of them, not filter. Correlation across events lives in separate correlation rules (Sigma v2).
  • level (informational–critical), status (experimental–stable), tags in the attack.tXXXX and attack.<tactic> form, and a UUID id so the rule can be referenced and updated.

Try it yourself hands-on

Write and ship the rule above without touching YAML by hand.

  1. Confirm the field names first. In the Windows Event ID Lookup, open Sysmon Event ID 1: the fields are Image, ParentImage, CommandLine, User, Hashes — the same names Sigma's process_creation category expects. If you rely on Security 4688 instead, the equivalent fields are NewProcessName and ParentProcessName, and the converter pipeline handles that mapping.
  2. Open the Sigma Rule Builder. Fill in title and description, choose logsource process_creation / windows, add a selection with ParentImage|endswith and the three Office binaries, then Image|endswith with the interpreters. Add a second selection as a filter for your known-good macro and set the condition to selection and not filter. Set level high and the four ATT&CK tags.
  3. Export. The builder writes the YAML and converts it to Splunk SPL, QRadar AQL and Microsoft Sentinel KQL. Paste the query for your SIEM into a saved search over the last 30 days first: the hits are your tuning list.
  4. Do not have Sysmon yet? The Sysmon Config Builder produces the config that emits Event ID 1 with parent and command line — the log source the rule declared. Hunting for the payload on disk is a different tool: the YARA Rule Builder covers file content, where Sigma covers logs.

Common misreadings

  • Sigma is not a query language and does not run anything. It is converted; a rule that converts is not a rule that works until the field mapping in the pipeline matches your data.
  • Community rules are a starting point, not a deployment. Import all 3,000 and you get 3,000 rules tuned for someone else's environment. Start with the techniques in your threat profile.
  • Case and paths. |endswith: '\cmd.exe' matches on Windows regardless of case in most backends but not all; check the converter's case-sensitivity rules for your target.