Skip to content

feat(enrichment): detect AI-provider and more SaaS/CI credential formats in secret-scan - #3176

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
luciferlive112116:feat/enrichment-secret-scan-ai-saas-formats-v2
Jul 4, 2026
Merged

feat(enrichment): detect AI-provider and more SaaS/CI credential formats in secret-scan#3176
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
luciferlive112116:feat/enrichment-secret-scan-ai-saas-formats-v2

Conversation

@luciferlive112116

Copy link
Copy Markdown
Contributor

Summary

The secret-scan analyzer (review-enrichment/src/analyzers/secret-scan.ts) flags credentials committed in a
PR diff, citing file:line + kind only (never the value). This adds 14 more credential formats the scanner
currently misses — the current wave of AI-provider keys plus widely-used SaaS/CI tokens — continuing the
established feat(enrichment) secret-format additions.

Supersedes the closed #3172. That review correctly flagged that a base64url token body terminated with \b
silently misses a real token whose last character is - (a non-word char). This version terminates every
base64url-body rule (dropbox_token, duffel_token, frameio_token, contentful_token) with a
negative-lookahead (?![A-Za-z0-9_-]) instead — the same terminator the existing SendGrid/Anthropic/Square
rules use — and drops the two formats (newrelic_license_key, replicate_token) whose exact length I could
not verify with confidence, rather than ship an imprecise rule.

Each new rule is a high-confidence, gitleaks/trufflehog-standard shape with a distinctive multi-character
literal prefix (or fixed marker/host) and a fixed or tightly-bounded length + charset
, so the false-positive
rate against ordinary source, base64 blobs, hex hashes, and UUIDs is effectively zero:

kind shape
groq_api_key gsk_ + 52 base62
replicate_token r8_ + 37 base62
perplexity_api_key pplx- + ≥40 base62
dropbox_token sl. + 130–152 base64url
jfrog_api_key AKCp8 + ≥69 base62
duffel_token duffel_{test,live}_ + 43
easypost_key EZAK/EZTK + 54 base62
frameio_token fio-u- + 64 base64url
contentful_token CFPAT- + 43 base64url
sonarqube_token sqa_/sqp_/squ_ + 40 hex
pulumi_token pul- + 40 hex
adafruit_io_key aio_ + 28 base62
readme_api_key rdme_ + ≥70
typeform_token tfp_ + ≥40
sentry_dsn ingest URL: 32-hex key @…sentry.io/<project id>

No existing rule is modified, so current findings are unchanged, and no analyzer descriptor changes (the
finding schema is unchanged) — so analyzer-metadata.json and the generated UI mirror are untouched.

No linked issue: additive detection-coverage for well-known credential formats, matching the established
feat(enrichment) secret-format additions; each rule is a self-evident real token shape with no public
API/schema/deploy surface change — fits the repo's preferred (not required) linked-issue policy.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run typecheck
  • npm run rees:test — the review-enrichment build + analyzer suite (see note below)
  • npm run test:coverage (N/A — this file is in review-enrichment/, outside the root src/** Codecov scope)
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Ran locally: git diff --check (clean), the review-enrichment TypeScript build (exit 0), and the secret-scan
    analyzer test via node --test44/44 pass, including a table case that flags each of the 14 formats at
    high confidence (the four base64url-body fixtures deliberately END IN - so they fail on a \b terminator
    and pass only on the lookahead — a real regression guard for the feat(enrichment): detect AI-provider and more SaaS/CI credential formats in secret-scan #3172 defect), plus a near-miss case
    asserting one-character-short tokens produce no finding. All fixtures are assembled from string
    fragments so the test file never contains a contiguous secret literal. The change is confined to
    review-enrichment/, outside the src/** Codecov scope.
  • Not run locally: the UI, root typecheck, and the metadata:check step of rees:test. This change only adds
    scan rules, not any analyzer descriptor, so the committed analyzer-metadata.json/UI mirror are unchanged (a
    local regeneration produces a zero-content diff) and metadata:check passes on CI (Linux). On this Windows
    dev box metadata:check reports a spurious line-ending difference; it fails identically on unmodified
    main. analyzer-metadata.json was NOT modified.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

Notes

  • Detection-only additions: 14 new high-confidence rules; no existing rule, threshold, or descriptor changed,
    so current findings and analyzer-metadata.json are unaffected. The scanner still returns only file:line +
    kind, never the matched secret value.
  • Each regex uses \b boundaries for word-character-terminated bodies (hex/base62), and a negative-lookahead
    terminator (?![A-Za-z0-9_-]) for base64url bodies that can legitimately end in -. sentry_dsn is
    anchored by its sentry.io host so it cannot match a bare URL.

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-04 19:08:14 UTC

2 files · 1 AI reviewer · no blockers · readiness 80/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
This change cleanly extends the secret-scan rule table with additional high-confidence credential shapes and covers the main positive path for each new kind through scanPatch. The base64url-ending regression from the prior version is handled at the rule layer with negative lookahead terminators, and the tests deliberately exercise tokens ending in '-' for the affected formats. I do not see a reachable correctness break in the provided diff, but the PR text and coverage around boundary cases could be tightened.

Nits — 5 non-blocking
  • nit: review-enrichment/test/secret-scan.test.ts:531 only exercises the negative-lookahead terminator for some new variable-length rules; add explicit overrun/terminator near-misses for dropbox_token, frameio_token, contentful_token, readme_api_key, typeform_token, and perplexity_api_key so we prove the rule stops at the right boundary instead of just matching the happy path.
  • nit: review-enrichment/src/analyzers/secret-scan.ts:320 says ReadMe is a lowercase-hex-ish body, but the regex allows every lowercase letter plus digits; either tighten the charset if the format is actually hex or update the comment so future reviewers do not treat this as a verified hex-only shape.
  • nit: PR description still lists replicate_token in the table even though this diff intentionally does not add a replicate_token rule; clean that up so the description matches the code under review.
  • review-enrichment/test/secret-scan.test.ts:549 add near-misses like `"pplx-" + b62(39)` and `"rdme_" + hex(69)` to cover the minimum-length branches added in review-enrichment/src/analyzers/secret-scan.ts:325 and :341.
  • review-enrichment/test/secret-scan.test.ts:531 add one valid `duffel_live_` case, since the regex accepts both `test` and `live` markers and the current test only drives the `test` branch.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #3172
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 119 registered-repo PR(s), 60 merged, 23 issue(s).
Contributor context ✅ Confirmed Gittensor contributor luciferlive112116; Gittensor profile; 119 PR(s), 23 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: luciferlive112116
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: JavaScript, MDX, Python, Rust, TypeScript
  • Official Gittensor activity: 119 PR(s), 23 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot 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.

Gittensory approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 76d43a4 into JSONbored:main Jul 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant