Repository navigation
Detect more kinds of secrets when packaging (Secretlint 13.1.0 rules) - #1358
Merged
Benjamin Christopher Simmonds (benibenj) merged 2 commits intoNov 24, 2026
Merged
Benjamin Christopher Simmonds (benibenj) merged 2 commits into
Benjamin Christopher Simmonds (benibenj) merged 2 commits into
Conversation
This was referenced Nov 23, 2026
Aiday Marlen Kyzy (aiday-mar)
previously approved these changes
Nov 23, 2026
Benjamin Christopher Simmonds (benibenj)
dismissed
Aiday Marlen Kyzy (aiday-mar)’s stale review
November 24, 2026 09:37
The merge-base changed after approval.
Martin Aeschlimann (aeschli)
previously approved these changes
Nov 24, 2026
Benjamin Christopher Simmonds (benibenj)
dismissed
Martin Aeschlimann (aeschli)’s stale review
November 24, 2026 09:42
The merge-base changed after approval.
Ulugbek Abdullaev (ulugbekna)
previously approved these changes
Nov 24, 2026
Benjamin Christopher Simmonds (benibenj)
dismissed
Ulugbek Abdullaev (ulugbekna)’s stale review
November 24, 2026 10:10
The merge-base changed after approval.
Ulugbek Abdullaev (ulugbekna)
previously approved these changes
Nov 24, 2026
Benjamin Christopher Simmonds (benibenj)
dismissed
Ulugbek Abdullaev (ulugbekna)’s stale review
November 24, 2026 10:15
The merge-base changed after approval.
Aiday Marlen Kyzy (aiday-mar)
previously approved these changes
Nov 24, 2026
Benjamin Christopher Simmonds (benibenj)
dismissed
Aiday Marlen Kyzy (aiday-mar)’s stale review
November 24, 2026 11:23
The merge-base changed after approval.
Aiday Marlen Kyzy (aiday-mar)
previously approved these changes
Nov 24, 2026
Benjamin Christopher Simmonds (benibenj)
dismissed
Aiday Marlen Kyzy (aiday-mar)’s stale review
November 24, 2026 11:28
The merge-base changed after approval.
Upgrade @secretlint/secretlint-rule-preset-recommend from 10.2.2 to 13.1.0, which adds detectors for 15 more kinds of secrets (for example Stripe, GitLab, Hugging Face, Docker, Anthropic and database connection strings) and ignores placeholder private keys and malformed npm tokens. Keep blocking every private key vsce blocked before: the new preset skips short DER keys such as EC P-256 and Ed25519 and ENCRYPTED PRIVATE KEY blocks, so a small vsce rule reports exactly those keys. It uses the privatekey rule name, so --allow-package-secrets privatekey still applies. Allow database URLs with <placeholder> credentials or a local host, which appear in documentation and bundled libraries such as Prisma. Correct the npm token fixture to the real 40-character length, which the stricter npm rule requires. Co-authored-by: Copilot <[email protected]>
Documentation and sample files use placeholders such as sk_live_xxxxxxxxxxxxxxxxxxxxxxxx or glpat-xxxxxxxxxxxxxxxxxxxx, which the recommended rules report because they only check a token's prefix and length. Allow any match that repeats a character 8 times in a row: real tokens are random and practically never do. The allowance is added to every scanner rule in the recommended preset, keeping vsce's existing per-rule allows. The privatekey and gcp rules don't get it, because real private keys often contain long runs of "A". Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj)
force-pushed
the
benibenj/agents/secretlint-rules-13
branch
from
November 24, 2026 11:41
347e2b8 to
cbf4a4a
Compare
Aiday Marlen Kyzy (aiday-mar)
approved these changes
Nov 24, 2026
Logan Ramos (lramos15)
approved these changes
Nov 24, 2026
Benjamin Christopher Simmonds (benibenj)
merged commit Nov 24, 2026
86ad55f
into
main
7 checks passed
Benjamin Christopher Simmonds (benibenj)
deleted the
benibenj/agents/secretlint-rules-13
branch
November 24, 2026 13:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes:
vsce packageandvsce publishnow block 15 more kinds of secrets, using Secretlint 13.1.0's recommended rules: Stripe, GitLab, Grafana, Anthropic, Groq, Hugging Face, Notion, HashiCorp Vault, Vercel, Databricks, Docker, Figma, Cloudflare and Tailscale tokens, plus database connection strings with a password. They also stop flagging two things that aren't secrets: placeholder private-key blocks (aBEGIN … PRIVATE KEYheader followed byAAAA…) and strings that are too long to be npm tokens.Still blocks every private key it blocks today: the new rules skip EC (P-256) private keys, Ed25519 private keys and encrypted private keys. vsce adds a small check of its own for exactly those keys.
--allow-package-secrets privatekeystill covers them.Avoids new false alarms from placeholders:
sk_live_xxxxxxxxxxxxxxxxxxxxxxxxorglpat-xxxxxxxxxxxxxxxxxxxx, are allowed. Real tokens are random and practically never do this.<password>, or with a local host such aslocalhost, are allowed. These are common in documentation and bundled libraries. For example, the Prisma extension ships amysql://[<user>[:<password>]@]<host>…template that would otherwise fail packaging.Possible side effects:
--allow-package-secrets <name>. The name is shown in the error, for example[stripe].…/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX).Measured locally (macOS, Apple Silicon, Node 24), with extensions made of VS Code source files:
vsce package, 2,048 files (median of 3)Details
Changes
@secretlint/secretlint-rule-preset-recommendgoes from 10.2.2 to 13.1.0. All other Secretlint packages are already at 13.1.0 from Speed up secret scanning by turning off Secretlint's profiler #1352.vsce-rule-privatekey(src/secretLintPrivateKeyRule.ts). The preset only reports PEM keys whose Base64 body starts withMIor the OpenSSH magic and has at least 100 characters, and it doesn't recognizeENCRYPTED PRIVATE KEY. The new rule reports PEM blocks with at least 50 Base64 characters (vsce's existing threshold from False positivefound private keyerror #1147) that start with an ASN.1 SEQUENCE (Mfollowed byA–P) and that the preset doesn't report. It mirrors the preset's type, length and prefix checks, so no key is reported twice. Placeholder bodies don't start with a SEQUENCE, so they stay allowed. Its rule name isprivatekey, so the existing allow flag applies.allowspattern/([A-Za-z0-9])\1{7,}/, added to vsce's existing per-rule allows. The list comes from the preset's exported rules, so rules added in later upgrades get it too.privatekeyandgcpare excluded, because real private keys often contain long runs ofA(zero bytes in Base64); the OpenSSH key fixture fails the packaging tests if they aren't.database-connection-stringalso gets twoallowspatterns:<…>placeholders andlocalhost/127.0.0.1/[::1]hosts._, is no longer flagged. The npm test fixture is corrected to the real 40-character length.secretlint-disablecomments still don't suppress findings in vsce (unchanged from main).Testing
npm test: 409 passing. New tests cover placeholder keys and npm tokens, the Stripe rule, placeholder tokens allowed while a realistic GitLab token is reported, each private-key format reported exactly once with rule nameprivatekey, and placeholder/local database URLs allowed while a real one is reported. Removing the private-key rule, the placeholder allowance or the database allowances makes the matching test fail, and giving the placeholder allowance to the private-key rules makes the OpenSSH key packaging tests fail.vsce packageruns, compared with main: EC, Ed25519, RSA, encrypted PKCS#8 and OpenSSH keys still fail packaging;--allow-package-secrets privatekeystill lets an EC key through; a placeholder key block now packages; the Prisma template and a MongoDB Atlas<db_password>example still package; a production-looking Postgres URL now fails.vsce packagewith dbgjs: no Secretlint profiling marks, and the new private-key rule takes about 2 ms in total. The extra time compared with Speed up secret scanning by turning off Secretlint's profiler #1352 is spread across the 15 new upstream rules.Follow-ups