rsigma config validate
rsigma config validate
rsigma config validate
Added in v0.14.0Load every config layer that would apply at runtime and report problems before they cause a daemon or eval to misbehave.
Synopsis
rsigma config validate [--config <PATH>] [--format <text|json>]
Description
Walks the same discovery chain the daemon and eval commands use, deserializes every layer, and reports:
- Unknown keys that don’t match the schema (typo guard). Each one fails validation with exit 3. Unreleased
- Inactive sections that are set but inert in this build because the gating Cargo feature is disabled (
daemonwithout thedaemonfeature,daemon.natswithoutdaemon-nats,daemon.api.tlswithoutdaemon-tls,daemon.stix_storewithoutstix-enrich). Every command that reads the config warns about them, and they never fail a command.daemon.stix_storeUnreleased - Errors that prevent a file from loading at all.
- Ruleset errors from statically checking every declared ruleset: unknown keys, an empty
sourceslist, invalid globs, unknown levels, statuses, kinds, and policies, and malformed overlays. Sources are not read, so a missing source, an unresolved correlation reference, or an overlay that matches nothing surfaces when the ruleset is resolved, for example byruleset showorruleset build. Unreleased - Ruleset list errors in
eval.ruleset,eval.rulesets, anddaemon.rulesets: undefined or duplicate names, unknown entry orwhenkeys, and a list combined withrules(oreval.rulesetwitheval.rulesets). Schema names inwhenare checked whenengine evalorengine daemonloads the classifier, because--schema-configcan add schemas. Unreleased - Convert group errors in
convert.groups: invalid group names, a missing or undefined ruleset, a missingtargetoroutputafterconvert.defaultsis applied, and two groups that write the same output or manifest. Unreleased
Unknown keys and ruleset errors always fail validation with exit 3, so CI can gate on configuration cleanliness without extra flags. Every other command that reads the config stops with the same exit code on an unknown key. Unreleased
Flags
| Flag | Default | Description |
|---|---|---|
-c, --config <PATH> |
discovery chain | Load only this file (bypasses discovery). |
--format <text|json> |
text when unset |
Human-readable summary on stderr or a machine-readable envelope on stdout. When unset, the global --output-format is used (json/ndjson/table/csv/tsv). Local --format wins over the global selector and prints a precedence warning. See Output Formats. |
--strict |
off | Deprecated. Accepted for compatibility and changes nothing, because unknown keys always fail validation. Hidden from --help.
Unreleased |
Output
Text mode
Diagnostics go to stderr. Loaded layers are listed in increasing precedence order, then each unknown key, ignored key, and inactive section is printed, followed by a summary line.
Loaded (low to high precedence):
- /etc/rsigma/config.yaml
- ./rsigma.yaml
error: unknown key 'bogus_key' in ./rsigma.yaml
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
1 unknown key(s) found
An ignored key is a security-sensitive key set in a project file (./rsigma.yaml or .rsigmarc), which rsigma drops; see Project config trust. Ignored keys do not fail validation.
Added in v0.27.0
JSON mode
A single envelope is written to stdout (data goes to stdout; warnings stay on stderr only in text mode).
{
"ok": false,
"sources": ["/etc/rsigma/config.yaml", "./rsigma.yaml"],
"unknown_keys": [
{ "file": "./rsigma.yaml", "key": "bogus_key" }
],
"ignored_keys": [
{ "file": "./rsigma.yaml", "key": "mcp.daemon_url" }
],
"inactive_sections": [],
"semantic_errors": [
{ "path": "rulesets.linux_edge", "message": "ruleset 'linux_edge': unknown key 'exlude' (did you mean 'exclude'?)" },
{ "path": "convert.groups.linux_edge_lynxdb", "message": "convert group 'linux_edge_lynxdb' names unknown ruleset 'linux_edg'" }
]
}
ignored_keys
Added in v0.27.0 lists the protected keys dropped from project files. Table, CSV, TSV, and NDJSON output report each one as an ignored_key row. semantic_errors
Unreleased reports each problem found in a ruleset spec, a ruleset list, or a convert group, as {path, message}, where path is the dotted config path such as rulesets.linux_edge, eval.rulesets, or convert.groups.linux_edge_lynxdb.
A failure surfaces "ok": false and (for parse failures) an "error" field.
Exit codes
| Code | Meaning |
|---|---|
0 |
Config loaded successfully with no unknown keys and no ruleset errors. |
3 |
A file could not be read or parsed, a file has an unknown key, or a ruleset spec is invalid. |
Examples
Check the discovered config:
rsigma config validate
Validate a specific file and fail the build on typos:
rsigma config validate -c rsigma.yaml
Use the JSON envelope from a CI step:
rsigma config validate --format json | jq -e '.ok'
See also
config showto see the effective values after layering.- Configuration Reference.