Repository navigation
Add InternetData API key detector - #5587
Open
UmanShahzad wants to merge 1 commit into
Open
UmanShahzad wants to merge 1 commit into
UmanShahzad wants to merge 1 commit into
Conversation
InternetData API keys are mk_, an 8-character hex prefix and 32 base64url characters. Verification calls GET /api/v1/entitlement, which is read-only and spends none of the key's lookups: 200 is live, 401 invalid, revoked or expired is dead, and 403 for a source address outside the key's allowed CIDRs is live but restricted.
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:
Adds a detector for InternetData API keys (
mk_<8 hex>_<32 base64url>), verified withGET /api/v1/entitlement, which is read-only and spends no lookups: 200 live, 401 dead, 403 live but limited to other source addresses. It sits behindInternetDataDetectorEnabledlike Serval's (#5528). I run InternetData.Checklist:
make test-community)? The detector's andpkg/engine/defaultstests pass andgo build ./...is clean; a full community run before the rebase passed except mongodb and handlers, which fail the same way onmain.make lintthis requires golangci-lint)? golangci-lint v2.14.0 with the script's flags, 0 issues.Note
Low Risk
Additive detector with standard feature-flag gating; verification uses a documented read-only endpoint and does not call URLs from scanned content.
Overview
Adds a new InternetData detector that finds API keys matching
mk_<8 hex>_<32 base64url>and optionally verifies them against InternetData’s read-onlyGET /api/v1/entitlementendpoint (200 = live with optional plan name, 401 invalid/revoked/expired = dead, 403 with IP allowlist error = live but restricted).The scanner is wired into default detectors behind
InternetDataDetectorEnabled(enabled in OSSmain.golike other gated detectors), with a newDetectorType_InternetData(1080) in the proto and generated pb. Pattern, secret parts, rotation guide metadata, and verification behavior are covered by unit and httptest-based verify tests.Reviewed by Cursor Bugbot for commit 4d8657b. Bugbot is set up for automated code reviews on this repo. Configure here.