Repository navigation
Pin every GitHub Action to a commit SHA - #4
Merged
Merged
Conversation
A tag is a moving pointer: `actions/checkout@v4` is whatever the owner, or whoever takes the owner's account, last pointed v4 at. That matters more here than anywhere else in the estate. release.yml runs with `contents: write` and GITHUB_TOKEN to publish the binaries people install, so an action swapped underneath it does not just leak a build — it ships a backdoored CLI under our name to everyone who upgrades. All 6 references now pin the SHA the tag currently resolves to, with the version kept as a trailing comment so the file still reads and Renovate and Dependabot keep proposing bumps. No versions change. ci.yml also gains a top-level `permissions: contents: read`; it had none. release.yml already declared its own, and the two jobs that publish keep their `contents: write` — a job-level block replaces the default rather than adding to it.
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.
Why this repo matters most
A tag is a moving pointer.
actions/checkout@v4is whatever the owner — or whoever takes the owner's account — last pointedv4at.That matters more here than anywhere else in the estate.
release.ymlruns withcontents: writeandGITHUB_TOKENto publish the binaries people install. An action swapped underneath it does not just leak a build — it ships a backdoored CLI under our name to everyone who upgrades.This is how
trivy-actionandkics-github-actionwere compromised.The change
All 6 references pin a 40-character commit SHA, resolved from the tag already in use, with the version kept as a trailing comment:
No version changes — behaviour-neutral. Renovate and Dependabot understand this form and keep proposing bumps.
ci.ymlalso gains a top-levelpermissions: contents: read; it had none.release.ymlalready declared its own, and the two publishing jobs keep theircontents: write— a job-level block replaces the default rather than adding to it, so releases are unaffected.Verification
Every
uses:checked mechanically against[0-9a-f]{40}, and both files re-parsed as YAML after the edit. The diff is pins plus the oneci.ymlpermissions block — nothing else.Note, separate from this PR
tael-cliis registered in Ankra as an application with a container image (registry.ankra.cloud/.../cli), but this repo has nobuild-and-publish.yml— it ships binaries viarelease.yml. So no image is ever built, and Ankra reportstrivy_pendingwith 0 packages and 0 code findings.Those zeros read as "clean" on the dashboard when they actually mean "never scanned". Worth either deregistering the application or giving this repo its own scan step.
Related
Same fix merged in
taelio/frontend#4,taelio/backend#2,taelio/agent#2.