Configuration
Configuration
rsigma engine daemon, rsigma engine eval, rsigma rule backtest, rsigma rule coverage, rsigma rule scorecard, rsigma rule visibility, rsigma rule hygiene, and rsigma mcp serve can be driven by a YAML config file in addition to CLI flags and environment variables. This page describes the schema, the discovery chain, and the precedence model that decides which value wins when more than one layer sets the same key.
The same machinery is exposed through the rsigma config group for scaffolding, validation, introspection, and reload.
Precedence
From highest to lowest:
- CLI flags on the command line (e.g.
--rules /tmp/r). - Environment variables: uniform
RSIGMA_<SECTION>__<KEY>(see Environment layer) plus the legacy clap-bound names listed in Environment Variables. - Project config:
./rsigma.yaml(or./rsigma.yml) in the current directory, then the nearest.rsigmarcfound by walking up from the current directory. Project files cannot set the security-sensitive keys listed in Project config trust; those are ignored with a warning and resolve from the other layers. Added in v0.27.0 - User config:
$XDG_CONFIG_HOME/rsigma/config.yaml(defaulting to~/.config/rsigma/config.yaml). - System config:
/etc/rsigma/config.yaml. - Compiled defaults baked into the binary.
Higher layers override lower ones per leaf, not whole sections; a project .rsigmarc that only sets eval.rules does not erase the rest of the user config. This matches the clig.dev guidance and is what most modern CLIs implement.
Use rsigma config show to see the resolved value for every key with the layer that supplied it.
Discovery
All layers that exist are loaded and merged. There is no first-match-wins fallback: a file at /etc/rsigma/config.yaml is always loaded if it exists, even when a project rsigma.yaml is also present.
Passing --config <PATH> replaces the discovery chain entirely: only that file is loaded (and a bad path is a hard error, so misspellings surface immediately).
An unknown key in any loaded file stops the command with exit 3 and prints error: unknown config key '<key>' in <path> for each one. rsigma config validate lists them without running anything, and rsigma config show still prints the effective config.
Unreleased
The ~/.config/rsigma location is computed by honoring XDG_CONFIG_HOME explicitly rather than dirs::config_dir(), so on macOS the path stays under ~/.config/rsigma instead of ~/Library/Application Support/. The rsigma install workflow uses the same layout.
Project config trust
Added in v0.27.0A project file (./rsigma.yaml, ./rsigma.yml, or the nearest .rsigmarc above the current directory) ships with whatever repository is checked out, so running rsigma inside a cloned repository would otherwise let that repository configure the process. Project files can still set ordinary keys such as rule paths, pipelines, and output formats, but the keys below open a listener, a write path, a subprocess, or a network client, or weaken a guard, so rsigma ignores them when they come from a project file:
| Key | Why it is protected |
|---|---|
mcp.http_addr |
Starts a network listener instead of stdio. |
mcp.allow_unconfined_paths |
Lets tool calls read any file the server user can read. |
mcp.allow_sigma_cli |
Lets convert_rules spawn sigma-cli. |
mcp.daemon_url |
Points the operate tools, and the daemon token, at another server. |
mcp.daemon_ca |
Adds a trusted root CA for the daemon connection. |
mcp.allow_operate_writes |
Registers the mutating operate tools. |
mcp.rules_dir |
Only when it resolves outside the directory holding the project file, following symlinks. A rules directory inside the project is kept. |
mcp.lint_config |
Only when it resolves outside the directory holding the project file, following symlinks, because the server reads it at startup and prints parse errors. A lint config inside the project is kept. |
daemon.sources |
Dynamic sources can run command sources and make HTTP requests. |
daemon.enrichers |
Enrichers can run command enrichers and make HTTP requests. |
daemon.dispositions.source |
A disposition pull source is a dynamic source. |
daemon.output.sinks |
Sends detections to files, NATS, OTLP collectors, or sockets. |
daemon.output.dlq |
Sends failed events to a sink. |
daemon.output.webhooks |
Sends detections to HTTP endpoints. |
daemon.input.source |
Only when it names a NATS server, which the daemon would connect to with the operator’s NATS credentials, or a unix:// path outside the project. stdin, http, and unix:// inputs inside the project are kept. |
daemon.tenancy |
Turning tenancy off is the dangerous direction, so a project file may not set it at all. Unreleased |
daemon.input.tenant |
Binds the single pull source to a tenant. Unreleased |
daemon.input.nats_tenants |
Declares the tenant of each NATS subscription. Unreleased |
daemon.nats.consumer_group |
Joins another deployment’s durable consumer and pulls its messages. |
daemon.api.addr |
Unless it is a loopback host:port (127.0.0.1, ::1, localhost) or a unix:// path inside the project. Client commands such as engine incidents export send the API token to this address, and the daemon binds it. |
daemon.state.db |
Only when it resolves outside the project. The daemon creates and writes the SQLite file there. |
eval.output |
Only when it resolves outside the project. engine eval creates or truncates the file. |
scorecard.report |
Only when it resolves outside the project. rule scorecard creates or truncates the file. |
daemon.api.auth |
A planted token could name any environment variable, such as HOME, as its secret, and a project auth block replaces the operator’s. |
daemon.api.allow_unauthenticated |
Serves the API without authentication on a non-loopback address. |
daemon.api.tls.allow_plaintext |
Serves plaintext on a non-loopback address. |
daemon.api.tls.client_ca |
Decides which client certificates the API accepts. |
daemon.api.audit |
Can turn off the control-plane audit trail or send it to a sink. |
daemon.tap.enabled |
Streams raw events from GET /api/v1/tap. |
daemon.tail.enabled |
Streams detections from GET /api/v1/detections/stream. |
daemon.capture.enabled |
Retains raw event payloads for spooling. |
daemon.capture.spool_dir |
Decides where retained payloads are written. |
daemon.engine.egress_policy |
Can turn off the SSRF defense for HTTP sources and enrichers. |
daemon.engine.allow_remote_include |
Lets pipelines include remote (HTTP or NATS) sources. |
The boolean opt-ins in the table (mcp.allow_unconfined_paths, mcp.allow_sigma_cli, mcp.allow_operate_writes, daemon.api.allow_unauthenticated, daemon.api.tls.allow_plaintext, daemon.tap.enabled, daemon.tail.enabled, daemon.capture.enabled, and daemon.engine.allow_remote_include) are ignored only when a project file sets them to true. A project file may still set them to false.
Added in v0.27.0
Each ignored key prints a warning naming the file:
warning: ignoring 'mcp.daemon_url' from project config ./rsigma.yaml; security-sensitive keys are read only from --config, the user or system config, environment variables, or flags
The same keys work from every other layer: an explicit --config <PATH> (which replaces discovery, so the file is trusted as the operator’s choice), the user config, the system config, RSIGMA_* environment variables, and CLI flags. To keep a protected key in a repository, commit the file under another name and pass it with --config. rsigma config validate and rsigma config show list the ignored keys.
With daemon.tenancy.enabled set, the daemon also refuses to start when any project layer was loaded at all. A project file could replace daemon.rulesets and drop a tenant binding, so tenancy deployments run with engine daemon --config <PATH>, which replaces discovery.
Unreleased
Format
A minimal example, with every supported top-level section:
# yaml-language-server: $schema=https://rsigma.io/rsigma.schema.json
version: 1
global:
log_format: text # text | json (maps to --log-format)
output_format: json # json | ndjson | table | csv | tsv (maps to --output-format)
color: auto # auto | always | never (maps to --color)
rulesets:
linux_edge:
sources: [./rules/local, ./vendor/sigma/rules/linux]
include:
- tags: ["attack.t1059*"]
exclude:
- status: [deprecated, unsupported]
dependencies: include
overlays:
- dir: ./overlays/linux_edge
pipelines: [sysmon]
output: ./build/linux_edge
convert:
defaults:
format: default
skip_unsupported: true
options:
correlation_method: join
groups:
linux_edge_lynxdb:
ruleset: linux_edge
target: lynxdb
pipelines: [sysmon]
output: ./build/lynxdb/linux_edge.txt
metadata:
rule_group: linux
time_window: 5m
daemon:
rules: /etc/rsigma/rules
# rulesets: # several named rulesets, optionally schema-bound
# - linux_edge
# - name: cloud_audit
# when: { schemas: [aws_cloudtrail] }
pipelines: [ecs_windows]
sources: [/etc/rsigma/sources]
# alert_pipeline: /etc/rsigma/alert-pipeline.yml # dedup (see the Alert Pipeline guide)
# risk: /etc/rsigma/risk.yml # risk-based alerting (see the Risk-Based Alerting guide)
api:
addr: "0.0.0.0:9090" # TCP host:port, or unix:///run/rsigma/api.sock (Unix; no TLS)
# non-loopback TCP needs TLS (or tls.allow_plaintext) and auth, tls.client_ca, or allow_unauthenticated
# allow_unauthenticated: false
input:
source: stdin # stdin | http | nats://... | unix:///run/rsigma/ingest.sock (Unix)
format: auto
buffer_size: 10000 # at least 1
batch_size: 128 # at least 1, capped at buffer_size
output:
sinks: [stdout] # stdout | file://... | nats://... | otlp://... | unix:///run/rsigma/out.sock (Unix)
# query params: ?on_full=drop, ?format=ndjson|ocsf (line and OTLP sinks), ?ocsf_version=<v>, ?ocsf_incident_class=2004|2005, and ?ocsf_assignee_group=<name> (with format=ocsf; defaults 1.1.0 and 2004; assignee group is required for class 2005), ?compression=gzip and ?timeout=10s (OTLP), TLS ?ca=/?client_cert=/?client_key=/?tls_domain=
drain_timeout: 5
batch_max: 64 # at least 1; results per sink delivery batch
batch_flush_ms: 0 # ms a partial batch waits for more results; 0 delivers at once
# webhooks: [/etc/rsigma/webhooks/] # template-driven HTTP sinks
correlation:
action: alert
event_mode: none
max_events: 10
max_state_entries: 100000 # hard cap across all correlations and groups
# max_group_entries: 10000 # per-group window-state cap; unset = unbounded
emit_detections: false # include detection and correlation matches that only feed correlations
state:
save_interval: 30
runtime: # thread pools; unset keys keep the environment variable or default
# worker_threads: 4 # Tokio workers (--worker-threads)
# detect_threads: 8 # parsing and detection pool (--detect-threads, else RAYON_NUM_THREADS)
# detect_inflight: 5 # 1-8 detection batches in flight (--detect-inflight, else RSIGMA_DETECT_INFLIGHT); 1 with correlation rules
engine:
strict_rules: false # refuse a rule set in which any rule fails to parse (or --strict-rules)
bloom_prefilter: false
match_detail: off
observe_fields: false
egress_policy: default
tap:
enabled: false # opt-in: enable GET /api/v1/tap (or pass --enable-tap)
buffer_events: 8192 # per-session buffer; a full buffer drops events (counted)
max_sessions: 2 # concurrent capture sessions (a session over the cap gets 409)
max_duration: 5m # largest accepted ?duration (a longer one gets 400)
tail:
enabled: false # opt-in: enable GET /api/v1/detections/stream (or --enable-tail)
buffer_events: 8192 # per-session buffer; a full buffer drops detections (counted)
max_sessions: 2 # concurrent tail sessions (a session over the cap gets 409)
schema:
observe: false # opt-in: count events per recognized schema (or --observe-schemas)
discover: false # opt-in: sample unknown shapes for signature suggestions (or --discover-schemas; implies observe)
routing: false # opt-in: route each event to its schema's pipeline-set (or --schema-routing)
partition_rules: false # gated: compile platform-locked per-schema engines with only applicable rules (or --schema-partition-rules)
# config: /etc/rsigma/schema.yml # user schema signatures + routing bindings (--schema-config)
on_unknown: warn # warn | drop | passthrough | error, for events matching no schema
logsource_routing:
enabled: false # opt-in: conflict-based logsource pruning (or --logsource-routing)
# field_map: # event field names per dimension (default product/service/category)
# product: product
# custom: # extra dimensions: dimension name -> event field name
# tenant: org
# event_logsource: # static logsource when the field is absent (--event-logsource)
# product: windows
# custom: # extra dimensions: dimension name -> literal value
# tenant: acme
# strict: false # accepted in the schema; currently ignored
eval:
rules: ./rules
# ruleset: linux_edge # one named ruleset instead of rules
# rulesets: # several named rulesets, optionally schema-bound
# - linux_edge
# - name: cloud_audit
# when: { schemas: [aws_cloudtrail] }
pipelines: [sysmon]
input_format: auto
fail_on_detection: false
# finding_format: native # native | ocsf. ocsf composes with json/ndjson output.
# ocsf_version: "1.1.0" # 1.1.0 | 1.3.0, only with finding_format: ocsf
schema:
routing: false # opt-in: route each event to its schema's pipeline-set (or --schema-routing)
# config: ./schema.yml
on_unknown: warn
logsource_routing:
enabled: false # opt-in: conflict-based logsource pruning (or --logsource-routing)
# field_map:
# product: product
# event_logsource:
# product: windows
# strict: false # accepted in the schema; currently ignored
doc:
fail_on_missing: false # CI gate for ADS metadata completeness
mcp:
# http_addr: 127.0.0.1:3001 # unset means stdio; maps to --http
# lint_config: ./.rsigma-lint.yml
# rules_dir: ./rules
# allow_unconfined_paths: false # required for http_addr without rules_dir
allow_sigma_cli: false # let convert_rules delegate non-native targets
# daemon_url: http://127.0.0.1:9090
# daemon_ca: /etc/rsigma/tls/ca.pem
# allow_operate_writes: false
# daemon token is flag/env only: --daemon-token / RSIGMA_MCP_DAEMON_TOKEN
backtest:
rules: ./rules
# ruleset: linux_edge # one named ruleset instead of rules
corpus: [./ci/corpus]
expectations: ./ci/expectations.yml
# unexpected: warn # fail | warn | ignore; unset lets the expectations-file default apply
input_format: auto
# findings: ./findings.ndjson
# finding_format: native # native | ocsf
# ocsf_version: "1.1.0"
coverage:
# rules: [./rules]
# ruleset: linux_edge # one named ruleset instead of rules
# atomics: https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/atomics/Indexes/index.yaml
# baseline: https://raw.githubusercontent.com/SigmaHQ/sigma/master/other/sigma_attack_nav_coverage.json
# targets: ./threat-model-techniques.txt
fail_on_gaps: false
scorecard:
# backtest: ./backtest.json
# coverage: ./coverage.json
# metrics: http://localhost:9090/metrics
# triage: ./triage.json
fail_on: none
min_precision: 0.8
tune_max_precision: 0.5
retire_max_precision: 0.1
min_volume: 1
stale_window: 30
max_fp_ratio: 0.5
visibility:
# mapping: ./mapping.json
fail_on_blind_spots: false
hygiene:
# rules: [./rules]
# ruleset: linux_edge # one named ruleset instead of rules
# metrics: http://localhost:9090/metrics
# fields: ./fields.json
silent_threshold: 365d
stale_threshold: 365d
# noisy_threshold: 100000
# fail_on: [silent]
Run rsigma config init to scaffold a full, commented version. The full machine-readable schema is emitted by rsigma config schema.
Sections
| Section | Used by | Notes |
|---|---|---|
global |
every subcommand | global.log_format, global.output_format, and global.color. See Output Formats for the format/color semantics. |
rulesets |
ruleset, --ruleset commands, MCP tools |
Named curation of Sigma rules: sources, selectors, dependency policy, overlays, pipelines, and build output. File-only; environment variables are ignored. See Rulesets. Unreleased |
convert |
backend build |
Named conversion groups: ruleset, target, format, pipelines, options, skip_unsupported, without_pipeline, output, and opaque metadata copied into the manifest. defaults fills unset group fields. Groups are file-only; RSIGMA_CONVERT__DEFAULTS__* works, but convert.groups.* is ignored. See backend build.
Unreleased |
daemon |
engine daemon |
Mirrors every non-secret daemon flag. |
daemon.rulesets |
engine daemon |
Several named rulesets evaluated side by side. Each entry is a name or {name, when: {schemas: [...]}}. Conflicts with daemon.rules. Read once at startup. See Rulesets.
Unreleased |
daemon.api.tls |
engine daemon |
Inert unless the binary is built with the daemon-tls feature; otherwise config validate warns. |
daemon.api.auth |
engine daemon |
Bearer-token authentication with resource:action permissions (anonymous_permissions, roles, tokens). Absent = no authentication. Token secrets stay env-only via each token’s token_env. Mutually exclusive with --api-token-env. See HTTP API: Authentication. |
daemon.api.audit |
engine daemon |
Control-plane mutation audit trail (enabled, max_entries, max_age, max_body_bytes, sink). Requires --state-db; auto-enabled when a state database is configured. See HTTP API: Audit trail. |
daemon.nats |
engine daemon |
Non-secret NATS knobs (e.g. consumer_group). Secrets stay env-only. Inert unless built with daemon-nats. |
daemon.tap |
engine daemon |
Live event-tap limits (enabled, buffer_events, max_sessions, max_duration). Disabled by default; enable with enabled: true or --enable-tap. The rest are config-file-only. See HTTP API: Live event tap. |
daemon.tail |
engine daemon |
Live detection-tail limits (enabled, buffer_events, max_sessions). Disabled by default; enable with enabled: true or --enable-tail. The rest are config-file-only. See HTTP API: Live detection tail. |
daemon.dispositions |
engine daemon |
Triage feedback loop (enabled, source, window, numerator, min_sample). Disabled by default; enable with enabled: true, --enable-dispositions, or a configured source. See the Triage Feedback Loop guide. |
daemon.capture |
engine daemon |
Verdict-driven evidence capture (enabled, spool_dir, ring and disk bounds, ttl, spool_queue_capacity). Disabled by default and startup-only; enable with enabled: true or --enable-capture. Requires dispositions, group_by, and spool_dir. See Verdict-Driven Corpora.
Added in v0.22.0 |
daemon.engine.cross_rule_ac |
engine daemon |
Inert unless built with daachorse-index. |
daemon.runtime |
engine daemon |
Thread pool sizing: worker_threads, detect_threads, and detect_inflight (1 to 8), each at least 1. A flag beats the key, and the key beats RAYON_NUM_THREADS and RSIGMA_DETECT_INFLIGHT. See engine daemon: Throughput.
Unreleased |
daemon.schema |
engine daemon |
Schema classification and routing (observe, discover, routing, partition_rules, config, on_unknown). All opt-in. See Schema Routing. |
daemon.logsource_routing |
engine daemon |
Conflict-based logsource pruning (enabled, field_map, event_logsource). strict is accepted and ignored. Opt-in. See Logsource-Aware Evaluation. |
eval |
engine eval |
Mirrors the eval flag surface. |
eval.ruleset, eval.rulesets |
engine eval |
One named ruleset, or several evaluated side by side with optional when schema bindings. Set at most one of them, and neither with eval.rules. An empty eval.rulesets list counts as unset.
Unreleased |
eval.output |
engine eval |
Write results to this file instead of stdout (-o, --output). The CLI flag takes precedence.
Added in v0.25.0 |
eval.schema |
engine eval |
Schema routing for one-shot eval (routing, config, on_unknown). observe/discover have no effect here. |
eval.logsource_routing |
engine eval |
Conflict-based logsource pruning for one-shot eval (enabled, field_map, event_logsource). strict is accepted and ignored. |
backtest |
rule backtest |
rules, corpus, expectations, unexpected, pipelines, and the syslog input knobs. unexpected has no compiled default so the expectations-file default can apply. |
coverage |
rule coverage |
rules, atomics, baseline, targets, fail_on_gaps. |
scorecard |
rule scorecard |
The two required reports (backtest, coverage), the verdict thresholds (min_precision, tune_max_precision, retire_max_precision, min_volume, stale_window, max_fp_ratio), the optional inputs (metrics, metrics_window, triage), fail_on, and report. |
visibility |
rule visibility |
mapping (logsource/field to ATT&CK data-source table path or URL; unset uses the bundled default) and fail_on_blind_spots. rules and observed are intentionally absent (they are invocation-specific CLI arguments). |
doc |
rule doc |
fail_on_missing (the CI gate). The ADS bar itself (enforced statuses and required sections) lives in .rsigma-lint.yml under an ads: block, not here. See Detection Strategy. |
hygiene |
rule hygiene |
rules, the optional sources (metrics, metrics_window, fields), the thresholds (silent_threshold, stale_threshold, noisy_threshold), and fail_on. See Rule Hygiene. |
mcp |
mcp serve |
mcp.http_addr (the --http bind address; unset means stdio), mcp.lint_config, mcp.rules_dir, mcp.allow_unconfined_paths
Added in v0.25.0 (run without rules_dir; required to serve http_addr without a root; off by default), mcp.allow_sigma_cli (let convert_rules delegate non-native targets to an installed sigma-cli; off by default), mcp.daemon_url, mcp.daemon_ca, and mcp.allow_operate_writes. The MCP HTTP auth token and the daemon token are secrets and stay flag/env-only. Inert unless built with the mcp feature. |
daemon.correlation.emit_detections defaults to false, so detections and correlations referenced only by correlations do not produce standalone output unless a referencing correlation has top-level generate: true. The inverse daemon.correlation.no_detections key remains accepted for compatibility but is deprecated, and the daemon prints a warning when it is set. A layer that sets only no_detections overrides emit_detections from lower layers, while emit_detections wins when one layer sets both.
Added in v0.24.0
Secrets policy
The schema deliberately does not carry any secret-bearing daemon settings:
- NATS auth (
creds,token,user,password,nkey) - TLS key password
Supply these via environment variables (or --flag for ad-hoc use). Putting them in a checked-in YAML file would silently widen exposure, so the loader has no way to accept them.
Environment layer
Two parallel schemes are honored:
Uniform
RSIGMA_<SECTION>__<KEY>(recommended). Nested keys use the__separator; single underscores stay inside a key. Values are parsed as YAML scalars so types coerce naturally (ints, bools, lists). Examples:Env var Equivalent config RSIGMA_DAEMON__API__ADDR=127.0.0.1:9090daemon.api.addrRSIGMA_DAEMON__INPUT__BUFFER_SIZE=20000daemon.input.buffer_sizeRSIGMA_GLOBAL__LOG_FORMAT=jsonglobal.log_formatRSIGMA_MCP__HTTP_ADDR=127.0.0.1:9100mcp.http_addrRSIGMA_MCP__DAEMON_URL=http://127.0.0.1:9090mcp.daemon_urlRSIGMA_MCP__DAEMON_CA=/etc/rsigma/tls/ca.pemmcp.daemon_caRSIGMA_MCP__ALLOW_OPERATE_WRITES=truemcp.allow_operate_writesRSIGMA_EVAL__RULESET=linux_edgeeval.rulesetLegacy clap-bound names with a single underscore (
NATS_CREDS,RSIGMA_CONSUMER_GROUP,RSIGMA_TLS_KEY_PASSWORD). These continue to work at the flag layer and are listed in Environment Variables. Secrets are only readable this way.
The uniform scheme is detected by the __ separator, so it never collides with the legacy single-underscore names.
rulesets is a file-only section. RSIGMA_RULESETS__... variables are ignored with warning: ignoring environment variable <KEY>: rulesets are configured in files only. Per-command keys such as RSIGMA_EVAL__RULESET work normally.
--dry-run and config show
config show folds default + file + env and reports the winning layer for each leaf. To preview what a real command will use, including its flag layer, the daemon, eval, backtest, coverage, scorecard, visibility, and hygiene commands support --dry-run:
rsigma engine daemon --dry-run
# prints the effective daemon section as YAML, then exits 0
In config show output the layer is one of default, file, or env. In a command’s --dry-run view, flag-supplied values appear on top of all three.
Format versioning
Every config carries version: 1 at the top level. The loader currently accepts any value (the field is informational), but future migrations will gate on it; treat it as required when authoring new files.
See also
rsigma config initto scaffold a template.rsigma config validatefor layered loading with diagnostics.- Environment Variables for the legacy single-underscore names and the precedence with CLI flags.
- Exit codes for the
CONFIG_ERROR(3) contract used by every config command.