fix: add explicit permissions to GitHub Actions workflows - #2318
Open
redhat-chai-bot wants to merge 1 commit into
Open
fix: add explicit permissions to GitHub Actions workflows#2318redhat-chai-bot wants to merge 1 commit into
redhat-chai-bot wants to merge 1 commit into
Conversation
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>
|
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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
permissions: {}at the top level (deny all by default)permissions: { contents: read }at the job level (minimum required)This follows the same pattern already established in
brokenlinks.ymlandvalidate_ztunnel_values.yaml.Affected files
changelog-check.yamlclean-nightly-images.yamlcommit-validation.yamlhelm.yamlintegration-tests.yamlnightly-images.yamlrelease.yamlsync-changelog.yamlunit-tests.yamlupdate-deps.yamlupdate-eol-versions.yamlversions-triggered-build.yamlNot modified (already have correct permissions)
brokenlinks.ymlvalidate_ztunnel_values.yamlcrc-e2e-sail.yamlWhy
contents: readis sufficientEvery 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 defaultGITHUB_TOKEN. The default token is only used implicitly byactions/checkoutfor cloning, which only requirescontents: read.Risk assessment
Low risk. The
permissions:block only constrains the defaultGITHUB_TOKEN. Since all write operations already use custom secrets, restricting the default token tocontents: readwill not break any functionality.AI-generated. Review for accuracy.
@dgn requested in Slack thread