[INS-339] Add New Relic User Key detector#4794
Open
mustansir14 wants to merge 5 commits intotrufflesecurity:mainfrom
Open
[INS-339] Add New Relic User Key detector#4794mustansir14 wants to merge 5 commits intotrufflesecurity:mainfrom
mustansir14 wants to merge 5 commits intotrufflesecurity:mainfrom
Conversation
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, enable autofix in the Cursor dashboard.
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 New Relic User Key Detector.
Regex:
\b(NRAK-[A-Z0-9]{27})\bVerification:
For verification, we use the New relic NerdGraph API:
https://api.newrelic.com/graphql.We send a POST request with body
{ requestContext { userId } }. A response code of200means the key is valid.401means it is an invalid/rotated key and403means the region is incorrect.Note: For EU region keys, the endpoint should be
https://api.eu.newrelic.com/graphql"Corpora Test:


The detector does not appear in the list.
Checklist:
make test-community)?make lintthis requires golangci-lint)?Note
Medium Risk
Adds a new detector that introduces outbound verification requests to New Relic’s NerdGraph API (US/EU), which could impact scan performance/behavior if the endpoint is slow or changes responses. Otherwise changes are additive and isolated to detector registration and protobuf enum wiring.
Overview
Adds a new
NewRelicUserKeydetector that findsNRAK-...user API keys via regex and optionally verifies them by calling New Relic’s NerdGraph GraphQL endpoint (trying US and EU regions) and recordingregion/user_idinExtraData.Registers the detector in the default detector list and extends the detector type enum (
proto/detectors.proto+ generateddetectors.pb.go). Includes unit, integration, and benchmark tests for matching and verification behavior.Written by Cursor Bugbot for commit 849426f. This will update automatically on new commits. Configure here.