Skip to content

[Detector] - Restore and Refactor Detectors starting with *CA*#4315

Open
amanfcp wants to merge 11 commits into
mainfrom
task/restore_and_refactor_c_letter_detectors
Open

[Detector] - Restore and Refactor Detectors starting with *CA*#4315
amanfcp wants to merge 11 commits into
mainfrom
task/restore_and_refactor_c_letter_detectors

Conversation

@amanfcp

@amanfcp amanfcp commented Jul 14, 2025

Copy link
Copy Markdown
Contributor

Description:

  • Restored caflou, calorieninja, cannyio detectors' health
  • Refactor verification logic across multiple detectors to use a unified verifyMatch function
  • Updated integration tests to reflect changes in secret retrieval and verification processes
  • Adjusted regex patterns for improved accuracy in detecting API keys
  • Enhanced error handling for API responses.

Note:

I'm having trouble creating test accounts in Captain Data (.co domain for <V4) and Caspio. The accounts are stuck in verification state.

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

…d `verifyMatch` function. Updated integration tests to reflect changes in secret retrieval and verification processes. Adjusted regex patterns for improved accuracy in detecting API keys. Enhanced error handling for API responses.
@amanfcp amanfcp requested a review from a team July 14, 2025 11:29

@shahzadhaider1 shahzadhaider1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work.
I have added some feedback.

Comment thread pkg/detectors/cannyio/cannyio.go Outdated
Comment thread pkg/detectors/cannyio/cannyio.go
Comment thread pkg/detectors/cannyio/cannyio.go Outdated
Comment thread pkg/detectors/capsulecrm/capsulecrm.go Outdated
Comment thread pkg/detectors/carboninterface/carboninterface.go Outdated
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"cashboard"}) + `\b([0-9A-Z]{3}-[0-9A-Z]{3}-[0-9A-Z]{3}-[0-9A-Z]{3})\b`)
userPat = regexp.MustCompile(detectors.PrefixRegex([]string{"cashboard"}) + `\b([0-9a-z]{1,})\b`)
userPat = regexp.MustCompile(detectors.PrefixRegex([]string{"username"}) + `\b([0-9a-z]{1,})\b`)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't remove the cashboard keyword, because the regex pattern seems too generic

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a prefix for catching the username once the chunk is inside the detector.
The reason for removing cashboard keyword is that it will create unnecessary sets of credentials.

Comment thread pkg/detectors/cashboard/cashboard.go Outdated
amanfcp added 2 commits July 18, 2025 17:53
…tectors to return actual errors instead of nil. This improves error reporting and debugging capabilities.
Comment thread pkg/detectors/caflou/caflou.go Outdated
Comment thread pkg/detectors/calendlyapikey/calendlyapikey.go Outdated
@amanfcp amanfcp mentioned this pull request Aug 7, 2025
2 tasks
@amanfcp

amanfcp commented Aug 15, 2025

Copy link
Copy Markdown
Contributor Author

Contributes to #4051

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants