Skip to content

ci(templates): scope workflow token permissions to least privilege - #245

Merged
Shinrai merged 2 commits into
nextfrom
ci/harden-workflow-templates
Sep 1, 2026
Merged

Shinrai merged 2 commits into
nextfrom
ci/harden-workflow-templates

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

No bug fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

  • ci(templates): scope workflow token permissions to least privilege (ffd2469)
  • style(templates): normalize 6 workflow examples to 4-space indent (2c2223a)
👥 Contributors

Bring core-cicd/{ci,publish,release,update-major-version-tags} and
packaging-docs/{docker-publish,sync-org-labels} into the fleet's deliberate
4-space YAML convention (the other 25 templates already use it). Sequence-aware
reindent (dash at N+4, post-dash keys at N+6) with block-scalar content
preserved; verified semantically identical via yaml.safe_load(before)==after.
Apply the same Token-Permissions hardening to the individual-repo workflow
templates that consuming repos copy, so future syncs inherit it:

- Add a read-only top-level default (permissions: { contents: read }) to the 9
  templates that declared none (their jobs already grant their own scopes).
- For the 9 templates with a dangerous top-level write, narrow the top level to
  contents: read and move the full original scope set onto the reusable-calling
  job (write granted job-scoped, not workflow-wide). Behavior unchanged.

Non-dangerous top-level grants (pull-requests/issues write) are left as-is.
scorecard.yml keeps writes job-scoped; its header comment is reworded to match
the new read-only default.

Companion to the per-repo slothlet change (CLDMV/slothlet ci: scope workflow
token permissions) — these templates are the source those copies drifted from.
@cldmv-bot cldmv-bot Bot added the ! ci → next v4 flow: ci contributor PR targeting the next integration branch label Sep 1, 2026
@Shinrai
Shinrai merged commit b95577d into next Sep 1, 2026
16 checks passed
@cldmv-bot
cldmv-bot Bot deleted the ci/harden-workflow-templates branch September 1, 2026 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

! ci → next v4 flow: ci contributor PR targeting the next integration branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant