[INS-465] Add datadogapikey detector to defaults.go#4969
Merged
mustansir14 merged 16 commits intoJun 9, 2026
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
unsmith
approved these changes
Jun 8, 2026
MuneebUllahKhan222
approved these changes
Jun 8, 2026
mcastorina
approved these changes
Jun 8, 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
Enabling the flag adds another live-verification detector to default scans, which can change findings volume and Datadog API traffic; rollout is mitigated by the feature flag and OSS-only default-on in main.
Overview
Registers the Datadog API key detector in the default engine detector list and wires it into the same feature-flag gating pattern as Pinecone, Cloudinary, GitLab OAuth, and Enigma.
pkg/feature: addsDatadogApiKeyDetectorEnabled.main.goturns it on for OSS builds alongside the other “new detector” flags.defaults.goimports and includes&datadogapikey.Scanner{}inbuildDetectorList(), and strips it when the flag is off.defaults_test.go: keepsDetectorType_DatadogApikeyinexcludedFromDefaultListwhile gating applies (soTestAllDetectorTypesAreInDefaultListstill passes when the flag is false in tests), and reorganizes exclusions into “mistakenly missed” vs “feature flag gated” sections.Integration test: unverified Datadog API key expectations now include
SecretParts["api_key"].Reviewed by Cursor Bugbot for commit 3e27af2. Bugbot is set up for automated code reviews on this repo. Configure here.