Repository navigation
Scan for secrets faster with Secretlint v14 - #1359
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
Upgrade @secretlint/core, source-creator, types and secretlint-rule-no-dotenv to 14.0.1 and use the recommended preset that v14 builds into @secretlint/core. This drops @secretlint/secretlint-rule-preset-recommend, which npm reports as deprecated at install. v14 checks each file for the keywords of its rules before running them, so most files skip the rules entirely. Its profiler is off unless explicitly enabled, so vsce no longer needs to turn it off. The recommended private-key rule in v14 has the same gaps as 13.1.0, so vsce keeps its own rule for EC, Ed25519 and encrypted keys. Co-authored-by: Copilot <[email protected]>
Declare "PRIVATE KEY" as the keyword of vsce's private-key rule. Every key the rule reports contains it, so Secretlint v14 no longer decodes and scans files that don't, which was the case for every file before because this was the only recommended rule without keywords. Co-authored-by: Copilot <[email protected]>
Benjamin Christopher Simmonds (benibenj)
force-pushed
the
benibenj/agents/secretlint-v14
branch
from
November 24, 2026 20:22
38f0a3c to
476aa73
Compare
Benjamin Christopher Simmonds (benibenj)
marked this pull request as ready for review
November 24, 2026 20:23
Connor Peet (connor4312)
approved these changes
Nov 24, 2026
Connor Peet (connor4312)
left a comment
Member
There was a problem hiding this comment.
Reviewed the Secretlint v14 integration, scanner configuration, and tests. No blocking or important correctness or security findings.
Written by Connor's agent
TylerLeonhardt
approved these changes
Nov 24, 2026
Benjamin Christopher Simmonds (benibenj)
merged commit Nov 24, 2026
3c09c33
into
main
7 checks passed
Benjamin Christopher Simmonds (benibenj)
deleted the
benibenj/agents/secretlint-v14
branch
November 24, 2026 20:55
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.
Before: Secret scanning runs every Secretlint rule (27 since #1358) over the full text of every file vsce packages. Installing vsce also prints an npm deprecation warning for
@secretlint/secretlint-rule-preset-recommend, which Secretlint no longer publishes.After: vsce uses Secretlint v14. It first checks each file for the keywords its rules look for, and runs a rule only on files that contain one of them. Most files contain none, so they aren't even decoded. The detected secrets don't change, secret scanning uses about 4× less CPU, and the deprecated package is gone.
Measured locally (macOS, Apple Silicon, Node 24) with extensions made of VS Code source files, median of 5 runs. The table shows CPU time because the machine was under load and wall-clock times were noisy.
vsce package, 2,048 filesDetails
Changes
@secretlint/core,source-creator,typesandsecretlint-rule-no-dotenvgo from 13.1.0 to 14.0.1.@secretlint/secretlint-rule-preset-recommendis removed; the preset now comes from@secretlint/core/builtin. Rule ids don't change, so vsce's per-rule options, the placeholder allowance from Detect more kinds of secrets when packaging (Secretlint 13.1.0 rules) #1358 and the--allow-package-secretsnames keep working. The placeholder allowance now takes its list of rules fromrecommendedRules.lintSourceskips all profiling work while it's off.PRIVATE KEY. It was the only rule without keywords, so v14 still had to decode and check every file. With the keyword it skips files that can't contain a key, which alone saves about 27% CPU and 36% memory at 8,192 files.min-release-age=7blocks it until Nov 29.Side effects
@secretlint/corenow contains all built-in rules.@secretlint/coreupdates. Secretlint only adds rules to the recommended preset in major versions, so^14stays stable.Testing
npm test: 409 passing..envfiles): identical to main..p12keys (default and legacy encryption) and a service-account JSON key, a file with a byte-order mark, Latin-1 bytes, UTF-16 (skipped by both), an EC key with CRLF line endings, a 4.6 MB minified file, an empty file, a binary.wasmfile, a key inside Markdown, and a nested.envfile.vsce package: time in Secretlint code went from about 870 ms to about 220 ms, of which regular expressions went from 391 ms to 4 ms. No profiling marks are recorded.