[INS-465] Add datadogapikey detector to defaults.go#4969
Open
mustansir14 wants to merge 15 commits into
Open
Conversation
…remove them when their flag is disabled
Corpora Test ResultsNo detector regex or keyword changes in this PR. Bench skipped. |
fcfbb5f to
674b7e2
Compare
This was referenced May 21, 2026
kashifkhan0771
approved these changes
May 21, 2026
shahzadhaider1
approved these changes
May 22, 2026
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.
Description:
This PR adds the
DatadogApiKeydetector to the default list of detectors. It gates the new addition behind a feature flag, which is why this PR is based off of #4961 which introduces the plumbing for gating detectors behind feature flags.Since the flags are disabled by default, the gated detectors need be added to the
excludedFromDefaultListof theTestAllDetectorTypesAreInDefaultListtest. While doing that, I also separated the gated detectors into their own section (separated by a comment) so that they can easily be identified and removed later.Testing
Both the unit tests and integration tests pass, no changes required.
Corpora Testing
The Corpora Test in CI was skipped on this PR because no keywords or regex changes were done. Ran the test manually. The detector appears in the list, but a bit below.

Checklist:
make test-community)?make lintthis requires golangci-lint)?Note
Medium Risk
Enables a new default scanner path when the flag is on (OSS turns it on), which can change scan findings and verification behavior without changing detection regexes in this diff.
Overview
Adds the Datadog API key detector to the default detector registry and wires it through the same feature-flag gating pattern as Pinecone, Cloudinary, and GitLab OAuth.
pkg/engine/defaults: imports and registersdatadogapikey.ScannerinbuildDetectorList(), and omits it at runtime whenDatadogApiKeyDetectorEnabledis false.pkg/feature: introducesDatadogApiKeyDetectorEnabled.main: sets that flag to true for OSS alongside the other “new detector” flags.Tests:
excludedFromDefaultListis reorganized (mistakenly-missed detectors vs feature-flagged section);DatadogApikeystays excluded while flag-gated. Integration test expectation addsSecretPartsfor an unverified API key result.Reviewed by Cursor Bugbot for commit 48e7d62. Bugbot is set up for automated code reviews on this repo. Configure here.