Skip to content

ci(security): scope packages:write to the job in nix-image workflow - #932

Merged
c-vigo merged 1 commit into
devfrom
bugfix/931-scope-nix-image-packages-write
Jul 8, 2026
Merged

c-vigo merged 1 commit into
devfrom
bugfix/931-scope-nix-image-packages-write

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Closes the last live Scorecard `TokenPermissions` finding (alert #7627).

What

nix-image.yml granted packages: write at the top level, so every job in
the workflow inherited a writable GITHUB_TOKEN. Scorecard scores that 0.

This defaults the top-level token to contents: read and escalates
packages: write per job:

  • build-and-test — new job-scoped block (GHCR login + per-arch discovery-tag push)
  • multi-arch-index — already self-scoped, unchanged

No 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-latest analysis
chain, 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

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
@c-vigo
c-vigo requested a review from gerchowl July 8, 2026 12:58
@c-vigo
c-vigo changed the base branch from main to dev July 8, 2026 14:55
@c-vigo
c-vigo merged commit 214eca4 into dev Jul 8, 2026
13 checks passed
@c-vigo
c-vigo deleted the bugfix/931-scope-nix-image-packages-write branch July 8, 2026 14:57
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