Skip to content

feat(lint): opt in to scanning every source for cleartext secrets - #367

Open
DeryFerd wants to merge 1 commit into
qybaihe:mainfrom
DeryFerd:feat/plaintext-secret-scan-all
Open

DeryFerd wants to merge 1 commit into
qybaihe:mainfrom
DeryFerd:feat/plaintext-secret-scan-all

Conversation

@DeryFerd

@DeryFerd DeryFerd commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

The plaintext-secret gate scans entitlement-shaped files: panel, license, vault, auth, gate, entitlement by basename (or as a path segment) across the known JS/HTML/TS extensions. That scoping keeps the false-positive budget low, but it also means a high-entropy key written in src/config.js is never reported, because the file's name does not match the filter and it is not even read. This adds an opt-in that widens discovery to every JS/HTML/TS source, and leaves the default exactly as it was.

What changed

  • discoverAndLintPlaintextSecrets gains a scanAllFiles option, and walkTargets accepts every scanned source when it is set while keeping the entitlement-shaped filter when it is not (src/engine/plaintext-secret-lint.ts).
  • scanPackagingGates gains plaintextSecretScanAll and threads it into the plaintext discovery call (src/engine/packaging-gates.ts).
  • CLI bla lint gains --plaintext-secret-scan-all, and the MCP bla_lint tool gains plaintext_secret_scan_all (src/cli.ts, src/mcp/server.ts).
  • tests/plaintext-secret-scan-all.test.ts covers both layers: a secret in src/config.js is skipped by default and reported once the flag is set, for the discovery function and for the unified gate scan.

Why this matters

The gate is the last stop before a cleartext secret ships, and a basename heuristic is a reasonable default. But a user who wants coverage across the whole source tree currently has no way to ask for it. This gives them one without loosening the default for everyone else.

Tests

  • npx vitest run tests/plaintext-secret-scan-all.test.ts tests/plaintext-secret-lint.test.ts tests/packaging-gates.test.ts tests/packaging-gate-exhaustiveness.test.ts tests/cli-flag-validation.test.ts tests/mcp-engine-capability-parity.test.ts passes, 48 tests.
  • npx vitest run tests/mcp-lint-seal.test.ts tests/mcp-agent-contract.test.ts tests/lint-sarif.test.ts tests/hardening-cli-mcp-setup.test.ts passes, 34 tests with 2 skipped.

Compatibility

The default is unchanged: without the flag the gate scans exactly the files it scanned before, so the existing false-positive budget is preserved. The flag is additive on the CLI, in the MCP schema and in the scan options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant