Fix remaining OpenSSF Scorecard alerts: Pin all pip commands with hashes#29
Closed
taylorleese wants to merge 1 commit intomainfrom
Closed
Fix remaining OpenSSF Scorecard alerts: Pin all pip commands with hashes#29taylorleese wants to merge 1 commit intomainfrom
taylorleese wants to merge 1 commit intomainfrom
Conversation
This commit addresses the final OpenSSF Scorecard Pinned-Dependencies alert (#47) by ensuring all pip install commands use hash verification and eliminating unpinned local package installations. Changes: - Updated CI workflow to use --require-hashes for all pip installs - Updated publish workflow to use --require-hashes for build dependencies - Removed `pip install .` from Dockerfile entirely - Use PYTHONPATH instead of pip install for local package - Copy source code to runtime stage for module discovery This eliminates all "pipCommand not pinned by hash" warnings from OpenSSF Scorecard while maintaining full functionality. The Docker image still works correctly by using PYTHONPATH to locate modules instead of installing the local package. Fixes: #47 (and related alerts #45, #46 from previous commits) Related to: #11 (Docker MCP Registry PR #353) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #29 +/- ##
=======================================
Coverage 88.50% 88.50%
=======================================
Files 8 8
Lines 1140 1140
Branches 184 184
=======================================
Hits 1009 1009
Misses 79 79
Partials 52 52 |
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
This PR fixes the final OpenSSF Scorecard Pinned-Dependencies alert (#47) by ensuring all pip install commands use hash verification and eliminating unpinned local package installations.
Changes
GitHub Workflows
.github/workflows/ci.yml): Updated both test and lint jobs to use--require-hashesfor all pip installs.github/workflows/publish.yml): Updated build dependencies to use--require-hashesDockerfile
pip install .command entirely (was causing Scorecard alert)PYTHONPATH=/app/srcinstead for module discoveryWhy These Changes?
The OpenSSF Scorecard scanner was flagging:
5d17fc0to404ca55#47:pip install .in Dockerfile (line 25)--require-hashesThe PYTHONPATH Solution
Instead of installing the local package with
pip install .(which can't be hash-pinned since it's source code, not a package), we:/app/srcPYTHONPATH=/app/srcThis is actually better because:
Testing
5d17fc0to404ca55#47 resolves after mergeImpact on Docker MCP Registry PR
This PR is required for docker/mcp-registry PR #353. The Dockerfile is used for Docker-based MCP server distribution, and these changes:
Fixes
Fixes #47
Related alerts already fixed in previous PRs:
d13fa04to5d17fc0#42, Fix code scanning alert: Pin npm dependencies by hash in Dockerfile.glama #45, deps(deps): bump debian fromb4aa902toe899040#46 (fixed in PR Fix OpenSSF Scorecard alerts: Add --require-hashes flag to pip install commands #28)Related Issues
🤖 Generated with Claude Code