Skip to content
Back to search

rsigma

A complete Sigma detection engineering toolkit: parser, linter, evaluator, correlation engine, conversion framework, streaming daemon, MCP and LSP servers :crab:

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/timescale/rsigma with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/timescale/rsigma'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/timescale--rsigma/badge.svg)](/listings/timescale--rsigma)

HTML

<a href="/listings/timescale--rsigma"><img src="/api/listings/timescale--rsigma/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

Prebuilt binaries for Linux, macOS, and Windows (amd64 and arm64), with SLSA Build L3 provenance, are attached to every [GitHub release](https://github.com/timescale/rsigma/releases/latest).

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](https://rsigma.io/deployment/docker/).

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

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 334 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. <p align="center">
  2. <a href="https://github.com/timescale/rsigma">
  3. <picture>
  4. <source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/timescale/rsigma/main/assets/rsigma-logotype-dark.svg" />
  5. <img src="https://raw.githubusercontent.com/timescale/rsigma/main/assets/rsigma-logotype.svg" alt="RSigma logotype" width="200"/>
  6. </picture>
  7. </a>
  8. <p align="center">A complete Sigma detection engineering toolkit</p>
  9. </p>
  10. <p align="center">
  11. <a href="https://github.com/timescale/rsigma/actions/workflows/ci.yml"><img src="https://github.com/timescale/rsigma/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
  12. <a href="https://rsigma.io"><img src="https://img.shields.io/badge/docs-website-blue" alt="Documentation" /></a>
  13. <a href="https://crates.io/crates/rsigma"><img src="https://img.shields.io/crates/v/rsigma.svg" alt="crates.io" /></a>
  14. <a href="https://github.com/timescale/rsigma/blob/main/Cargo.toml"><img src="https://img.shields.io/badge/MSRV-1.97.1-blue" alt="MSRV" /></a>
  15. <a href="https://ghcr.io/timescale/rsigma"><img src="https://img.shields.io/badge/ghcr.io-rsigma-blue?logo=docker" alt="Docker" /></a>
  16. <a href="https://github.com/timescale/rsigma/releases/latest"><img src="https://img.shields.io/github/v/release/timescale/rsigma" alt="GitHub Release" /></a>
  17. <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-green.svg" alt="License: MIT" /></a>
  18. <a href="https://github.com/rust-unofficial/awesome-rust#security-tools"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Rust" /></a>
  19. <a href="https://glama.ai/mcp/servers/timescale/rsigma"><img src="https://glama.ai/mcp/servers/timescale/rsigma/badges/score.svg" alt="rsigma MCP server score on Glama.ai" /></a>
  20. </p>
  21. RSigma is a complete detection engineering toolkit for the [Sigma](https://sigmahq.io/) detection standard, including a parser, evaluation engine, rule conversion, streaming runtime, linter, formatter, CLI, MCP, and LSP.
  22. 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](https://www.detectionengineering.net/i/191079258/detection-engineering-gem), "RSigma is essentially a SIEM."
  23. 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.
  24. 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.
  25. RSigma builds on open industry standards throughout: [Sigma](https://sigmahq.io/) for detection rules, [OpenTelemetry](https://opentelemetry.io/) for log ingestion and detection export, and [STIX](https://oasis-open.github.io/cti-documentation/stix/intro) and [TAXII](https://oasis-open.github.io/cti-documentation/taxii/intro) for threat intelligence.
  26. Full documentation, including guides, CLI reference, and library API docs, lives at [rsigma.io](https://rsigma.io/).
  27. ![Detection Engineering Loop](assets/detection-loop.svg)
  28. ## Supported Features
  29. ### Author
  30. * **[Sigma parsing](https://rsigma.io/library/parser/):** Parses Sigma YAML into a strongly-typed AST with support for detection, correlation, and filter rules
  31. * **[Array matching](https://rsigma.io/guide/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`
  32. * **[Rule drafting](https://rsigma.io/guide/rule-drafting/):** Drafts detection rules and temporal correlations from exemplar events contrasted against a baseline corpus with `rule draft`
  33. * **[Rule tuning](https://rsigma.io/guide/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`
  34. * **[Built-in linter](https://rsigma.io/guide/linting-rules/):** Validates rules with 90 checks, four severity levels, suppressions, custom tag namespaces, and auto-fix for 14 safe rules
  35. * **[Formatter](https://rsigma.io/guide/formatting-rules/):** Rewrites rules into one canonical layout with `rule fmt`, keeps comments, and refuses any change to what a rule means
  36. * **[ADS metadata](https://rsigma.io/guide/detection-strategy/):** Documents rules with [Palantir ADS](https://github.com/palantir/alerting-detection-strategy-framework) sections under `rsigma.ads.*`, enforced by the linter and scaffolded with `rule doc`
  37. * **LSP server:** Provides real-time diagnostics, completions, hover documentation, document symbols, quick-fix code actions, and formatting in [VSCode](https://rsigma.io/editors/vscode/), [Neovim](https://rsigma.io/editors/neovim/), and any LSP-capable editor
  38. * **[MCP server](https://rsigma.io/guide/mcp-server/):** Exposes the toolchain to AI agents (Cursor, Claude Code, ...) as structured MCP tools over stdio or Streamable HTTP with `rsigma mcp serve`
  39. ### Test
  40. * **[Detection diagnostics](https://rsigma.io/cli/engine/explain/):** 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
  41. * **[Corpus backtesting](https://rsigma.io/cli/rule/backtest/):** Replays an event corpus against declared per-rule expectations with `rule backtest`, emitting a JSON or JUnit XML report for CI
  42. * **[Output formats](https://rsigma.io/reference/output/):** 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)
  43. ### Deploy
  44. * **[CI integration](https://rsigma.io/guide/ci-cd/):** Gates a rule repository in one pull-request check with the [`timescale/rsigma-action`](https://github.com/timescale/rsigma-action) GitHub Action, wrapping lint, validate, fields-drift diff, backtest, and coverage
  45. * **[Rulesets](https://rsigma.io/guide/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
  46. * **[Configuration](https://rsigma.io/reference/configuration/):** Layers settings from YAML config files, environment variables, and CLI flags, managed with the `rsigma config` command group
  47. * **[Signed artifacts](https://rsigma.io/deployment/docker/):** Ships multi-arch Docker images with cosign signatures, SBOM, and SLSA Build L3 provenance, plus prebuilt binaries for Linux, macOS, and Windows
  48. ### Detect
  49. * **[Rule evaluation](https://rsigma.io/guide/evaluating-rules/):** 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)
  50. * **[Streaming daemon](https://rsigma.io/guide/streaming-detection/):** 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](https://rsigma.io/guide/ocsf-findings/) JSON)
  51. * **[Input formats](https://rsigma.io/guide/input-formats/):** Ingests JSON, syslog (RFC 3164/5424), logfmt, CEF, EVTX (Windows Event Log), plain text, and OTLP logs with format auto-detection
  52. * **[Processing pipelines](https://rsigma.io/guide/processing-pipelines/):** Maps fields and transforms rules with pySigma-compatible pipelines (transformations, conditions, finalizers)
  53. * **[Dynamic pipelines](https://rsigma.io/reference/dynamic-sources/):** Populates any pipeline value from external sources (HTTP, files, commands, NATS) with template expansion, auto-refresh, and extraction via jq, JSONPath, or CEL
  54. * **[Schema recognition](https://rsigma.io/cli/engine/classify/):** 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`
  55. * **[Schema routing](https://rsigma.io/guide/schema-routing/):** Builds one engine per pipeline set and dispatches each classified event to its engine, feeding a shared correlation store
  56. * **[Logsource routing](https://rsigma.io/guide/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
  57. * **[Eval prefilters](https://rsigma.io/guide/performance-tuning/):** Prunes large rule sets before evaluation with a bloom substring prefilter and a cross-rule Aho-Corasick index
  58. * **[NATS JetStream](https://rsigma.io/guide/nats-streaming/):** Consumes and publishes over JetStream with authentication (credentials, mTLS), replay, consumer groups, and dead-letter queues
  59. * **[OTLP integration](https://rsigma.io/guide/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
  60. * **[TLS termination](https://rsigma.io/reference/security/):** 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
  61. * **[State persistence](https://rsigma.io/guide/streaming-detection/):** Persists correlation, alert-pipeline, risk, and disposition state to SQLite with `--state-db` and restores it across restarts. The capture ring is not persisted.
  62. * **Live operations:** Inspects a running daemon with [`engine status`](https://rsigma.io/cli/engine/status/), records replayable fixtures with [`engine tap`](https://rsigma.io/cli/engine/tap/), and streams live detections with [`engine tail`](https://rsigma.io/cli/engine/tail/)
  63. ### Alert & Triage
  64. * **[Enrichment](https://rsigma.io/guide/enrichers/):** 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
  65. * **[Risk-based alerting](https://rsigma.io/guide/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
  66. * **[Alert pipeline](https://rsigma.io/guide/alert-pipeline/):** Silences, inhibits, and deduplicates results, then groups the survivors into incidents, modeled on Alertmanager
  67. * **[Webhook alerts](https://rsigma.io/guide/webhooks/):** Delivers detections to Slack, Teams, Discord, PagerDuty, or any HTTP endpoint with templated payloads, HMAC request signing, per-webhook retry, rate limiting, and DLQ
  68. * **[Triage feedback](https://rsigma.io/guide/triage-feedback/):** Ingests analyst dispositions into a per-rule false-positive ratio that feeds the detection scorecard
  69. * **[Verdict-driven corpora](https://rsigma.io/guide/verdict-to-corpus/):** Retains admitted `group_by` detection events and writes TP/FP bundles after an accepted disposition for `rule backtest` and `rule tune --from-dispositions`
  70. ### Measure
  71. * **[ATT&CK coverage](https://rsigma.io/guide/attack-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
  72. * **[Telemetry visibility](https://rsigma.io/guide/visibility-and-data-sources/):** Scores data-source maturity with `rule visibility`, exporting [DeTT&CT](https://github.com/rabobank-cdc/DeTTECT) administration files and a Navigator layer that surfaces blind spots
  73. * **[Field observability](https://rsigma.io/guide/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`
  74. * **[Detection scorecard](https://rsigma.io/guide/detection-scorecard/):** Fuses backtest, coverage, production-volume, and triage signals with `rule scorecard` into per-rule keep/tune/retire verdicts
  75. * **[Rule hygiene](https://rsigma.io/guide/rule-hygiene/):** Flags retirement candidates with `rule hygiene`: silent, noisy, untagged, unowned, incomplete ADS, broken field coverage, or stale status
  76. ### Hunt
  77. * **[Rule conversion](https://rsigma.io/guide/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, ...)
  78. * **[Hunt execution](https://rsigma.io/guide/hunting/):** 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
  79. * **[Field catalog](https://rsigma.io/cli/rule/fields/):** Lists every field a ruleset references, before or after pipeline mapping, with `rule fields`
  80. ## Crates
  81. | Crate | Description |
  82. |-------|-------------|
  83. | [`rsigma-parser`](crates/rsigma-parser/) | Parse Sigma YAML into a strongly-typed AST |
  84. | [`rsigma-ir`](crates/rsigma-ir/) | Intermediate representation shared by evaluation and conversion |
  85. | [`rsigma-eval`](crates/rsigma-eval/) | Compile and evaluate rules against JSON events |
  86. | [`rsigma-convert`](crates/rsigma-convert/) | Transform rules into backend-native query strings |
  87. | [`rsigma-runtime`](crates/rsigma-runtime/) | Streaming runtime with input adapters, log processor, and hot-reload |
  88. | [`rsigma-mcp`](crates/rsigma-mcp/) | Model Context Protocol (MCP) server exposing the toolchain as tools for AI agents |
  89. | [`rsigma`](crates/rsigma-cli/) | CLI for parsing, validating, linting, formatting, evaluating, converting rules, field catalog, and running a detection daemon |
  90. | [`rsigma-lsp`](crates/rsigma-lsp/) | Language Server Protocol (LSP) server for IDE support |
  91. | [`rstix`](crates/rstix/) | STIX 2.1 library: typed objects, bundle parse/stream, semantic validation, and pattern engine |
  92. > [!TIP]
  93. > To learn more about RSigma, watch [Detection Engineering with RSigma](https://www.youtube.com/watch?v=cqeYdA39qv0) from Linux Security Summit Europe 2026 ([talk page](https://lsseu2026.sched.com/event/2WHc4), [slides](https://hosted-files.sched.co/lsseu2026/d0/talk.pdf), [demo and materials](https://github.com/mostafa/rsigma-lss-eu-2026-talk)), and read these articles:
  94. >
  95. > - [Pattern Detection and Correlation in JSON Logs](https://mostafa.dev/pattern-detection-and-correlation-in-json-logs-fab16334e4ee)
  96. > - [Streaming Logs to RSigma for Real-Time Detection](https://mostafa.dev/streaming-logs-to-rsigma-for-real-time-detection-72084b8041ad)
  97. > - [Building a Detection Layer on PostgreSQL with Sigma Rules](https://mostafa.dev/building-a-detection-layer-on-postgresql-with-sigma-rules-042caeb42b2a)
  98. > - [Security Observability with RSigma and the LGTM Stack](https://mostafa.dev/security-observability-with-rsigma-and-the-lgtm-stack-375ccd260795)
  99. > - [Wiring Live Threat Intel into Sigma Detection with Dynamic Pipelines](https://mostafa.dev/wiring-live-threat-intel-into-sigma-detection-with-dynamic-pipelines-4de29b4af7ca)
  100. > - [Cloud Detection at Scale on a Laptop](https://mostafa.dev/cloud-detection-at-scale-on-a-laptop-e46540322856)
  101. > - [The State of RSigma](https://mostafa.dev/the-state-of-rsigma-7ba0a99020d9)
  102. > - [Detection-as-Code in One GitHub Action with RSigma](https://mostafa.dev/detection-as-code-in-one-github-action-with-rsigma-0ebfb4c857fa)
  103. > - [The State of RSigma, Part Two: The Loop](https://mostafa.dev/the-state-of-rsigma-part-two-the-loop-c114f379dd78)
  104. > [!NOTE]
  105. > RSigma has been featured in:
  106. >
  107. > - [Detection Engineering Weekly #149](https://www.detectionengineering.net/i/191079258/detection-engineering-gem) (March 2026)
  108. > *"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."*
  109. > - [tl;dr sec #320](https://tldrsec.com/p/tldr-sec-320#blue-team) (March 2026)
  110. > *"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."*
  111. > - [The Deep Purple Sec by BlackNoise](https://www.blacknoise.co/the-deep-purple-sec-march-2026/) (March 2026)
  112. > *"Defensive teams can pipe logs through CLI commands, apply field-mapping pipelines, and chain correlations for multi-stage attack detection."*
  113. > - [Detection Engineering Weekly #154](https://www.detectionengineering.net/i/195467950/state-of-the-art) (April 2026)
  114. > *"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."*
  115. > - [Detection Engineering Weekly #157](https://www.detectionengineering.net/p/dew-157-shai-hulud-goes-open-source) (May 2026)
  116. > *"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."*
  117. > - [This Week in Rust 663](https://this-week-in-rust.org/blog/2026/08/05/this-week-in-rust-663/) (August 2026)
  118. > Featured the [RSigma v0.20.0 release](https://github.com/timescale/rsigma/releases/tag/v0.20.0), [The State of RSigma](https://mostafa.dev/the-state-of-rsigma-7ba0a99020d9), and [Part Two: The Loop](https://mostafa.dev/the-state-of-rsigma-part-two-the-loop-c114f379dd78).
  119. > - [Rust Bytes #139](https://weeklyrust.substack.com/p/whats-new-in-1990) (October 2026)
  120. > Featured RSigma in the Project Spotlight.
  121. ## Installation
  122. Prebuilt binaries for Linux, macOS, and Windows (amd64 and arm64), with SLSA Build L3 provenance, are attached to every [GitHub release](https://github.com/timescale/rsigma/releases/latest).
  123. Or install from crates.io:
  124. ```bash
  125. # Install the CLI
  126. cargo install --locked rsigma
  127. # Install the LSP server
  128. cargo install --locked rsigma-lsp
  129. ```
  130. To build from source:
  131. ```bash
  132. cargo build --release --all-features --workspace
  133. ```
  134. ### Docker
  135. 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](https://rsigma.io/deployment/docker/).
  136. ```bash
  137. docker pull ghcr.io/timescale/rsigma:latest
  138. docker run --rm ghcr.io/timescale/rsigma:latest --help
  139. ```
  140. Run with full runtime hardening:
  141. ```bash
  142. docker run --rm \
  143. --read-only \
  144. --cap-drop=ALL \
  145. --security-opt=no-new-privileges:true \
  146. -v /path/to/rules:/rules:ro \
  147. ghcr.io/timescale/rsigma:latest rule validate /rules/
  148. ```
  149. Verify the image signature:
  150. ```bash
  151. cosign verify \
  152. --certificate-identity-regexp 'github.com/timescale/rsigma' \
  153. --certificate-oidc-issuer https://token.actions.githubusercontent.com \
  154. ghcr.io/timescale/rsigma:latest
  155. ```
  156. ## Quick Start
  157. ```bash
  158. # Evaluate a single event against Sigma rules
  159. rsigma engine eval -r rules/ -e '{"CommandLine": "cmd /c whoami"}'
  160. # Stream NDJSON from stdin (auto-selected when stdout is piped)
  161. cat events.ndjson | rsigma engine eval -r rules/
  162. # Interactive triage in a terminal: width-aligned table view
  163. rsigma engine eval -r rules/ -e @events.ndjson --output-format table
  164. # Recognize which schema each event is (ECS, Sysmon, CEF, OCSF, ...)
  165. cat events.ndjson | rsigma engine classify --output-format table
  166. # Pipe a CSV view into a spreadsheet or data tool
  167. rsigma engine eval -r rules/ -e @events.ndjson --output-format csv > matches.csv
  168. # Run as a daemon with hot-reload and Prometheus metrics
  169. rsigma engine daemon -r rules/ -p ecs.yml --api-addr 127.0.0.1:9090
  170. # Accept events via HTTP POST (a non-loopback --api-addr also needs TLS and an API token)
  171. rsigma engine daemon -r rules/ --input http --api-addr 127.0.0.1:9090
  172. # Check a running daemon's status (rules loaded, events processed, uptime)
  173. rsigma engine status
  174. # Record 30s of a running daemon's live events to a replayable fixture
  175. # (opt-in: start the daemon with --enable-tap)
  176. rsigma engine tap --duration 30s --redact-fields user.email,src_ip -o fixture.ndjson
  177. # Stream a running daemon's live detections to the terminal
  178. # (opt-in: start the daemon with --enable-tail)
  179. rsigma engine tail --level high
  180. # Convert rules to PostgreSQL SQL for historical threat hunting
  181. rsigma backend convert rules/ -t postgres
  182. # Any non-native target delegates to sigma-cli when it is installed (pipx install sigma-cli)
  183. rsigma backend convert rules/ -t splunk
  184. # Draft a detection rule from exemplar events, contrasted against a baseline corpus
  185. rsigma rule draft -e @incident.ndjson --baseline @normal-day.ndjson
  186. # Draft a temporal correlation from grouped, timed exemplars
  187. rsigma rule draft --groups @observed.ndjson --negative @benign.ndjson
  188. # Backtest a corpus against per-rule expectations (CI fixture harness)
  189. rsigma rule backtest -r rules/ --corpus ci/corpus/ --expectations ci/expectations.yml
  190. # Map coverage onto MITRE ATT&CK: export a Navigator layer and gate on a target list
  191. rsigma rule coverage -r rules/ --navigator coverage.json --targets threat-model.txt --fail-on-gaps
  192. ```
  193. See the [Quick Start guide](https://rsigma.io/getting-started/quick-start/) for a guided tour and the [CLI README](crates/rsigma-cli/) for complete documentation of all subcommands and flags.
  194. ### MCP Server (AI agents)
  195. Expose the toolchain to MCP-aware agents (Cursor, Claude Code, ...) over stdio:
  196. ```bash
  197. # Run the MCP server (register it in your agent's mcp.json / via `claude mcp add`)
  198. rsigma mcp serve --rules-dir rules/
  199. ```
  200. 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](https://rsigma.io/guide/mcp-server/).
  201. To teach an agent the current CLI and that loop, install the skill (Sigma YAML authoring is a separate skill):
  202. ```bash
  203. npx skills add timescale/sigma-rules -g -y
  204. npx skills add timescale/rsigma -g -y
  205. ```
  206. ### Library Usage
  207. Use the crates directly from Rust:
  208. ```rust
  209. use rsigma_parser::parse_sigma_yaml;
  210. use rsigma_eval::Engine;
  211. use rsigma_eval::event::JsonEvent;
  212. use serde_json::json;
  213. let yaml = r#"
  214. title: Detect Whoami
  215. logsource:
  216. product: windows
  217. category: process_creation
  218. detection:
  219. selection:
  220. CommandLine|contains: 'whoami'
  221. condition: selection
  222. level: medium
  223. "#;
  224. let collection = parse_sigma_yaml(yaml).unwrap();
  225. let mut engine = Engine::new();
  226. engine.add_collection(&collection).unwrap();
  227. let event = JsonEvent::borrow(&json!({"CommandLine": "cmd /c whoami"}));
  228. let matches = engine.evaluate(&event);
  229. assert_eq!(matches[0].rule_title, "Detect Whoami");
  230. ```
  231. ## Architecture
  232. ![RSigma streaming detection architecture](assets/architecture.svg)
  233. 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](https://rsigma.io/reference/architecture/).
  234. ![RSigma crate dependency graph](assets/internal_architecture.svg)
  235. ## Performance
  236. RSigma is designed for high-throughput detection. On an Apple M4 Pro:
  237. - **Parsing**: 12.4 MiB/s for 1000 rules
  238. - **Detection**: 1.12M events/sec (JSON runtime pipeline, 100 rules)
  239. - **Correlation**: 501K events/sec (temporal + event-count)
  240. - **Dynamic pipelines**: 2.85M events/sec once built (no per-event overhead)
  241. See [BENCHMARKS.md](BENCHMARKS.md) for full Criterion results across all subsystems.
  242. ## Reference
  243. - [pySigma](https://github.com/SigmaHQ/pySigma): reference Python implementation
  244. - [Sigma Specification V2.1.0](https://github.com/SigmaHQ/sigma-specification/tree/0c857d07da0e71eaaab2d667b3cce6f2c8469578/specification): formal specification
  245. - [sigma-rust](https://github.com/jopohl/sigma-rust): Pratt parsing approach
  246. - [sigmars](https://github.com/crowdalert/sigmars): correlation support patterns
  247. - [sigma_engine](https://github.com/SigmaHQ/sigma_engine): official SigmaHQ Rust library for parsing and matching Sigma rules against events
  248. - [pySigma-backend-sqlite](https://github.com/SigmaHQ/pySigma-backend-sqlite): SQLite backend for pySigma (inspiration for the PostgreSQL backend)
  249. - [pySigma-backend-athena](https://github.com/SigmaHQ/pySigma-backend-athena): AWS Athena backend for pySigma (SELECT fields, CTE-based correlation, sliding window patterns)
  250. ## License
  251. MIT

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.