Skip to content

Add InternetData API key detector - #5587

Open
UmanShahzad wants to merge 1 commit into
trufflesecurity:mainfrom
UmanShahzad:internetdata-detector
Open

UmanShahzad wants to merge 1 commit into
trufflesecurity:mainfrom
UmanShahzad:internetdata-detector

Conversation

@UmanShahzad

@UmanShahzad UmanShahzad commented Nov 20, 2026 •

Copy link
Copy Markdown

Description:

Adds a detector for InternetData API keys (mk_<8 hex>_<32 base64url>), verified with GET /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 behind InternetDataDetectorEnabled like Serval's (#5528). I run InternetData.

Checklist:

  • Tests passing (make test-community)? The detector's and pkg/engine/defaults tests pass and go build ./... is clean; a full community run before the rebase passed except mongodb and handlers, which fail the same way on main.
  • Lint passing (make lint this 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-only GET /api/v1/entitlement endpoint (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 OSS main.go like other gated detectors), with a new DetectorType_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.

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.
@UmanShahzad
UmanShahzad requested a review from a team November 20, 2026 09:53
@UmanShahzad
UmanShahzad requested a review from a team as a code owner November 20, 2026 09:53
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.

1 participant