fix: harden pip install against supply chain attacks#490
Merged
Conversation
- Expand requirements.txt via pip-compile to pin all transitive dependencies - Add --no-deps to Dockerfile pip install to prevent runtime dep resolution Resolves pip-install-no-hash-check security alert. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
d886b13 to
ad899c2
Compare
jmeridth
approved these changes
Mar 5, 2026
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
Hardens the Docker build against supply chain attacks by preventing pip from resolving dependencies at install time.
Addresses the same class of vulnerability as issue-metrics code scanning alert #94 —
pip installwithout hash verification.Changes
requirements.txtpip-compileto pin all transitive dependencies to exact versionsDockerfile--no-depstopip install, preventing pip from resolving any packages beyond the explicit listWhy this approach
The Opengrep rule recommends two mitigations:
pip install --require-hasheswith hashed requirementspip install --no-depswhen using a pip-compile workflowWe chose option 2 because
--require-hashesgenerates platform-specific hashes that break Dependabot automated dependency update PRs. The--no-depsapproach with fully-resolved transitive dependencies provides equivalent security — no unvetted code can be introduced at install time.Testing
--no-depsin a fresh venv — all imports succeed