Skip to content

fix: add explicit permissions to GitHub Actions workflows - #2318

Open
redhat-chai-bot wants to merge 1 commit into
istio-ecosystem:mainfrom
redhat-chai-bot:fix/workflow-permissions
Open

fix: add explicit permissions to GitHub Actions workflows#2318
redhat-chai-bot wants to merge 1 commit into
istio-ecosystem:mainfrom
redhat-chai-bot:fix/workflow-permissions

Conversation

@redhat-chai-bot

Copy link
Copy Markdown

Summary

Adds explicit permissions: blocks to all 12 GitHub Actions workflows that were missing them, following the principle of least privilege.

Fixes #2118

Changes

For each of the 12 affected workflow files:

  1. Added permissions: {} at the top level (deny all by default)
  2. Added permissions: { contents: read } at the job level (minimum required)

This follows the same pattern already established in brokenlinks.yml and validate_ztunnel_values.yaml.

Affected files

  • changelog-check.yaml
  • clean-nightly-images.yaml
  • commit-validation.yaml
  • helm.yaml
  • integration-tests.yaml
  • nightly-images.yaml
  • release.yaml
  • sync-changelog.yaml
  • unit-tests.yaml
  • update-deps.yaml
  • update-eol-versions.yaml
  • versions-triggered-build.yaml

Not modified (already have correct permissions)

  • brokenlinks.yml
  • validate_ztunnel_values.yaml
  • crc-e2e-sail.yaml

Why contents: read is sufficient

Every write operation in these workflows (pushing to external repos, pushing images to quay.io, creating GitHub releases) uses custom secrets (GIT_TOKEN, QUAY_USER, QUAY_PWD) — not the default GITHUB_TOKEN. The default token is only used implicitly by actions/checkout for cloning, which only requires contents: read.

Risk assessment

Low risk. The permissions: block only constrains the default GITHUB_TOKEN. Since all write operations already use custom secrets, restricting the default token to contents: read will not break any functionality.


AI-generated. Review for accuracy.

@dgn requested in Slack thread

Adds `permissions: {}` at the top level and `contents: read` at the
job level for all workflows that were missing explicit permission
scoping. This follows the principle of least privilege and reduces
the blast radius if a third-party action is compromised.

Fixes istio-ecosystem#2118

Signed-off-by: Red Hat Chai Bot <chai-bot@redhat.com>
Signed-off-by: Chai Bot <chai-bot@redhat.com>
@redhat-chai-bot
redhat-chai-bot requested a review from a team as a code owner September 4, 2026 15:11
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@istio-testing

Copy link
Copy Markdown
Collaborator

Hi @redhat-chai-bot. Thanks for your PR.

I'm waiting for a istio-ecosystem or istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SECURITY] 10 of 12 GitHub Actions workflows lack explicit permissions:

2 participants