Skip to content

[INS-465] Add datadogapikey detector to defaults.go#4969

Open
mustansir14 wants to merge 15 commits into
mainfrom
ins-465-add-datadogapikey-detector-to-defaults
Open

[INS-465] Add datadogapikey detector to defaults.go#4969
mustansir14 wants to merge 15 commits into
mainfrom
ins-465-add-datadogapikey-detector-to-defaults

Conversation

@mustansir14
Copy link
Copy Markdown
Contributor

@mustansir14 mustansir14 commented May 18, 2026

Description:

This PR adds the DatadogApiKey detector 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 excludedFromDefaultList of the TestAllDetectorTypesAreInDefaultList test. 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.
image

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this 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 registers datadogapikey.Scanner in buildDetectorList(), and omits it at runtime when DatadogApiKeyDetectorEnabled is false. pkg/feature: introduces DatadogApiKeyDetectorEnabled. main: sets that flag to true for OSS alongside the other “new detector” flags.

Tests: excludedFromDefaultList is reorganized (mistakenly-missed detectors vs feature-flagged section); DatadogApikey stays excluded while flag-gated. Integration test expectation adds SecretParts for 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.

@mustansir14 mustansir14 requested a review from a team May 18, 2026 07:11
@mustansir14 mustansir14 requested a review from a team as a code owner May 18, 2026 07:11
@github-actions
Copy link
Copy Markdown

Corpora Test Results

No detector regex or keyword changes in this PR. Bench skipped.

@mustansir14 mustansir14 force-pushed the ins-465-add-datadogapikey-detector-to-defaults branch from fcfbb5f to 674b7e2 Compare May 21, 2026 09:17
@mustansir14 mustansir14 changed the base branch from main to feature-flag-new-detectors May 21, 2026 09:19
@mustansir14 mustansir14 added the review/product-eng Team integrations reviewed, awaiting product-eng review label May 22, 2026
Base automatically changed from feature-flag-new-detectors to main May 26, 2026 14:25
@mustansir14 mustansir14 requested a review from a team May 29, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/product-eng Team integrations reviewed, awaiting product-eng review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants