Skip to content

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

Closed
luciferlive112116 wants to merge 1 commit into
JSONbored:mainfrom
luciferlive112116:feat/enrichment-secret-scan-ai-saas-formats
Closed

feat(enrichment): detect AI-provider and more SaaS/CI credential formats in secret-scan#3172
luciferlive112116 wants to merge 1 commit into
JSONbored:mainfrom
luciferlive112116:feat/enrichment-secret-scan-ai-saas-formats

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 16 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.

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>
newrelic_license_key 40 hex + NRAL suffix

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 new table case that flags each of the 16
    formats at high confidence, plus a near-miss case asserting that one-character-short tokens produce no
    finding — proving the prefixes/lengths are specific, not broad. 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: 16 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 (or a negative-lookahead terminator where the body has no fixed end, as the
    existing SendGrid/Anthropic/Square rules already do). newrelic_license_key is anchored by its NRAL
    suffix and sentry_dsn by its sentry.io host, so neither can match a bare hash/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

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - reject/close recommended

Review updated: 2026-07-04 18:55:04 UTC

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

🛑 Suggested Action - Reject/Close

  • AI reviewers agree on a likely critical defect: review-enrichment/src/analyzers/secret-scan.ts:274 uses `\b` to terminate the new Dropbox base64url token rule, so a real `sl.` token whose final body character is `-` will not match
  • change it to `re: /\bsl\.[A-Za-z0-9_-]{130,152}(?![A-Za-z0-9_-])/` or explain why Dropbox tokens cannot end in `-`. — Resolve the flagged defect, or override if the AI reviewers are mistaken, then re-run the gate.

Review summary
This change is a narrow additive expansion of the secret-scan rule table with matching unit coverage, and the new kinds are ordered before the generic private-key/JWT/assignment rules so existing findings are not displaced. The core wiring is unchanged and CI passed, but several of the new base64url-shaped rules use a trailing `\b` even though this analyzer already documents that base64url bodies can validly end in `-`, which makes those rules miss real credentials at the boundary.

Blockers

  • review-enrichment/src/analyzers/secret-scan.ts:274 uses `\b` to terminate the new Dropbox base64url token rule, so a real `sl.` token whose final body character is `-` will not match; change it to `re: /\bsl\.[A-Za-z0-9_-]{130,152}(?![A-Za-z0-9_-])/` or explain why Dropbox tokens cannot end in `-`.
  • review-enrichment/src/analyzers/secret-scan.ts:290,298,306 use `\b` to terminate base64url token bodies for Duffel, Frame.io, and Contentful, so valid tokens ending in `-` are missed on the real scan path; use the same negative-lookahead terminator already used by SendGrid/OpenAI/Anthropic for these rules.
Nits — 4 non-blocking
  • nit: review-enrichment/test/secret-scan.test.ts:565 only covers one-char-short near misses for 9 of the 16 new rules, leaving the new unbounded/lookahead and URL-shaped rules without boundary regression coverage.
  • nit: review-enrichment/test/secret-scan.test.ts:545 uses `b62()` for the Typeform fixture even though the rule intentionally allows `.`, `_`, and `-`, so it does not exercise the expanded character class.
  • Add positive tests for the new base64url rules with a trailing `-`, mirroring the existing SendGrid/Anthropic/OpenAI hyphen-tail tests in `review-enrichment/test/secret-scan.test.ts`.
  • Add near-miss coverage for `dropbox_token`, `frameio_token`, `readme_api_key`, `typeform_token`, `sentry_dsn`, `newrelic_license_key`, and `perplexity_api_key` so each new branch has a real boundary test.

Why this is blocked

  • review-enrichment/src/analyzers/secret-scan.ts:274 uses `\b` to terminate the new Dropbox base64url token rule, so a real `sl.` token whose final body character is `-` will not match; change it to `re: /\bsl\.[A-Za-z0-9_-]{130,152}(?![A-Za-z0-9_-])/` or explain why Dropbox tokens cannot end in `-`.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ No-issue rationale PR body explains why no issue is linked.
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 (no linked issue context).
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 ❌ Blocking Repo-configured hard 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.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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 commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: review-enrichment/src/analyzers/secret-scan.ts:274 uses `\b` to terminate the new Dropbox base64url token rule, so a real `sl.` token whose final body character is `-` will not match; change it to `re: /\bsl\.[A-Za-z0-9_-]{130,152}(?![A-Za-z0-9_-])/` or explain why Dropbox tokens cannot end in `-`.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

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