Skip to content

fix(sentinel): hash-pin the image's Python dependencies - #174

Merged
imran-siddique merged 1 commit into
mainfrom
fix/pin-sentinel-image-deps
Sep 8, 2026
Merged

fix(sentinel): hash-pin the image's Python dependencies#174
imran-siddique merged 1 commit into
mainfrom
fix/pin-sentinel-image-deps

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

Part of working through this repo's 35 Scorecard pipCommand not pinned by hash findings. This is the only one of them that is a real defect.

The base image is already pinned by digest. The Python layer on top was not: requirements.txt is all floating >= constraints, so two builds of the same Dockerfile can install different code. This is an image people build and run from the README's docker-compose, not something CI produces once and throws away.

requirements.txt stays as the statement of intent. requirements.lock.txt is the resolved, hash-pinned form and is what gets installed. The compile command sits in the Dockerfile next to the COPY so the next person does not have to guess it.

Verified with pip install --dry-run --require-hashes against the lock: resolves clean, 44 packages, and picks up cryptography 50.0.1, above the floor the org-wide advisory work set.

The other 34 findings

Worth saying here so this PR is not mistaken for a partial fix. I enumerated every pip invocation in the repo's workflows and Dockerfiles and classified it:

  • 25 are local-path installs (pip install --no-deps ./packages/agentrust-capture-core, pip install -e "integrations/aeoess-aps[test]", pip install --no-deps .). There is no registry fetch and no published artifact, so there is nothing to hash. Hash-pinning is not defined for a local tree.
  • 11 are deliberate published-artifact fetches. Their step names say so: "Install released agentrust-io packages", "Install the published SDK and test-only extras", "Install the public wheel without a package cache". Three of them already carry a written comment saying the plugin's own requirements "stay resolved from PyPI rather than pinned" because they are the subject of the test. Pinning these would freeze the exact artifact the job exists to exercise, which is how the published-vs-local drift in agentrust-trace got caught in the first place. All of these jobs are permissions: contents: read.

Those 34 are being dismissed with per-file reasons rather than changed, since "fixing" them would either be impossible or would remove the coverage they provide.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XbDBXDWWvMFa7c2jGgyq9t

The base image is already pinned by digest; the Python layer on top was not.
requirements.txt is all floating >= constraints, so two builds of the same
Dockerfile could install different code, and this is an image people build and
run from the README's docker-compose rather than something CI produces once.

requirements.txt stays as the statement of intent. requirements.lock.txt is the
resolved, hash-pinned form and is what gets installed, so a rebuild fetches the
same bytes. The compile command is in the Dockerfile next to the COPY.

Verified with pip install --dry-run --require-hashes against the lock: resolves
clean, 44 packages, and picks up cryptography 50.0.1, above the floor the
org-wide advisory work set.

This is the only unpinned install in the repo that is neither a local path nor
a deliberate published-artifact fetch. The other Scorecard pipCommand findings
here are one or the other, and are being dismissed with reasons rather than
"fixed" into something they should not be.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbDBXDWWvMFa7c2jGgyq9t
@imran-siddique
imran-siddique merged commit 4e7a59e into main Sep 8, 2026
10 checks passed
@imran-siddique
imran-siddique deleted the fix/pin-sentinel-image-deps branch September 8, 2026 00:37
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