Feature Flags

Feature Flags

rsigma is a workspace of nine library crates (rsigma-parser, rsigma-ir, rsigma-eval, rsigma-convert, rsigma-runtime, rsigma-mcp, rsigma-cli, rsigma-lsp, rstix), several of which expose Cargo features that gate optional dependencies and code paths. This page documents every feature, its default state, what it pulls in, and how to enable it when building from source.

The precompiled release archives and the GHCR Docker image are built with --all-features, so every feature documented here is available out of the box.

rsigma-cli

The crate that produces the rsigma binary.

Feature Default Pulls in What it enables
daemon yes rsigma-runtime, tokio, axum, prometheus, notify, rusqlite, tower-http engine daemon, the HTTP API server, /metrics, hot-reload, SQLite state persistence, and rule tune --from-dispositions. The default; disable only for a minimal engine eval/rule * build.
ocsf yes (via daemon) rsigma-runtime --finding-format ocsf on engine eval and rule backtest, which print each rule fire as an OCSF Detection Finding. Implied by daemon; enable it alone for an OCSF-capable batch build without the daemon. See OCSF Findings. Unreleased
mcp no rsigma-mcp (pulls in rmcp, schemars), tokio mcp serve, the Model Context Protocol server exposing the toolchain to AI agents. Opt-in: build with --features mcp. The prebuilt binaries and Docker image (--all-features) include it. See the MCP server guide.
daemon-nats no daemon + async-nats, tokio-stream, time, rsigma-runtime/nats NATS JetStream as --input and --output (and DLQ). All --nats-* flags. RSIGMA_CONSUMER_GROUP. See NATS Streaming.
daemon-otlp no daemon + prost, tonic, flate2, rsigma-runtime/otlp OTLP/HTTP and OTLP/gRPC receivers on /v1/logs, plus the OTLP output sink that exports detections over OTLP/HTTP and OTLP/gRPC. See OTLP Integration.
daemon-tls no daemon + rustls (aws-lc-rs), tokio-rustls, rustls-pki-types, x509-parser, hyper, hyper-util, tower-service Server-side TLS termination for the API listener (HTTP REST, /metrics, OTLP/HTTP, OTLP/gRPC) with optional mTLS client verification, SIGHUP-triggered cert hot-reload, and two extra Prometheus metrics. See TLS termination.
logfmt no rsigma-runtime/logfmt --input-format logfmt for the daemon and engine eval.
cef no rsigma-runtime/cef --input-format cef for ArcSight-style logs.
evtx no rsigma-runtime/evtx (dep on the evtx crate) Native .evtx file input via engine eval -e @file.evtx. See Input Formats.
daachorse-index no rsigma-eval/daachorse-index, optionally rsigma-runtime/daachorse-index The --cross-rule-ac flag for very large rule sets dominated by shared positive substrings. See Performance Tuning.
hunt-postgres no tokio-postgres, tokio-postgres-rustls, rustls-native-certs, tokio, tokio-stream hunt run --emit events: read-only hunt execution against PostgreSQL/TimescaleDB with TLS and DSN redaction. hunt run --emit sql works without it. See Hunting in the archive. Added in v0.22.0
taxii-sync no rstix (taxii-store, store-fs, validate), tokio taxii sync (paginated TAXII ingest) and taxii store (local bundle JSON → FsStore) with validate-on-ingest (producer_strict). See taxii sync and taxii store. Added in v0.23.0
stix-draft no rstix (pattern) rule draft --from-stix: draft Sigma rules from a STIX 2.1 bundle or one indicator. Does not start the daemon and does not link rstix into rsigma-eval. Without the feature the flag is absent from --help. Included in the prebuilt binaries and the Docker image (--all-features). See rule draft. Unreleased
stix-enrich no daemon, rstix (store, store-fs), rsigma-runtime/stix-enrich engine daemon --stix-store and enrichers type: stix for post-evaluation lookup against a local STIX store (same layout as taxii sync --store). See Enrichers. Added in v0.23.0
stix-source no daemon, rsigma-runtime/stix-source (rstix with taxii and pattern) type: taxii sources and format: stix on file and HTTP sources. The daemon rejects either without this feature and exits 3. See Dynamic Sources and Threat intel watchlists. Unreleased
mmdb-enrich no daemon, rsigma-runtime/mmdb-enrich Enrichers type: mmdb for post-evaluation lookup against an operator-supplied MaxMind DB file, with a generic record decode and an optional dotted-path field map. Included in the prebuilt binaries and the Docker image (--all-features). See Enrichers. Unreleased
mmdb-mmap no mmdb-enrich, rsigma-runtime/mmdb-mmap (memmap2) mmap: true on type: mmdb enrichers, which memory-maps the database instead of reading it into memory. A mapped file must be replaced by renaming a new file over it, never rewritten in place. Included in the prebuilt binaries and the Docker image (--all-features). See Enrichers. Unreleased
dns-enrich no daemon, rsigma-runtime/dns-enrich (hickory-resolver) Enrichers type: dns for post-evaluation forward and reverse DNS lookups over hickory-resolver, with a response cache and Prometheus metrics. Included in the prebuilt binaries and the Docker image (--all-features). See Enrichers. Unreleased

rsigma-eval

The detection and correlation engine. Used as a library and re-exported by rsigma-cli.

Feature Default Pulls in What it enables
parallel no rayon Parallel batch evaluation inside Engine::evaluate_batch. The CLI enables this by default through its dependency declaration.
daachorse-index no daachorse Cross-rule Aho-Corasick pre-filter. See above.

rsigma-runtime

The streaming runtime (event sources, sinks, daemon plumbing, dynamic pipelines).

Feature Default Pulls in What it enables
nats no async-nats, tokio-stream, time, futures NATS event source, sink, and dynamic source type.
otlp no opentelemetry-proto, prost OTLP log decoding.
logfmt no (none beyond the parser) logfmt input parser.
cef no (none beyond the parser) cef input parser.
evtx no evtx .evtx file reader.
uds no (Unix only) Unix-domain socket event source and sink. Pulled in by the CLI daemon feature on Unix.
daachorse-index no rsigma-eval/daachorse-index Cross-rule AC support when used from rsigma-runtime consumers.
stix-enrich no rstix (store, store-fs) type: stix enricher primitive and EnricherResources::stix_store. Pulled in by the CLI stix-enrich feature. Added in v0.23.0
stix-source no rstix (taxii, pattern) TAXII polling and format: stix bundle builds. Pulled in by the CLI stix-source feature. Unreleased
mmdb-enrich no maxminddb type: mmdb enricher primitive and the MmdbEnricher, MmdbDatabase, MmdbFields, and MmdbLookupError library surface. Pulled in by the CLI mmdb-enrich feature. Unreleased
mmdb-mmap no mmdb-enrich, maxminddb/mmap (memmap2) Memory-mapped databases for mmdb entries with mmap: true (EnricherConfig::mmap). Pulled in by the CLI mmdb-mmap feature. Unreleased
dns-enrich no hickory-resolver type: dns enricher primitive and the DnsEnricher, DnsRecordType, DnsResolverConfig, and SUPPORTED_DNS_RECORD_TYPES library surface. Pulled in by the CLI dns-enrich feature. Unreleased

rsigma-convert

The conversion engine. Used as a library and re-exported by rsigma-cli.

Feature Default Gates Enables
sigma-cli no nothing (std-only, no extra dependencies) The sigma_cli module: discovery of an external sigma-cli, the sigma convert argument mapping, and subprocess output classification. Consumed by rsigma-cli (backend convert delegation) and rsigma-mcp (the opt-in --allow-sigma-cli delegation); conversion itself stays native and in-process.

rsigma-parser

Feature Default Pulls in What it enables
fix yes yamlpath, yamlpatch The source-preserving lint::fix module and crate-root apply_fixes_to_source/SourceFixOutcome re-exports. Disable default features for parser/evaluator-only wasm32-unknown-unknown builds. Parsing, validation, lint diagnostics, and fix metadata remain available without it.
fmt yes tree-sitter, tree-sitter-yaml The comment-preserving formatter: the fmt module and crate-root format_yaml, format_yaml_range, FormatOutcome, RangeEdit, and FormatError re-exports. rsigma rule fmt and LSP formatting need it. Disable default features for wasm32-unknown-unknown builds.
schema no schemars schemars::JsonSchema derives on the config-facing types, including RulesetSpec and its selector and overlay types. rsigma-cli enables it so config schema covers the rulesets: section. Unreleased

rsigma-mcp

The Model Context Protocol server library. Gated into the CLI by the mcp feature above.

Feature Default Pulls in What it enables
http no axum, rmcp/transport-streamable-http-server serve_http, http_router, and their HttpOptions variants (serve_http_with, http_router_with) for Streamable HTTP (/mcp). Bearer-token auth and Host and Origin validation are configured by the caller; TLS for the listener is provided by rsigma-cli when built with daemon-tls.

rstix

STIX 2.1 library crate. Data Model + Serialization is complete with serde (default): typed objects, bundle parse/stream, advisory Bundle::validate, wire MUST at parse (DD-DM-001), and wire conformance (STIX 2.1). Pattern Engine is complete with pattern. Validation Pipeline is complete with validate (all twelve checks, conformance corpus, per-code diagnostic coverage). Graph + Marking + Store are complete with graph, marking, store, and store-fs. TAXII Client is available with taxii (see TAXII Client).

Feature Default Pulls in What it enables
serde yes serde, serde_json, idna, url, email_address, base64, encoding_rs Bundle::parse, parse_reader, serde on all model types, T1 advisory Bundle::validate, DD-DM-001 wire format checks on domain/email/url.
pattern no serde, base64, ipnet, regex, unicode-normalization Pattern::parse, Pattern::evaluate, Pattern::matches_single, Pattern::matches_single_with_bundle, Pattern::evaluate_observed_data, Pattern::canonical, IndicatorPattern STIX AST wiring at deserialize, PatternAst, ObservationContext, PatternScoType, PatternError, PatternMatchError. STIX Specification §9 Levels 1-3. See rstix Pattern Engine.
validate no serde, pattern Validator, ValidatorBuilder (with_allow_custom, with_parse_options, with_phase), ValidationPhase, structured STIX-E/W/I/H diagnostics, validate_json_str, validate_json_value, validate_bundle, validate_object. See Validation Pipeline.
graph no serde StixGraph, EdgeTraversal, RelationshipExpander, SRO + ref graph construction. See Graph + Marking + Store.
marking no serde MarkingResolver, TlpV2Level, granular selector resolution, disclosure checks.
store no serde StixStore, MemoryStore, StixQuery (typed + full-text search), ImportReport.
store-fs no store FsStore, filesystem-backed durable store.
taxii no serde, reqwest, tokio, secrecy, futures, hickory-resolver, p12-keystore, rustls stack TaxiiClient, TaxiiEnvelope, auth providers, pagination, retry, rustls TLS (PEM + PKCS#12 mTLS), DANE (dane_require_dnssec), DNS SRV. OASIS TAXII 2.1 HTTP client. See TAXII Client.
taxii-store no taxii, store TAXII collection ingest into a StixStore.

Without the serde feature, only Core Foundation APIs are available (typed IDs, vocab tables, programmatic model types; no bundle parsing). Enable pattern for the Pattern Engine (implies serde). Enable validate for the Validation Pipeline (cargo build -p rstix --features validate).

Building with features

Cargo install

# Default: daemon + everything that ships with it, no extras.
cargo install --locked rsigma

# Recommended for production: daemon + TLS + NATS + OTLP + EVTX + cross-rule AC.
cargo install --locked rsigma --features daemon-tls,daemon-nats,daemon-otlp,evtx,daachorse-index

# Match the prebuilt release archives and Docker image exactly.
cargo install --locked rsigma --all-features

Local development

# Workspace build with every feature on.
cargo build --release --all-features --workspace

# Run just the `engine daemon` tests with the NATS feature.
cargo test -p rsigma-cli --features daemon-nats

CI coverage

The repo’s ci.yml runs cargo check against the pinned MSRV, plus cargo clippy, cargo test, cargo doc, and the coverage job against --all-features, with a cross-platform cargo test --all-features matrix on Ubuntu, macOS, and Windows. A separate job builds rsigma-parser and rsigma-eval for wasm32-unknown-unknown with --no-default-features and then instantiates a linked module in a JavaScript-free runtime (Wasmtime). The check job also compiles the rsigma CLI and its tests with --no-default-features. There is no general per-feature opt-in matrix: every other gated dependency listed above is built on every push, but no job exercises, for example, daemon-nats in isolation.

If a feature combination matters to you (and especially if a build with --no-default-features or a single optional feature is part of your downstream pipeline) and CI does not currently exercise it, file an issue so a job can be added.

Detecting features at runtime

Added in v0.22.0

The binary embeds the rsigma crate’s enabled Cargo features at compile time. --help is not a detector: several features have no unique flag (evtx, logfmt, cef, daemon-otlp), and --input-format is a free string so clap never lists the gated values.

# One enabled feature per line (script-friendly).
rsigma --features
rsigma --features | grep -qx daemon-nats && echo on || echo off

# Same list on the version line and at the bottom of `--help`.
rsigma --version
rsigma --help

rsigma --features prints only the optional features of the rsigma binary (rsigma-cli table above), sorted, one name per line. Library-crate features (rsigma-eval, rsigma-runtime, rstix, and the rest) are not listed; they matter at compile time for embedders, not for an installed CLI. Prebuilt release archives and the GHCR Docker image print every rsigma-cli feature. A default cargo install rsigma prints daemon only.

See also