feat: add rsigma fields subcommand for field catalog#65
Merged
Conversation
List all fields referenced by Sigma rules, correlations, and filters. Extracts field names from detection items, correlation group-by/condition fields, alias mappings, filter detections, and rule metadata. Optionally applies pipelines to show post-mapping field names. Flags: -r/--rules (required), -p/--pipeline (repeatable), --no-filters, --json. Table output sends data to stdout and stats to stderr. Pipeline field mapping summary included when pipelines are applied. 16 integration tests with insta inline snapshots covering detection, correlation, value_count condition fields, alias mappings, filters, --no-filters exclusion, pipeline transforms, JSON output, directory loading, keyword-only rules, and error cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rsigma fieldssubcommand that extracts and lists all field names referenced across detection rules, correlation rules (group-by, condition fields, alias mappings), filter rules, and rule metadata (fields:section).-p) to show post-mapping field names,--no-filtersto exclude filter-contributed fields, and--jsonfor machine-readable output with summary stats and pipeline mapping details.Test plan
cargo test -p rsigma --test cli_fieldspasses all 16 testscargo clippy --workspace --all-targets --all-features -- -D warningsclean