[SDSP-327] Add SDS rule config field for is_supporting_rule#912
Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 3 commits intoMay 14, 2026
Merged
Conversation
|
🎯 Code Coverage (details) 🔗 Commit SHA: 75b6d78 | Docs | Datadog PR Page | Give us feedback! |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an is_supporting_rule flag to SDS secret rules, plumbing it from the static-analysis-api config through to the dd-sds library so supporting-rule matches are suppressed from output while still being usable for match pairing/template variable resolution. Also consolidates the scan + validate flow into a single scan_with_options call.
Changes:
- Adds
is_supporting_ruletoSecretRule/SecretRuleApiAttributesand wires it through to dd-sds viaRootRuleConfig::is_supporting_rule. - Replaces
scanner.scan()+scanner.validate_matches()withscanner.scan_with_options(), passing validation toggle viaScanOptionBuilder. - Adds unit tests (including httpmock-based) for supporting-rule suppression, match pairing template resolution, and
disable_validationbehavior.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/secrets/src/scanner.rs | Switch to scan_with_options; add tests for supporting-rule suppression and disable_validation |
| crates/secrets/src/model/secret_rule.rs | Add is_supporting_rule field and propagate to RootRuleConfig |
| crates/secrets/Cargo.toml | Add httpmock as dev-dependency |
| crates/cli/src/model/datadog_api.rs | Add API attribute and conversion; tests for deserialization defaults |
| crates/cli/src/model/cli_configuration.rs | Update test fixtures for new field |
| crates/cli/src/sarif/sarif_utils.rs | Update test fixtures for new field |
| Cargo.lock | Lockfile updates for new httpmock dependency tree |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fuchsnj
approved these changes
May 14, 2026
jasonforal
approved these changes
May 14, 2026
gh-worker-dd-mergequeue-cf854d
Bot
deleted the
isabella.garza/SDSP-327-support-rule-sds
branch
May 14, 2026 17:40
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.
What problem are you trying to solve?
The SDS library supports a concept of "supporting rules" which are rules that exist solely to supply context (ex. a subdomain or client ID) to a primary rule's active validation call via match pairing. This PR allows rules to be configured as is_supporting_rule from the static-analysis-api config and pass that to the SDS library.
Additionally, the previous
scanner.scan()+scanner.validate_matches()two-step approach could not support supporting rules: matches would have to be retained between the two calls for validation, making it impossible to suppress them cleanly. Moving toscan_with_optionslets the dd-sds library handle both validation and supporting rule match suppression in a single pass.What is your solution?
is_supporting_rule: boolto theSecretRulemodel (with #[serde(default)] so omission from the API defaults to false)is_supporting_ruletoSecretRuleApiAttributesand wired it through theTryFrom<SecretRuleApiType>conversionis_supporting_ruleto dd-sds via .is_supporting_rule(...) onRootRuleConfigduring scanner construction, so the library knows to suppress those matches from output while still using them for template variable resolution in HTTP validation callsscanner.scan()+scanner.validate_matches()two-step with a singlescanner.scan_with_options()call, passingdisable_validationthroughScanOptionBuilderAlternatives considered
Filtering out supporting rule matches in the static analyzer after
scan()returns was considered, but rejected in favor of having dd-sds own the behavior. This approach keeps the static analyzer's responsibility limited to passing the flag through from the API.What the reviewer should know
is_supporting_rule=truecorrectly drops the matches from the SDS libdisable_validation=trueconfirms thatscan_with_optionscorrectly skips HTTP calls when validation is disabled