hardening(docs): MCP key pepper quality check and build guard - #22
Merged
Merged
Conversation
…rning - mcpPepperStatus: the pepper must be at least 32 chars after trimming, have at least 8 distinct characters and no surrounding whitespace. A whitespace-only or low-variety pepper is refused. - The resolver logs once when MCP_API_KEYS is configured without a usable pepper (keys fail closed to public). - check:mcp-keys fails the build in the same case. - The weak-pepper assertions in check-mcp-keys.mjs now store the key under the weak pepper, so only the pepper rule can refuse it. - Docs: the pepper requirements, and that keys are minted only with the script. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012cD3fDq5vhh2YWZPU2SV6H
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.
Summary
Small hardening follow-up to #20: MCP key pepper handling.
MCP_KEY_PEPPERmust be at least 32 chars after trimming, have at least 8 distinct characters, and carry no surrounding whitespace. A whitespace-only or low-variety pepper is refused.MCP_API_KEYSis configured without a usable pepper, the server logs one line andcheck:mcp-keys(postbuild) fails the build.check-mcp-keys.mjsnow store the key under the weak pepper, so only the pepper rule can refuse it..env.exampleand README state the pepper requirements, and that keys are minted only withscripts/mint-mcp-key.mjs.Tests:
test/mcp-key-floor.test.tscovers pepper status, the whitespace pepper and the one-time warning, pluscheck:mcp-keys. Hand mutants (floor 32 → 1, whitespace, distinct-count, warning removed) are each killed. Details are in the private audit record.OWNER:
MCP_KEY_PEPPERmust meet the rule above. A build withMCP_API_KEYSset and an unusable pepper now fails.Tests and commands: main: 98 passed / 4 skipped. This PR: 101 / 4. The run used node 22.21.1 and npm 10.9.4:
npm ci,audit --audit-level=high,typecheck,test,build,verify:bundle,content-lint --strict,sbom. All green.🤖 Generated with Claude Code
https://claude.ai/code/session_012cD3fDq5vhh2YWZPU2SV6H