Skip to content

task: Permissions hardening across all workflow files (PM-22119)#855

Merged
m2ux merged 14 commits intomainfrom
task/PM-22119-permissions-hardening
Mar 6, 2026
Merged

task: Permissions hardening across all workflow files (PM-22119)#855
m2ux merged 14 commits intomainfrom
task/PM-22119-permissions-hardening

Conversation

@m2ux
Copy link
Copy Markdown
Contributor

@m2ux m2ux commented Mar 3, 2026

Summary

Harden GitHub Actions workflow permissions across 18 files by applying least-privilege principles: set permissions: {} at workflow level and move scopes to per-job declarations. Eliminates secrets: inherit from indexer reusable workflow calls.

🎫 Ticket 📐 Engineering


Motivation

The repository's CI/CD workflows grant overly broad permissions. continuous-integration.yml declares 4 write scopes at workflow level inherited by 23 jobs (14 only need read access). release-image.yml declares 5 write scopes inherited by all jobs. 14 workflow files have no permissions: block at all, inheriting repository defaults. Two indexer files pass all secrets to reusable workflows via secrets: inherit.

This over-permissioning increases the blast radius of supply-chain or CI/CD attacks. A compromised dependency or malicious PR could trigger jobs with unintended write access to packages, contents, or attestations.


Changes

  • continuous-integration.yml (M-F005) — Set permissions: {} at workflow level; add per-job contents: read to 14 test/build jobs; add full SBOM scopes to 2 SBOM scan jobs
  • release-image.yml (M-F013) — Set permissions: {} at workflow level; add minimal per-job permissions to all 11 jobs
  • 9 main repo workflow files (M-F006) — Add explicit permissions: 7 files get contents: read, prs.yml gets pull-requests: write, security-audit-scan.yml gets security-events: write
  • 5 indexer QA workflow files (M-F006) — Add permissions: { contents: read } at workflow level
  • 2 indexer integration test files (M-F015) — Replace secrets: inherit with explicit passing of 7 consumed secrets

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason: CI/CD config only
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • No new todos introduced

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other
  • N/A

🗹 TODO before merging

  • Ready for review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 3, 2026

kics-logo

KICS version: v2.1.19

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 47
LOW LOW 3
INFO INFO 59
TRACE TRACE 0
TOTAL TOTAL 109
Metric Values
Files scanned placeholder 26
Files parsed placeholder 26
Files failed to scan placeholder 0
Total executed queries placeholder 73
Queries failed to execute placeholder 0
Execution time placeholder 12

@m2ux m2ux marked this pull request as ready for review March 4, 2026 10:37
@m2ux m2ux requested a review from a team as a code owner March 4, 2026 10:37
@m2ux m2ux self-assigned this Mar 4, 2026
@m2ux m2ux enabled auto-merge March 5, 2026 09:04
m2ux and others added 14 commits March 6, 2026 10:10
Harden GitHub Actions workflow permissions across all workflow files
by applying least-privilege principles (M-F005, M-F006, M-F013, M-F015).

Made-with: Cursor
Move workflow-level permissions to per-job declarations. Set
permissions: {} at workflow level (deny all by default). Add
permissions: { contents: read } to 14 test/build-only jobs that
previously inherited id-token:write, contents:write, packages:write,
and attestations:write. Existing job-level overrides on 7 scoped
jobs are preserved.

Ref: PM-22119
Made-with: Cursor
Move workflow-level permissions to per-job declarations. Set
permissions: {} at workflow level. Add minimal per-job permissions
to all 11 jobs based on their actual needs.

Ref: PM-22119
Made-with: Cursor
Add permissions blocks to 9 main repo workflow files that previously
inherited repository defaults. 7 files get workflow-level
permissions: { contents: read }. prs.yml and security-audit-scan.yml
get permissions: {} with per-job scoping for their write needs.

Ref: PM-22119
Made-with: Cursor
Updates indexer submodule to include M-F006 (permissions blocks) and
M-F015 (explicit secret passing) changes.

Ref: PM-22119
Made-with: Cursor
The sbom-scan-node and sbom-scan-toolkit jobs call the reusable
sbom-scan-image.yml workflow and need packages:write, id-token:write,
and attestations:write. These were lost when the workflow-level
permissions changed to permissions: {}.

Ref: PM-22119
Made-with: Cursor
Point to indexer main which has published Docker images, resolving
the build-indexer-images CI failure. Indexer permissions changes
tracked separately in midnightntwrk/midnight-indexer#866.

Ref: PM-22119
Made-with: Cursor
…les-image.yml

File was deleted on main and modified in our branch (permissions added).
Accept the deletion since the workflow no longer exists upstream.

Made-with: Cursor
Reset indexer submodule pointer to 3f0a8ef (same as main). Indexer
permissions changes tracked in midnightntwrk/midnight-indexer#866.

Ref: PM-22119
Made-with: Cursor
@m2ux m2ux force-pushed the task/PM-22119-permissions-hardening branch from 079d025 to ad62e09 Compare March 6, 2026 10:17
@m2ux m2ux added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit 2161ee7 Mar 6, 2026
35 checks passed
@m2ux m2ux deleted the task/PM-22119-permissions-hardening branch March 6, 2026 13:35
gilescope pushed a commit that referenced this pull request Apr 8, 2026
* minimal setup for testing

minimal ci.yml

* add to full setup

* Replace use of earthly in dispatch

* Remove redundant earthly files

* update chain spec creation code

* fix artifact upload path

* fix: to-build logic + deny.toml

* fix: unicode

* fix: CDLA

* fix: apache

* fix: GPL

* fix: GPL

* fix: unused-allow

* fix. allow

* fix: allow

* fix: order

* fix: don't check licenses

* fix: to-build and remove non linux x86_64 builds

* fix: overwrite flake

* fix: no to-build

* fix: clean

* fix: debug

* fix: rm

* fix. sha

* fix: fetch depth

* fix: remove devshell tests

* fix: build and push

* chore: remove unused files blabla and foobar

* fix:: sha

---------

Co-authored-by: tobias pflug <tobias.pflug@gmail.com>
gilescope pushed a commit that referenced this pull request Apr 8, 2026
@gilescope gilescope added this to the node-1.0.0 milestone Apr 10, 2026
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.

3 participants