Skip to content

[sec-check] fix: scope workflow token permissions to job level - #6256

Merged
clubanderson merged 1 commit into
mainfrom
sec/fix-token-permissions-docs
Jul 8, 2026
Merged

clubanderson merged 1 commit into
mainfrom
sec/fix-token-permissions-docs

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Security Fix

Moves overly-broad workflow-level permissions: blocks to read-all so the GITHUB_TOKEN defaults to read-only for all jobs. Jobs requiring elevated permissions have explicit job-level permissions: blocks.

Affected files:

  • .github/workflows/copilot-automation.yml — workflow-level contents: read → read-all
  • .github/workflows/ai-fix.yml — workflow-level contents: read → read-all
  • .github/workflows/copilot-dco.yml — workflow-level write permissions → read-all; job-level block added
  • .github/workflows/scorecard.yml — workflow-level write permissions → read-all; job-level permissions added

Closes Scorecard alerts #47, #46, #45, #43, #6.

Fixes #6255


Filed by sec-check agent (ACMM L6 — full mode)

…card TokenPermissionsID)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: sec-check <sec-check@hive.kubestellar.io>
Copilot AI review requested due to automatic review settings July 8, 2026 21:41
@clubanderson
clubanderson requested a review from KPRoche as a code owner July 8, 2026 21:41
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Jul 8, 2026
@netlify

netlify Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for kubestellar-docs ready!

Name Link
🔨 Latest commit ba1286e
🔍 Latest deploy log https://app.netlify.com/projects/kubestellar-docs/deploys/6a4ec3f7338b4b0008a89bd4
😎 Deploy Preview https://deploy-preview-6256--kubestellar-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubestellar-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign clubanderson for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jul 8, 2026
@clubanderson clubanderson added security and removed dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 8, 2026
@github-actions github-actions Bot added ci-cd yaml dco-signoff: yes Indicates the PR's author has signed the DCO. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jul 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to address OSSF Scorecard TokenPermissions alerts by reducing overly broad GITHUB_TOKEN permissions in several GitHub Actions workflows and shifting elevated scopes to explicit job-level permissions: blocks.

Changes:

  • Replaces workflow-level permission maps with permissions: read-all across multiple workflows.
  • Adds/updates job-level permissions: blocks for workflows that require write scopes (e.g., Scorecard uploads, Copilot automation).
  • Adjusts Copilot DCO workflow to use job-level permissions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/scorecard.yml Moves elevated permissions from workflow scope to the analysis job; workflow default set to read-all.
.github/workflows/copilot-dco.yml Sets workflow default to read-all and adds job-level permissions for the reusable DCO workflow.
.github/workflows/copilot-automation.yml Changes workflow-level permissions from contents: read to read-all while keeping job-level write permissions.
.github/workflows/ai-fix.yml Changes workflow-level permissions from contents: read to read-all while keeping job-level write permissions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

contents: read
actions: read
id-token: write
permissions: read-all
pull-requests: read
statuses: write
# Minimal default permissions at workflow scope; job permissions are declared explicitly below.
permissions: read-all
Comment on lines +13 to +15
contents: read
pull-requests: write
statuses: write

permissions:
contents: read
permissions: read-all

permissions:
contents: read
permissions: read-all
@clubanderson
clubanderson merged commit 221c715 into main Jul 8, 2026
20 of 21 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the sec/fix-token-permissions-docs branch July 8, 2026 21:56
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-cd dco-signoff: yes Indicates the PR's author has signed the DCO. security size/S Denotes a PR that changes 10-29 lines, ignoring generated files. yaml

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[sec-check] Workflow token over-permissioned: 5 Scorecard TokenPermissions alerts in 5 workflows

2 participants