Add minimum token permissions for all GitHub workflow files #17
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.
This PR adds minimum token permissions for all GitHub workflow files to improve security posture according to OpenSSF Scorecard recommendations.
Overview
The OpenSSF Scorecard Token-Permissions check requires that all GitHub workflow files have a root-level
permissions:
block to limit token access to the minimum required permissions. This PR addresses that requirement by addingpermissions: contents: read
to all workflow files that were missing this security configuration.Changes Made
Files Updated
All files now have a root-level permissions block with
contents: read
:.github/workflows/backport.yml
.github/workflows/changelog.yml
.github/workflows/codeql-analysis.yml
.github/workflows/component-owners.yml
.github/workflows/core_contrib_test_0.yml
.github/workflows/lint_0.yml
.github/workflows/misc_0.yml
.github/workflows/package-prepare-patch-release.yml
.github/workflows/package-prepare-release.yml
.github/workflows/package-release.yml
.github/workflows/prepare-patch-release.yml
.github/workflows/prepare-release-branch.yml
.github/workflows/release.yml
.github/workflows/test_0.yml
.github/workflows/test_1.yml
.github/workflows/test_2.yml
Security Benefits
Job-Level Permissions Preserved
Existing job-level permissions for specialized functionality remain intact:
component-owners.yml
: Job retainsissues: write
andpull-requests: write
for PR/issue managementossf-scorecard.yml
: Job retainssecurity-events: write
andid-token: write
for code scanningVerification
All 18 workflow files have been verified to:
Fixes #16.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.