Skip to content

Commit 4ea4457

Browse files
fix(sentinel): hash-pin the image's Python dependencies
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
1 parent a068f08 commit 4ea4457

2 files changed

Lines changed: 1314 additions & 2 deletions

File tree

integrations/sentinel/Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@ FROM python:3.11-slim@sha256:9c900dea9e8fb7e16277c179b555cc72d29a352dbc33cff48ad
22

33
WORKDIR /app
44

5-
COPY requirements.txt .
6-
RUN pip install --no-cache-dir -r requirements.txt
5+
# requirements.txt states the constraints; requirements.lock.txt is the
6+
# resolved, hash-pinned form and is what actually gets installed, so a rebuild
7+
# of this image fetches the same bytes it did the first time. Recompile with:
8+
# uv pip compile integrations/sentinel/requirements.txt
9+
# --generate-hashes --universal --python-version 3.11
10+
# -o integrations/sentinel/requirements.lock.txt
11+
COPY requirements.txt requirements.lock.txt ./
12+
RUN pip install --no-cache-dir --require-hashes -r requirements.lock.txt
713

814
COPY sentinel/ ./sentinel/
915
COPY sample_trace.json .

0 commit comments

Comments
 (0)