Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend algoliaadminkey prefixes #3458

Closed
wants to merge 1 commit into from

Conversation

0x2b3bfa0
Copy link
Contributor

@0x2b3bfa0 0x2b3bfa0 commented Oct 17, 2024

Description

This pull requests enhances the detection of Algolia keys by looking also for Algolia DocSearch keywords and option names on the official libraries (example).

Checklist

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

@@ -22,14 +22,14 @@ var (
client = common.SaneHttpClient()

// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"algolia"}) + `\b([a-zA-Z0-9]{32})\b`)
idPat = regexp.MustCompile(detectors.PrefixRegex([]string{"algolia"}) + `\b([A-Z0-9]{10})\b`)
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"algolia", "docsearch", "appId"}) + `\b([a-zA-Z0-9]{32})\b`)
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe appId and apiKey is a very common term which can lead to false positives.

@zricethezav
Copy link
Collaborator

@0x2b3bfa0 closing this PR as you have another Algolia PR open. Please consolidate all improvements for a single detector to one PR.

@0x2b3bfa0
Copy link
Contributor Author

Merged into #3459.

@0x2b3bfa0 0x2b3bfa0 deleted the patch-1 branch October 21, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants