🌱 harden git workflows#2512
Open
PrashantR30 wants to merge 1 commit into
Open
Conversation
0936b38 to
c53cfa8
Compare
Contributor
|
Thanks @PrashantR30 for this change. Is there a specific reason why a subset of workflows were updated? For example, coverage.yaml, release-images-list.yaml, etc were not touched. |
rajatchopra
requested changes
Jun 10, 2026
| timeout-minutes: 15 | ||
| permissions: | ||
| contents: read | ||
| packages: write |
Contributor
There was a problem hiding this comment.
This seems like giving more than needed.
Author
There was a problem hiding this comment.
Actually with
permissions:
contents: read
packages: write
I wanted to guarantee:
- can read repository
- can push GHCR manifest
- cannot modify PRs
- cannot modify issues
- cannot create releases
- cannot push commits
So from a security-hardening perspective, I was thinking it is better than relying on the defaults permissions.
7fcac6c to
0ada2f6
Compare
Signed-off-by: PrashantR30 <pramhit@mirantis.com>
rahulait
reviewed
Jun 15, 2026
| - uses: actions/checkout@v6 | ||
| name: Check out code | ||
| with: | ||
| persist-credentials: false |
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.
Description
This PR hardens GitHub Actions workflows by disabling persisted Git credentials on checkout steps and explicitly scoping workflow permissions to the minimum required access.
The changes reduce the risk of unintended
GITHUB_TOKENexposure to later workflow steps while preserving existing CI behavior. Workflows that only read repository contents now use read-only permissions, while image publishing workflows keep the required package write permissions.Checklist
actions: writeas the workflow only usesactions/staleto label, comment on, and close issues and does not appear to require permissions to manage workflow runs or other GitHub Actions resources.make lint)make validate-generated-assets)make validate-modules)Testing
Validated the workflow YAML changes manually.
No application code was changed. This PR only updates GitHub Actions workflow configuration for credential and permission hardening, but still we let the test run to validate if the workflow operation works.