feat(enrichment): flag managed-database connection strings in secret-scan - #3486
Conversation
…scan Add six high-confidence RULES for managed-database connection strings that embed credentials, following the existing cloudinary_url rule (scheme://<id>:<secret>@<host>) — a committed connection string with an embedded password is a high-severity credential leak. - mongodb_atlas_uri: mongodb+srv://<user>:<pass>@...mongodb.net - neon_postgres_uri: postgres://<user>:<pass>@...neon.tech - supabase_postgres_uri: postgres://<user>:<pass>@...supabase.co - upstash_redis_uri: rediss://default:<pass>@...upstash.io - planetscale_mysql_uri: mysql://<user>:<pass>@...psdb.cloud - cockroachdb_uri: postgres://<user>:<pass>@...cockroachlabs.cloud Each rule requires a non-empty user:password pair (charset excludes < and >, so an angle-bracket docs placeholder does not match), a distinctive managed-provider host (so a local/self-hosted URI is never flagged), and a host-boundary terminator (so a look-alike suffix host cannot match). The negative test asserts placeholders, localhost/127.0.0.1 hosts, and a suffix-host look-alike all produce zero findings. All kinds are new and inserted before the generic-assignment rule. SecretFinding.kind is a plain string, so there is no types/render/metadata change.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - reject/close recommendedReview updated: 2026-07-05 09:39:11 UTC
🛑 Suggested Action - Reject/Close
Review summary Blockers
Nits — 4 non-blocking
Why this is blocked
Review context
Contributor next steps
Signal definitions
🟩 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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (No linked issue detected; Maintainer requires a linked issue; AI reviewers agree on a likely critical defect: PR description: this PR does not close or clearly link an eligible open issue; please add the maintainer-authorized issue link or explain why this is exempt from the repo's issue-scope requirement.). 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. |
Summary
Extends the secret-scan analyzer with 6 new high-confidence rules for managed-database connection strings
that embed credentials. These follow the existing
cloudinary_urlrule (scheme://<id>:<secret>@<host>): acommitted connection string with an embedded password is a high-severity credential leak.
mongodb_atlas_urimongodb+srv://<user>:<pass>@…mongodb.netneon_postgres_uripostgres://<user>:<pass>@…neon.techsupabase_postgres_uripostgres://<user>:<pass>@…supabase.coupstash_redis_urirediss://default:<pass>@…upstash.ioplanetscale_mysql_urimysql://<user>:<pass>@…psdb.cloudcockroachdb_uripostgres://<user>:<pass>@…cockroachlabs.cloudWhy these are false-positive-safe. Each rule requires all three of:
user:passwordpair — the charset excludes<and>, so an angle-bracket docs placeholder(
<user>:<password>, MongoDB's own documented format) does not match;mongodb.net,neon.tech,supabase.co,upstash.io,psdb.cloud,cockroachlabs.cloud) — so an ordinary self-hosted/local URI (postgres://user:pass@localhost) is neverflagged;
(?![a-z0-9.-])— so a look-alike suffix host (…mongodb.net.evil.com) can'tmatch via the provider-host prefix.
All three conditions are asserted in the negative test (angle-bracket placeholders,
localhost/127.0.0.1hosts, and a suffix-host look-alike all produce zero findings), and a positive test asserts each provider's real
connection-string shape produces exactly one finding of its own kind. This mirrors the merged
cloudinary_urlrule, which already treats a credential-embedding URL as a high-confidence secret.
All 6 are new kinds (verified against the analyzer's current rule kinds — no duplicate) and inserted before
the generic-assignment rule so the specific kind wins.
SecretFinding.kindis a free-formstring, so there isno
types.ts/render.ts/analyzer-metadata.jsonchange — a two-file, rules-only diff.No linked issue: additive detection-coverage extending an existing analyzer along its own established lines; each
rule is a self-evident, industry-standard credential shape with no public API/schema/deploy surface change — fits
the repo's
preferred(not required) linked-issue policy.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run typechecknpm run rees:test— the review-enrichment build + analyzer suite (see note below)npm run test:coverage(N/A — this analyzer is inreview-enrichment/, outside the rootsrc/**Codecov scope)npm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
git diff --check(clean), the review-enrichment TypeScript build (exit 0), and the secret-scansuite via
node --test— 106/106 pass, including a table test asserting each of the 6 new connection-stringformats produces exactly one finding of its own kind at high confidence, and a negative test asserting
angle-bracket placeholders, local/self-hosted hosts, and a suffix-host look-alike produce none.
metadata:checkstep ofrees:test. This change adds onlyRULES entries (no analyzer descriptor field), so the committed
analyzer-metadata.json/ UI mirror areunchanged (a local regeneration produces a zero-content diff) and
metadata:checkpasses on CI (Linux). Onthis Windows dev box
metadata:checkreports a spurious line-ending difference; it fails identically onunmodified
main.analyzer-metadata.jsonwas NOT modified.Safety
UI Evidencesection 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.Notes
rule or the analyzer descriptor changed, so current findings and
analyzer-metadata.jsonare unaffected. Eachnew kind reports only
file:line+ the public-safe kind, never the matched value.so GitHub push protection does not flag this fixture file.