chore: add top-level permissions: {} to all workflow files#521
Open
Onyx2406 wants to merge 1 commit intoaquasecurity:masterfrom
Open
chore: add top-level permissions: {} to all workflow files#521Onyx2406 wants to merge 1 commit intoaquasecurity:masterfrom
Onyx2406 wants to merge 1 commit intoaquasecurity:masterfrom
Conversation
Add explicit top-level `permissions: {}` to all GitHub Actions workflow
files to restrict the default GITHUB_TOKEN permissions. Each job already
defines its own minimum required permissions, but without a top-level
restriction, any newly added job would inherit GitHub's default
(read-write) token permissions.
This follows the principle of least privilege as recommended by GitHub
and OpenSSF Scorecard.
Closes aquasecurity#499
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
permissions: {}to all 5 GitHub Actions workflow filesGITHUB_TOKENpermissions to none, enforcing least-privilegeMotivation
Closes #499 — While each job already defines minimum required permissions (e.g.
contents: read,packages: write), there is no top-level restriction. Withoutpermissions: {}at the workflow level, any newly added job that omits apermissionsblock would inherit GitHub's default (read-write) token permissions, increasing the blast radius if a workflow is compromised.Changes
test.yamlpermissions: {}bump-trivy.yamlpermissions: {}sync-trivy-checks.yamlpermissions: {}sync-trivy-db.yamlpermissions: {}sync-trivy-java-db.yamlpermissions: {}References