[INS-472] Add user detector to defaults.go, gate it behind feat flag and update verification logic#5007
Open
MuneebUllahKhan222 wants to merge 3 commits into
Open
[INS-472] Add user detector to defaults.go, gate it behind feat flag and update verification logic#5007MuneebUllahKhan222 wants to merge 3 commits into
MuneebUllahKhan222 wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c085ec8. Configure here.
Corpora Test ResultsScans a corpus of real-world public code against only the detectors changed in this PR, then compares unique match counts between the PR build and the main baseline to catch regex regressions. Verification is disabled — each detector's regex is measured independently. 1 new · 0 clean | Scoped to:
|
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
Userdetector todefaults.goand gates it behind the appropriate feature flag.Additionally, the PR updates the detector verification logic to align with the latest API behavior and validation requirements.
The PR also tightens the detector regex by removing support for the
+,-,_,., and=characters.Checklist:
make test-community)?make lintthis requires golangci-lint)?Note
Low Risk
Adds a gated detector and tightens regex/verification URL; no changes to core auth or sensitive infrastructure.
Overview
This PR enables the User secret detector in the default scan engine: it registers
user.Scannerindefaults.go, addsUserDetectorEnabledinpkg/feature, turns it on by default inmain.go, and filters the detector out when the flag is off (same pattern as Pinecone/Cloudinary/GitLab OAuth).The User detector behavior is updated to match current API expectations: verification calls
https://detectors.user.com/api/public/users/instead of the oldsecretscanner.user.comhost, and the token regex now requires exactly 64 alphanumeric characters (no+,-,_,., or=).Tests were adjusted for the stricter pattern and integration comparisons now use
go-cmpwith ignored result fields.Reviewed by Cursor Bugbot for commit 681df22. Bugbot is set up for automated code reviews on this repo. Configure here.