Repository navigation
ci(security): scope packages:write to the job in nix-image workflow - #932
Merged
Merged
Conversation
Default the top-level GITHUB_TOKEN to read-only and escalate packages:write per job (build-and-test; multi-arch-index already self-scopes), clearing the Scorecard TokenPermissions finding (alert #7627). Refs: #931
3 tasks done
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.
Closes the last live Scorecard `TokenPermissions` finding (alert #7627).
What
nix-image.ymlgrantedpackages: writeat the top level, so every job inthe workflow inherited a writable
GITHUB_TOKEN. Scorecard scores that 0.This defaults the top-level token to
contents: readand escalatespackages: writeper job:build-and-test— new job-scoped block (GHCR login + per-arch discovery-tag push)multi-arch-index— already self-scoped, unchangedNo behavioural change; the same jobs retain the same write scope, just declared at
job level. Alert #7627 auto-resolves on the next Scorecard run of
main.Context
Part of the post-#642 security-tab close-out (#931): the 308 orphaned Debian
Trivy alerts were cleared by deleting the dead
container-image-latestanalysischain, and the 12 job-level Scorecard writes (release/promote/sync automation,
minimal required scope) were dismissed as won't-fix. This PR is the one
finding worth fixing in code.
Refs: #931