Skip to content

Conversation

@step-security-bot
Copy link

@step-security-bot step-security-bot commented Feb 4, 2026

Summary

This pull request is created by StepSecurity at the request of @iav. Please merge the Pull Request to incorporate the requested changes. Please tag @iav on your message if you have any questions related to the PR.

Security Fixes

Least Privileged GitHub Actions Token Permissions

The GITHUB_TOKEN is an automatically generated secret to make authenticated calls to the GitHub API. GitHub recommends setting minimum token permissions for the GITHUB_TOKEN.

Feedback

For bug reports, feature requests, and general feedback; please email support@stepsecurity.io. To create such PRs, please visit https://app.stepsecurity.io/securerepo.

Signed-off-by: StepSecurity Bot bot@stepsecurity.io

Summary by CodeRabbit

  • Security

    • Hardened CI workflows by setting workflow token access for repository contents to read-only.
  • Chores

    • Applied consistent top-level permission declarations across workflows; no functional or behavioral changes to jobs or steps.

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
@github-actions github-actions bot added 02 Milestone: First quarter release size/small PR with less then 50 lines labels Feb 4, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

Added explicit top-level permissions: contents: read to multiple GitHub Actions workflows; one workflow also adjusted a curl command to move the webhook URL outside the JSON payload and added a per-job permissions entry.

Changes

Cohort / File(s) Summary
Data Sync Workflows
.github/workflows/data-sync-board-list.yml, .github/workflows/data-sync-labels.yml
Added top-level permissions: contents: read.
Infrastructure Workflow
.github/workflows/infrastructure-dispatch-to-fork.yml
Added top-level permissions: contents: read.
Maintenance — announce & assets & logs & welcome
.github/workflows/maintenance-announce-merge.yml, .github/workflows/maintenance-check-board-assets.yml, .github/workflows/maintenance-clean-workflow-logs.yml, .github/workflows/maintenance-welcome-issue.yml, .github/workflows/maintenance-welcome-pr.yml
Added top-level permissions: contents: read.
Maintenance — PR announce (payload fix)
.github/workflows/maintenance-announce-pr.yml
Added top-level permissions: contents: read, added per-job permissions: contents: read for the Announce job, and moved the Discord webhook URL out of the JSON payload in the curl step.
Maintenance — per-job permission additions
.github/workflows/maintenance-label-on-approval.yml, .github/workflows/maintenance-listen-review.yml
Added top-level permissions: contents: read and added or adjusted per-job permissions (e.g., contents: read, actions: read) where present.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nibbled through YAML, neat and spry,

Gave each workflow a tiny, safe eye.
contents: read — a polite little treat,
Webhook fixed, payload now complete.
Hop, hop—permissions tidy and spry!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[StepSecurity] ci: Harden GitHub Actions' clearly summarizes the main change: hardening GitHub Actions workflows by adding least-privileged permissions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added Needs review Seeking for review GitHub Actions GitHub Actions code labels Feb 4, 2026
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/maintenance-announce-pr.yml (1)

13-14: ⚠️ Potential issue | 🟠 Major

Missing contents: read at job level may break checkout.

When job-level permissions are specified, they replace (not merge with) the top-level permissions. This job only declares pull-requests: read, so it won't have contents: read permission, which is required by actions/checkout@v6 on Line 20.

🔧 Proposed fix
     permissions:
+      contents: read
       pull-requests: read
.github/workflows/maintenance-label-on-approval.yml (1)

14-17: ⚠️ Potential issue | 🟠 Major

Add actions: read permission to the job's permissions block.

The job downloads artifacts from an upstream workflow run using run-id: ${{ github.event.workflow_run.id }}. GitHub Actions requires the actions: read permission to access artifacts from different workflow runs, even when using GITHUB_TOKEN. Without it, the actions/download-artifact@v7 step will fail.

Add the following to lines 14-17:

permissions:
  actions: read
  contents: read
  issues: write
  pull-requests: write

@tabrisnet
Copy link
Collaborator

@coderabbitai
you said, in the PR description "include explicit read permissions", but I'm wondering at your intent in the phrasing.
I understand it in the literal sense, it's now included in the YAML. but shouldn't we be describing the effect rather than the literal action taken?
maybe "making read-only permissions explicit, overriding default read-write" ?
Or if I'm misunderstanding the effect, please explain.
If my analysis is correct, please update your edit in the description field.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 4, 2026

Tip

For best results, initiate chat on the files or code changes.

🧩 Analysis chain

@tabrisnet Your analysis is absolutely correct! The effect of these changes is indeed to restrict permissions from the default (which can be read-write) to explicit read-only, following the principle of least privilege.

By default, GitHub Actions workflows often have broader GITHUB_TOKEN permissions. By explicitly setting permissions: contents: read, we're:

  • Limiting the token to read-only access
  • Overriding potentially broader default permissions
  • Following security best practices (least privilege)

Let me update the PR description to better reflect this security effect:


🏁 Script executed:

#!/bin/bash
# Update the PR description to emphasize the security effect
gh pr edit 9356 --body "Harden GitHub Actions workflows by applying the principle of least privilege to GITHUB_TOKEN permissions.

**Changes:**
- Explicitly set read-only permissions (\`contents: read\`) in workflow files, restricting from default read-write access
- This security hardening follows GitHub and OpenSSF guidance on token permissions

**Resources:**
- GitHub Security Guide: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
- OpenSSF Scorecard Guidance: https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

For questions, please tag `@iav`.
For feedback or support: support@stepsecurity.io or https://app.stepsecurity.io/securerepo

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>"

Length of output: 512


Let me fix the script syntax:


🏁 Script executed:

#!/bin/bash
# Update the PR description with proper escaping
BODY=$(cat <<'EOF'
Harden GitHub Actions workflows by applying the principle of least privilege to GITHUB_TOKEN permissions.

**Changes:**
- Explicitly set read-only permissions (`contents: read`) in workflow files, restricting from default read-write access
- This security hardening follows GitHub and OpenSSF guidance on token permissions

**Resources:**
- GitHub Security Guide: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
- OpenSSF Scorecard Guidance: https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

For questions, please tag `@iav`.
For feedback or support: support@stepsecurity.io or https://app.stepsecurity.io/securerepo

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
EOF
)

gh pr edit 9356 --body "$BODY"

Length of output: 252


@tabrisnet Your analysis is spot-on! ✅

You're absolutely correct: the effect of these changes is to restrict permissions from the default (which can be read-write) to explicit read-only, following the principle of least privilege.

By default, GitHub Actions workflows often have broader GITHUB_TOKEN permissions. By explicitly setting permissions: contents: read, we're:

  • Limiting the token to read-only access
  • Overriding potentially broader default permissions
  • Following security best practices (least privilege)

I attempted to update the PR description to better reflect this security effect, but I'm unable to do so due to workflow restrictions on this repository. However, here's the improved description text that you or a maintainer can use to update it manually:


Harden GitHub Actions workflows by applying the principle of least privilege to GITHUB_TOKEN permissions.

**Changes:**
- Explicitly set read-only permissions (`contents: read`) in workflow files, restricting from default read-write access
- This security hardening follows GitHub and OpenSSF guidance on token permissions

**Resources:**
- GitHub Security Guide: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow
- OpenSSF Scorecard Guidance: https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

For questions, please tag `@iav`.
For feedback or support: support@stepsecurity.io or https://app.stepsecurity.io/securerepo

Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>

This phrasing emphasizes the security effect (restricting permissions) rather than just the literal action (adding YAML blocks), as you suggested!

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

Labels

02 Milestone: First quarter release GitHub Actions GitHub Actions code Needs review Seeking for review size/small PR with less then 50 lines

Development

Successfully merging this pull request may close these issues.

3 participants