Skip to content

feat(enrichment): detect Discord bot tokens and Twilio SIDs in secret-scan - #3263

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
bohdansolovie:feat/secret-scan-discord-twilio
Jul 4, 2026
Merged

feat(enrichment): detect Discord bot tokens and Twilio SIDs in secret-scan#3263
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
bohdansolovie:feat/secret-scan-discord-twilio

Conversation

@bohdansolovie

Copy link
Copy Markdown
Contributor

Summary

  • Add high-confidence secret-scan rules for Discord bot tokens and Twilio Account/API Key SIDs.
  • Distinct from the existing Discord webhook URL rule — bot tokens use a separate three-segment format.
  • Orb fix (follow-up to closed feat(enrichment): detect Discord bot tokens and Twilio SIDs in secret-scan #3262): Twilio AC/SK rules use (?![A-Za-z0-9_]) tail guards so strings like AC…32hex…z are not false-positive SIDs.

Motivation

Discord bot tokens and Twilio SIDs are commonly leaked in config files. The secret-scan analyzer covers many SaaS tokens but missed these formats.

Test plan

  • Discord bot token — positive, truncated negative, not classified as webhook URL
  • Twilio Account/API Key SID — positive matches
  • Twilio truncation, hex overrun, and non-hex identifier-continuation negatives
  • Fragment-based fixtures (no contiguous fake secrets in committed source)
  • Full secret-scan.test.ts suite passes

Made with Cursor

bohdansolovie and others added 2 commits July 5, 2026 01:39
…-scan

Add high-confidence patterns for Discord bot tokens and Twilio Account/API
Key SIDs with fragment-based fixtures, truncation negatives, and webhook parity.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use identifier-continuation lookahead so AC/SK + 32 hex is not matched
when immediately followed by a non-hex identifier char (Orb JSONbored#3262).

Co-authored-by: Cursor <cursoragent@cursor.com>
@bohdansolovie
bohdansolovie requested a review from JSONbored as a code owner July 4, 2026 23:46
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 4, 2026
@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 23:47:18 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
This adds narrowly scoped secret-scan rules for Discord bot tokens and Twilio AC/SK SIDs, with tests covering the primary positive and negative cases. The Twilio tail guards correctly prevent hex overruns and identifier-continuation false positives, and the Discord rule is distinct from the existing webhook URL shape. I do not see a reachable correctness defect in the visible diff.

Nits — 2 non-blocking
  • nit: review-enrichment/test/secret-scan.test.ts:416 should add a Discord overrun/identifier-continuation negative so the `(?![A-Za-z0-9_-])` guard in review-enrichment/src/analyzers/secret-scan.ts:174 is proven on the real scanner path.
  • review-enrichment/test/secret-scan.test.ts:416 add a case like `const overrun = fakeDiscordBotToken + "x"; assert.equal(scanPatch(...).some((f) => f.kind === "discord_bot_token"), false);` to match the Twilio guard coverage.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #3262
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: 182 registered-repo PR(s), 102 merged, 9 issue(s).
Contributor context ✅ Confirmed Gittensor contributor bohdansolovie; Gittensor profile; 182 PR(s), 9 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: bohdansolovie
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 182 PR(s), 9 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 295c213 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

contributor:flagged Contributor flagged for review by trust analysis. 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