veles: add SendGrid API key detector and validator#1654
Merged
copybara-service[bot] merged 7 commits intogoogle:mainfrom Feb 13, 2026
Merged
veles: add SendGrid API key detector and validator#1654copybara-service[bot] merged 7 commits intogoogle:mainfrom
copybara-service[bot] merged 7 commits intogoogle:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Add a new Veles secret detector for Twilio SendGrid API keys. SendGrid API keys have a distinctive format: - Prefix: SG. - Total Length: 69 characters - Structure: SG.<22 chars key_id>.<43 chars key_secret> Detector: - Uses regex pattern to match SendGrid API key format - Implements veles.Detector interface via simpletoken.Detector Validator: - Validates keys against SendGrid's /v3/user/account endpoint - 200 OK or 403 Forbidden -> valid key (exists and active) - 401 Unauthorized -> invalid key (expired/revoked) - Uses Bearer token authentication Tests include: - True positive cases (valid key formats) - True negative cases (invalid formats, wrong prefix, etc.) - Validator HTTP response handling - Context cancellation handling - Authorization header verification
fe0f05d to
b86518a
Compare
- Add sendgrid.NewDetector() to SecretDetectors in extractor/filesystem/list/list.go - Add sendgrid.NewValidator() to SecretsValidate in enricher/enricherlist/list.go This ensures the SendGrid detector is discoverable as a SCALIBR plugin and can be enabled via --plugins=secrets/sendgrid flag.
erikvarga
reviewed
Jan 16, 2026
erikvarga
reviewed
Jan 19, 2026
Collaborator
erikvarga
left a comment
There was a problem hiding this comment.
Looks like some tests are failing (I think the modified scan_result.pb.go wasn't uploaded)
- Add acceptance tests using velestest.AcceptDetector - Remove unused methods (SecretType, Provider, String) and their tests - Add proto support (scan_result.proto message, secret.go conversion) - Clarify 403 response handling in validator comment - Remove duplicate TestValidator_InvalidRequest test
5efc991 to
3661d47
Compare
- Add package comment to validator.go (ST1000) - Fix unchecked error in validator_test.go (errcheck) - Regenerate scan_result.pb.go with SendGridAPIKey types
Contributor
Author
|
@erikvarga All feedback addressed , Ready for review when you get a chance. Thanks! |
erikvarga
approved these changes
Feb 12, 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.
Add a new Veles secret detector for Twilio SendGrid API keys.
SendGrid API keys have a distinctive format:
Detector:
Validator:
Tests include: