-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(gha): reduce permissions in workflows based on scorecard alerts (#…
…12477) This change reduces GitHub Actions workflow permissions to follow the principle of least privilege, addressing security alerts from Scorecard and improving overall workflow security. - `_build_publish.yaml`: - Moved `id-token: write` to `build-images` job - Removed global `id-token: write` permission - `_provenance.yaml`: - Added `permissions: {}` globally - Set specific permissions (`contents`, `actions`, `id-token`, `packages`) per job - `build-test-distribute.yaml`: - Removed global permissions - Added job-specific permissions for `checks`, `contents`, `id-token`, and `packages` - `ci-stability.yaml`: - Added explicit `permissions: {}` globally > Changelog: skip <!-- Uncomment the above section to explicitly set a [`> Changelog:` entry here](https://github.com/kumahq/kuma/blob/master/CONTRIBUTING.md#submitting-a-patch)? --> --------- Signed-off-by: Bart Smykla <[email protected]>
- Loading branch information
1 parent
be742fd
commit 64bc662
Showing
4 changed files
with
16 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,13 +22,13 @@ on: | |
required: true | ||
type: string | ||
description: notary repository | ||
permissions: | ||
contents: write | ||
id-token: write # needed for signing the images | ||
actions: read # For getting workflow run info to build provenance | ||
packages: write # Required for publishing provenance. Issue: https://github.com/slsa-framework/slsa-github-generator/tree/main/internal/builders/container#known-issues | ||
permissions: {} | ||
jobs: | ||
artifact-provenance: | ||
permissions: | ||
contents: write # To add assets to a release | ||
actions: read # For getting workflow run info to build provenance | ||
id-token: write # needed for signing the images | ||
# need to use non hash version because of: https://github.com/slsa-framework/slsa-github-generator/issues/3498 | ||
uses: slsa-framework/slsa-github-generator/.github/workflows/[email protected] | ||
with: | ||
|
@@ -47,6 +47,11 @@ jobs: | |
# TODO: | ||
# Split provenance jobs for internal / official releases when repositories are split | ||
images-provenance: | ||
permissions: | ||
contents: read | ||
actions: read # For getting workflow run info to build provenance | ||
id-token: write # needed for signing the images | ||
packages: write # Required for publishing provenance. Issue: https://github.com/slsa-framework/slsa-github-generator/tree/main/internal/builders/container#known-issues | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
|
This file contains 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
This file contains 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