Skip to main content
Glama

RSigma is a complete detection engineering toolkit for the Sigma detection standard, including a parser, evaluation engine, rule conversion, streaming runtime, linter, formatter, CLI, MCP, and LSP.

RSigma parses Sigma YAML rules into a strongly-typed AST, compiles them into optimized matchers, and evaluates them against log events in real time. It handles stateful correlation logic in-process with memory-efficient compressed event storage. Or as Zack Allen put it in DEW #149, "RSigma is essentially a SIEM."

You can send events in many formats, including JSON, syslog (RFC 3164/5424), logfmt, CEF, EVTX (Windows Event Log), plain text, and OTLP (OpenTelemetry Protocol), with auto-detection by default. pySigma-compatible processing pipelines handle field mapping and backend configuration. OTLP support lets any OpenTelemetry-compatible agent (Grafana Alloy, Vector, Fluent Bit, OTel Collector) forward logs to RSigma via HTTP or gRPC for detection.

For rule quality and editor integration, a built-in linter validates rules against 90 checks derived from the Sigma v2.1.0 specification, and an LSP server provides real-time diagnostics, completions, hover documentation, quick-fix code actions, and formatting in any editor.

RSigma builds on open industry standards throughout: Sigma for detection rules, OpenTelemetry for log ingestion and detection export, and STIX and TAXII for threat intelligence.

Full documentation, including guides, CLI reference, and library API docs, lives at rsigma.io.

Detection Engineering Loop

Supported Features

Author

  • Sigma parsing: Parses Sigma YAML into a strongly-typed AST with support for detection, correlation, and filter rules

  • Array matching (experimental): Matches members of arrays in nested event data with any/all-member semantics, same-element correlation, and positional indexing, opt-in via sigma-version: 3

  • Rule drafting: Drafts detection rules and temporal correlations from exemplar events contrasted against a baseline corpus with rule draft

  • Rule tuning: Proposes a spec-native filter from false-positive events, verifies that every known true positive still fires, and refuses unsafe separators with rule tune

  • Built-in linter: Validates rules with 90 checks, four severity levels, suppressions, custom tag namespaces, and auto-fix for 14 safe rules

  • Formatter: Rewrites rules into one canonical layout with rule fmt, keeps comments, and refuses any change to what a rule means

  • ADS metadata: Documents rules with Palantir ADS sections under rsigma.ads.*, enforced by the linter and scaffolded with rule doc

  • LSP server: Provides real-time diagnostics, completions, hover documentation, document symbols, quick-fix code actions, and formatting in VSCode, Neovim, and any LSP-capable editor

  • MCP server: Exposes the toolchain to AI agents (Cursor, Claude Code, ...) as structured MCP tools over stdio or Streamable HTTP with rsigma mcp serve

Test

  • Detection diagnostics: Explains why a rule did or did not match an event with engine explain, diffs pipeline transformations with pipeline diff, and introspects live correlation windows

  • Corpus backtesting: Replays an event corpus against declared per-rule expectations with rule backtest, emitting a JSON or JUnit XML report for CI

  • Output formats: Structured commands render JSON, NDJSON, table, CSV, or TSV with a TTY-aware default via a global --output-format flag; artifact and protocol commands keep their fixed wire format (see the per-command contract)

Deploy

  • CI integration: Gates a rule repository in one pull-request check with the timescale/rsigma-action GitHub Action, wrapping lint, validate, fields-drift diff, backtest, and coverage

  • Rulesets: Curates vendored rules into named rulesets with selectors, dependency policies, and metadata overlays, then materializes a reproducible build with a lockfile for the daemon or CI

  • Configuration: Layers settings from YAML config files, environment variables, and CLI flags, managed with the rsigma config command group

  • Signed artifacts: Ships multi-arch Docker images with cosign signatures, SBOM, and SLSA Build L3 provenance, plus prebuilt binaries for Linux, macOS, and Windows

Detect

  • Rule evaluation: Compiles rules into optimized matchers and evaluates them against events in real time, with stateless detection and stateful correlation (sliding/tumbling/session windows, group-by, chaining, suppression)

  • Streaming daemon: Runs as a long-lived detection daemon with hot-reload, Prometheus metrics, stdin/HTTP/NATS/OTLP/Unix-socket input, and async sinks (stdout, file, NATS, OTLP, webhook, Unix socket) with per-sink retry, DLQ, and a per-sink wire format (native NDJSON or OCSF Detection Finding JSON)

  • Input formats: Ingests JSON, syslog (RFC 3164/5424), logfmt, CEF, EVTX (Windows Event Log), plain text, and OTLP logs with format auto-detection

  • Processing pipelines: Maps fields and transforms rules with pySigma-compatible pipelines (transformations, conditions, finalizers)

  • Dynamic pipelines: Populates any pipeline value from external sources (HTTP, files, commands, NATS, TAXII, STIX bundles) with template expansion, auto-refresh, and extraction via jq, JSONPath, or CEL

  • STIX indicator sources: Polls a TAXII 2.1 collection or reads a STIX bundle and expands the observables into a pipeline value (stix-source)

  • Draft from a STIX indicator: Drafts Sigma rules from a STIX 2.1 bundle or one indicator (stix-draft)

  • Schema recognition: Recognizes which schema each event uses (ECS, Sysmon, CEF, OCSF, or user-defined) with engine classify, watches a live daemon for unrecognized sources, and mines candidate signatures with engine discover-schemas

  • Schema routing: Builds one engine per pipeline set and dispatches each classified event to its engine, feeding a shared correlation store

  • Logsource routing: Skips rules whose logsource conflicts with an event's declared product/service/category, so a mixed-product stream only pays for the rules that can match

  • Eval prefilters: Prunes large rule sets before evaluation with a bloom substring prefilter and a cross-rule Aho-Corasick index

  • NATS JetStream: Consumes and publishes over JetStream with authentication (credentials, mTLS), replay, consumer groups, and dead-letter queues

  • OTLP integration: Receives logs from any OpenTelemetry-compatible agent (Grafana Alloy, Vector, Fluent Bit, OTel Collector) via HTTP or gRPC, and exports detections to an OTLP collector

  • TLS termination: Terminates TLS in-process on the daemon API listener with optional mutual TLS and cross-platform certificate hot-reload, and refuses to expose a plaintext or unauthenticated API on a non-loopback address without an explicit opt-out

  • State persistence: Persists correlation, alert-pipeline, risk, and disposition state to SQLite with --state-db and restores it across restarts. The capture ring is not persisted.

  • Live operations: Inspects a running daemon with engine status, records replayable fixtures with engine tap, and streams live detections with engine tail

Alert & Triage

  • Enrichment: Injects context (asset info, IP reputation, identity, GeoIP, runbook URLs, ...) into detection and correlation results via template, lookup, http, command, stix, mmdb, and dns primitives

  • Risk-based alerting: Scores each firing per entity (user, host, source IP) and raises a single incident when an entity's accumulated risk crosses a threshold

  • Alert pipeline: Silences, inhibits, and deduplicates results, then groups the survivors into incidents, modeled on Alertmanager

  • Webhook alerts: Delivers detections to Slack, Teams, Discord, PagerDuty, or any HTTP endpoint with templated payloads, HMAC request signing, per-webhook retry, rate limiting, and DLQ

  • Triage feedback: Ingests analyst dispositions into a per-rule false-positive ratio that feeds the detection scorecard

  • Verdict-driven corpora: Retains admitted group_by detection events and writes TP/FP bundles after an accepted disposition for rule backtest and rule tune --from-dispositions

Measure

  • ATT&CK coverage: Exports an ATT&CK Navigator layer with rule coverage and reports gaps against Atomic Red Team, the SigmaHQ baseline, and a target technique list

  • Telemetry visibility: Scores data-source maturity with rule visibility, exporting DeTT&CT administration files and a Navigator layer that surfaces blind spots

  • Field observability: Surfaces which event fields no rule references and which rule fields never appear in events, live on the daemon or as a one-shot report from engine eval

  • Detection scorecard: Fuses backtest, coverage, production-volume, and triage signals with rule scorecard into per-rule keep/tune/retire verdicts

  • Rule hygiene: Flags retirement candidates with rule hygiene: silent, noisy, untagged, unowned, incomplete ADS, broken field coverage, or stale status

Hunt

  • Rule conversion: Converts rules into backend-native queries via a pluggable backend trait, with native PostgreSQL/TimescaleDB, LynxDB, and Fibratus backends plus sigma-cli delegation for 30+ pySigma backends (Splunk, Elasticsearch, Microsoft Sentinel, ...)

  • Hunt execution: Runs converted detection rules read-only against a PostgreSQL/TimescaleDB archive with hunt run and streams matching rows back as exemplar-shaped NDJSON that rule draft, rule tune, rule test, and rule backtest consume directly

  • Field catalog: Lists every field a ruleset references, before or after pipeline mapping, with rule fields

Related MCP server: wrg-sigma-rules

Crates

Crate

Description

rsigma-parser

Parse Sigma YAML into a strongly-typed AST

rsigma-ir

Intermediate representation shared by evaluation and conversion

rsigma-eval

Compile and evaluate rules against JSON events

rsigma-convert

Transform rules into backend-native query strings

rsigma-runtime

Streaming runtime with input adapters, log processor, and hot-reload

rsigma-mcp

Model Context Protocol (MCP) server exposing the toolchain as tools for AI agents

rsigma

CLI for parsing, validating, linting, formatting, evaluating, converting rules, field catalog, and running a detection daemon

rsigma-lsp

Language Server Protocol (LSP) server for IDE support

rstix

STIX 2.1 library: typed objects, bundle parse/stream, semantic validation, and pattern engine

NOTE

RSigma has been featured in:

  • Detection Engineering Weekly #149 (March 2026) "RSigma is essentially a SIEM. Building a tool like RSigma is challenging because the Sigma specification has evolved into a robust domain-specific language over the years."

  • tl;dr sec #320 (March 2026) "Accurately evaluating the full spectrum of what Sigma rules can express is quite complex. It's pretty neat to read about how RSigma handles all of these conditional expressions, correlating across rules, etc."

  • The Deep Purple Sec by BlackNoise (March 2026) "Defensive teams can pipe logs through CLI commands, apply field-mapping pipelines, and chain correlations for multi-stage attack detection."

  • Detection Engineering Weekly #154 (April 2026) "RSigma is not a SIEM, but it's an impressive feat to build a self-contained Rust binary that operates much like one. For teams doing pre-SIEM rule validation or forensics, it's a solid plug-and-play option."

  • Detection Engineering Weekly #157 (May 2026) "Instead of hardcoding IOC values in rule YAML, you declare external sources in the pipeline config, and RSigma fetches and injects them at evaluation time."

  • This Week in Rust 663 (August 2026) Featured the RSigma v0.20.0 release, The State of RSigma, and Part Two: The Loop.

  • Rust Bytes #139 (October 2026) Featured RSigma in the Project Spotlight.

Installation

Prebuilt binaries for Linux, macOS, and Windows (amd64 and arm64), with SLSA Build L3 provenance, are attached to every GitHub release.

Or install from crates.io:

# Install the CLI
cargo install --locked rsigma

# Install the LSP server
cargo install --locked rsigma-lsp

To build from source:

cargo build --release --all-features --workspace

Docker

Multi-arch images (linux/amd64, linux/arm64) are published to GHCR on every release, signed with cosign and carrying an SPDX SBOM and SLSA Build L3 provenance. See the Docker deployment guide.

docker pull ghcr.io/timescale/rsigma:latest
docker run --rm ghcr.io/timescale/rsigma:latest --help

Run with full runtime hardening:

docker run --rm \
  --read-only \
  --cap-drop=ALL \
  --security-opt=no-new-privileges:true \
  -v /path/to/rules:/rules:ro \
  ghcr.io/timescale/rsigma:latest rule validate /rules/

Verify the image signature:

cosign verify \
  --certificate-identity-regexp 'github.com/timescale/rsigma' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  ghcr.io/timescale/rsigma:latest

Quick Start

# Evaluate a single event against Sigma rules
rsigma engine eval -r rules/ -e '{"CommandLine": "cmd /c whoami"}'

# Stream NDJSON from stdin (auto-selected when stdout is piped)
cat events.ndjson | rsigma engine eval -r rules/

# Interactive triage in a terminal: width-aligned table view
rsigma engine eval -r rules/ -e @events.ndjson --output-format table

# Recognize which schema each event is (ECS, Sysmon, CEF, OCSF, ...)
cat events.ndjson | rsigma engine classify --output-format table

# Pipe a CSV view into a spreadsheet or data tool
rsigma engine eval -r rules/ -e @events.ndjson --output-format csv > matches.csv

# Run as a daemon with hot-reload and Prometheus metrics
rsigma engine daemon -r rules/ -p ecs.yml --api-addr 127.0.0.1:9090

# Accept events via HTTP POST (a non-loopback --api-addr also needs TLS and an API token)
rsigma engine daemon -r rules/ --input http --api-addr 127.0.0.1:9090

# Check a running daemon's status (rules loaded, events processed, uptime)
rsigma engine status

# Record 30s of a running daemon's live events to a replayable fixture
# (opt-in: start the daemon with --enable-tap)
rsigma engine tap --duration 30s --redact-fields user.email,src_ip -o fixture.ndjson

# Stream a running daemon's live detections to the terminal
# (opt-in: start the daemon with --enable-tail)
rsigma engine tail --level high

# Convert rules to PostgreSQL SQL for historical threat hunting
rsigma backend convert rules/ -t postgres

# Any non-native target delegates to sigma-cli when it is installed (pipx install sigma-cli)
rsigma backend convert rules/ -t splunk

# Draft a detection rule from exemplar events, contrasted against a baseline corpus
rsigma rule draft -e @incident.ndjson --baseline @normal-day.ndjson

# Draft a temporal correlation from grouped, timed exemplars
rsigma rule draft --groups @observed.ndjson --negative @benign.ndjson

# Backtest a corpus against per-rule expectations (CI fixture harness)
rsigma rule backtest -r rules/ --corpus ci/corpus/ --expectations ci/expectations.yml

# Map coverage onto MITRE ATT&CK: export a Navigator layer and gate on a target list
rsigma rule coverage -r rules/ --navigator coverage.json --targets threat-model.txt --fail-on-gaps

See the Quick Start guide for a guided tour and the CLI README for complete documentation of all subcommands and flags.

MCP Server (AI agents)

Expose the toolchain to MCP-aware agents (Cursor, Claude Code, ...) over stdio:

# Run the MCP server (register it in your agent's mcp.json / via `claude mcp add`)
rsigma mcp serve --rules-dir rules/

The agent then calls structured tools (parse_rule, lint_rules, validate_rules, evaluate_events, convert_rules, list_fields, ...) and gets back JSON. Point --daemon-url at a running daemon to add the Operate-cycle tools. See the MCP server guide.

To teach an agent the current CLI and that loop, install the skill (Sigma YAML authoring is a separate skill):

npx skills add timescale/sigma-rules -g -y
npx skills add timescale/rsigma -g -y

Library Usage

Use the crates directly from Rust:

use rsigma_parser::parse_sigma_yaml;
use rsigma_eval::Engine;
use rsigma_eval::event::JsonEvent;
use serde_json::json;

let yaml = r#"
title: Detect Whoami
logsource:
    product: windows
    category: process_creation
detection:
    selection:
        CommandLine|contains: 'whoami'
    condition: selection
level: medium
"#;

let collection = parse_sigma_yaml(yaml).unwrap();
let mut engine = Engine::new();
engine.add_collection(&collection).unwrap();

let event = JsonEvent::borrow(&json!({"CommandLine": "cmd /c whoami"}));
let matches = engine.evaluate(&event);
assert_eq!(matches[0].rule_title, "Detect Whoami");

Architecture

RSigma streaming detection architecture

A Sigma rule is parsed into a strongly-typed AST (rsigma-parser), lowered into a shared intermediate representation (rsigma-ir), then compiled and evaluated against live events (rsigma-eval inside rsigma-runtime), converted into backend-native queries (rsigma-convert), or served to editors and AI agents (rsigma-lsp, rsigma-mcp). The evaluation library also powers exemplar-driven rule drafting and verified filter tuning through the CLI and MCP. The full walkthrough, covering every module and all four execution shapes, lives in the Architecture reference.

RSigma crate dependency graph

Performance

RSigma is designed for high-throughput detection. On an Apple M4 Pro:

  • Parsing: 12.4 MiB/s for 1000 rules

  • Detection: 1.12M events/sec (JSON runtime pipeline, 100 rules)

  • Correlation: 501K events/sec (temporal + event-count)

  • Dynamic pipelines: 2.85M events/sec once built (no per-event overhead)

See BENCHMARKS.md for full Criterion results across all subsystems.

Reference

License

MIT

Available Tools

16 tools
author_adsB

Report each detection rule's ADS (Alerting and Detection Strategy) sections, the required sections it is missing under the active config, and a scaffolded rsigma.ads.* template to complete. Accepts inline yaml or a file path.

Inputs: path, yaml.

convert_rulesA

Convert Sigma rules to backend-native queries. target is one of postgres/lynxdb/fibratus (native); when the server runs with --allow-sigma-cli, any other target is delegated to an installed sigma-cli, reaching the full pySigma backend set. Accepts inline yaml or a file/directory path, optional pipelines, format, backend options, and skip_unsupported.

Inputs: target (required), path, yaml, format, +3 more.

evaluate_eventsA

Evaluate JSON events against Sigma rules and return matches. Detection-only rules use the stateless engine; collections with correlations use the stateful correlation engine. Rules via inline yaml or path; events via an inline events JSON array or an NDJSON events_path. Optional pipelines and match_detail (off/summary/full).

Inputs: path, yaml, events, enrichers, +6 more.

fix_rulesA

Apply safe auto-fixes (lowercase keys, status/level typos, duplicate removal, ...) to Sigma YAML, preserving comments and formatting. Returns the fixed YAML and applied/failed/skipped-unsafe counts. Unsafe fixes are never auto-applied. With write: true (only valid with a file path, and only when the server runs with --rules-dir) the change is persisted to disk. Optional lint_rules restricts which lint rules are fixed.

Inputs: path, yaml, write, lint_rules.

format_rulesA

Rewrite Sigma YAML into the canonical layout: four-space indentation, block collections, canonical key order, and normalized scalar quoting. Comments keep their text and their attachment, and anchors, aliases, tags, and directives are preserved. A semantic guard reparses the result and refuses the rewrite unless YAML values, parsed rules, correlations, filters, parser diagnostics, comment attachment, anchors, aliases, tags, directives, and action values all match. Returns the formatted YAML and whether it changed. Non-Sigma documents are reported as skipped. With write: true (only valid with a file path, and only when the server runs with --rules-dir) the change is persisted to disk.

Inputs: path, yaml, write.

lint_rulesA

Lint Sigma rules against the specification, returning findings with lint rule id, severity, message, line, and whether an auto-fix is available. Accepts inline yaml, a file path, or a directory path.

Inputs: path, yaml.

list_backendsA

List available conversion backends (targets) with their output formats and correlation methods. When the server runs with --allow-sigma-cli, installed sigma-cli targets are appended with engine "sigma-cli".

Inputs: no named parameters.

list_builtin_pipelinesA

List the builtin processing pipelines with their priority and shape.

Inputs: no named parameters.

list_fieldsA

List the event fields referenced by Sigma rules, with provenance (which rules and source kinds reference each field). Optional pipelines are applied first so the field names match what the engine evaluates. Accepts inline yaml or a file/directory path.

Inputs: path, yaml, pipelines, include_filters.

parse_conditionA

Parse a Sigma condition expression (e.g. selection and not 1 of filter_*) into a parse-tree as JSON, or return a structured parse error.

Inputs: condition (required).

parse_ruleA

Parse Sigma YAML (rules, correlations, filters; multi-document supported) into a structured AST as JSON, or return structured parse errors. Accepts inline yaml or a file path.

Inputs: path, yaml.

resolve_pipelineA

Resolve a processing pipeline (a builtin name like ecs_windows or a YAML file path) and report its name, priority, transformations, and dynamic sources. With resolve_sources, dynamic file/command/HTTP sources are resolved and their data keys reported.

Inputs: pipeline (required), resolve_sources.

reverse_convertA

Reverse-convert a SIEM query into a draft Sigma rule (YAML). dialect selects the source query language (lucene today, the Lucene / Elasticsearch query_string subset: field:value with wildcards, quoted phrases, /regex/, [a TO b] ranges, comparison shorthand, field:(a OR b) groups, exists, keyword terms, and AND/OR/NOT with grouping). A query carries no metadata, so pass title/id/level/status and at least one of logsource_product/category/service, which a Sigma rule requires; the result is a reviewable skeleton. Boosting, fuzzy/proximity, and non-numeric ranges are reported as errors.

Inputs: query (required), id, level, title, +5 more.

test_exemplarsA

Replay embedded rsigma.exemplars on Sigma detection and correlation rules and return pass/fail results. Provide exactly one of inline yaml or a path confined to --rules-dir. Optional pipelines are builtin names or confined YAML files. Shape, identity, and reference problems are configuration errors; a failed assertion is a finding, not a load error.

Inputs: path, yaml, pipelines.

tune_rulesA

Propose a spec-native Sigma filter rule from false-positive and true-positive JSON event arrays. Rules come from inline yaml or a path confined to --rules-dir; select the target with rule when needed. Optional pipelines transform the target before tuning. The result includes filter YAML, field rationale, clusters, coverage, and closed before/after verification. No proposal may suppress a true positive.

Inputs: true_positives (required), false_positives (required), path, rule, +10 more.

validate_rulesA

Validate that Sigma rules parse and compile cleanly: parse, build the detection engine, and check correlation references. Optional pipelines, resolve_sources (resolve dynamic sources), and fail_level (error by default; warning also fails on parse warnings such as an invalid status). Accepts inline yaml or a file/directory path.

Inputs: path, yaml, pipelines, fail_level, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 16 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes (format vs fix vs lint vs validate vs parse), and the long descriptions clarify the boundaries. The rule-checking cluster (validate_rules, lint_rules, parse_rule, parse_condition) and the event-replay pair (evaluate_events vs test_exemplars) have some overlap that could still trip up an agent at selection time.

    Naming Consistency4/5

    All names are snake_case with a verb_noun pattern (parse_rule, lint_rules, convert_rules, evaluate_events), which reads consistently. Minor deviation: reverse_convert lacks the _rules suffix used by sibling conversion/rule tools, and convert_rules vs reverse_convert aren't perfectly parallel.

    Tool Count4/5

    16 tools is slightly heavy but each maps to a genuine lifecycle step (resolve, parse, validate, lint, fix, format, convert, evaluate, tune, author). Nothing feels redundant or filler, though the set sits at the upper edge of comfortable scoping.

    Completeness5/5

    The Sigma rule lifecycle is thoroughly covered: parsing, validation, linting, fixing, formatting, bidirectional conversion, event evaluation, exemplar testing, tuning, ADS authoring, plus pipeline/backend/field discovery. No obvious dead ends for authoring, checking, or testing rules.

    Maintenance

    ActivityActive
    ResponsivenessUsually handled

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      C
      maintenance
      An MCP server that provides Sigma rule validation and configuration capabilities for AI assistants. It enables users to validate Sigma detection rules against various validators and manage validator configurations through MCP tools and resources.
      4
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Sigma detection rule writing, validation, and pySigma-based multi-backend conversion (Splunk, Elastic, Wazuh, Kibana) via 3 MCP tools and 3 Claude Code skills, backed by a 61-rule production corpus across 11 MITRE ATT\&CK tactic categories.
      3
      2
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      An MCP server that exposes a 60+ tool security and threat-intel stack to AI agents, enabling secret scanning, Sigma rule generation, ransomware lookup, OSINT, and deep research.
      1
      MIT