Pin all third-party dependencies #6

Open
opened 2026-11-26 02:15:17 +01:00 by claude-bot · 0 comments

Tags like @v4, latest or an unpinned package can change under you without a commit in this repo (see the tj-actions/changed-files incident, March 2025). Pinning makes every change to what runs visible in git.

Enterprise practice: actions pinned by commit SHA, images by digest, packages by hash, downloaded binaries verified by checksum.

Steps

  • Pin every uses: to a full commit SHA with the version as a comment (@<sha> # v4)
  • Lock lint tools with hashes: move direct dependencies to requirements-dev.in, generate requirements-dev.txt with uv pip compile --generate-hashes, and install with pip install --require-hashes -r requirements-dev.txt
  • Downloaded binaries are checked against a SHA-256 (Betterleaks)
  • Pin container images in adopted stacks by digest (image: name:tag@sha256:...), as part of each stack adoption
  • Document the pinning rule in CONVENTIONS.md

Tools

uv (uv pip compile), pip --require-hashes, sha256sum.

Done when

No workflow, requirements file or stack references a moving tag or an unhashed package.

Tags like `@v4`, `latest` or an unpinned package can change under you without a commit in this repo (see the `tj-actions/changed-files` incident, March 2025). Pinning makes every change to what runs visible in git. **Enterprise practice:** actions pinned by commit SHA, images by digest, packages by hash, downloaded binaries verified by checksum. ## Steps - [ ] Pin every `uses:` to a full commit SHA with the version as a comment (`@<sha> # v4`) - [ ] Lock lint tools with hashes: move direct dependencies to `requirements-dev.in`, generate `requirements-dev.txt` with `uv pip compile --generate-hashes`, and install with `pip install --require-hashes -r requirements-dev.txt` - [ ] Downloaded binaries are checked against a SHA-256 (Betterleaks) - [ ] Pin container images in adopted stacks by digest (`image: name:tag@sha256:...`), as part of each stack adoption - [ ] Document the pinning rule in `CONVENTIONS.md` ## Tools uv (`uv pip compile`), pip `--require-hashes`, `sha256sum`. ## Done when No workflow, requirements file or stack references a moving tag or an unhashed package.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kasun/homelab-ansible#6