Skip to content

Commit b637d6e

Browse files
szachovyCopilot
andcommitted
Add explicit permissions to GitHub Actions workflows
Following security best practices (supply chain hardening), add explicit top-level permissions to all GitHub Actions workflows to enforce the principle of least privilege. Moved job-level permissions to top-level where applicable. This addresses the GitHub Actions permissions requirements from the Rancher Security Team supply chain risk scan. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8b6ac3a commit b637d6e

7 files changed

Lines changed: 24 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
name: Build
66

7+
permissions:
8+
contents: read
9+
710
on:
811
pull_request:
912
types:

.github/workflows/changelogs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
# SPDX-License-Identifier: Apache-2.0
44
name: Changelogs
55

6+
permissions:
7+
contents: read
8+
pull-requests: write
69

710
on:
811
push:

.github/workflows/git-checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
name: Git Checks
77

8+
permissions:
9+
contents: read
10+
811
on: [pull_request]
912

1013
jobs:

.github/workflows/mingo_build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
name: Build with oldest go
66

7+
permissions:
8+
contents: read
9+
710
on:
811
pull_request:
912
types:

.github/workflows/prebuilt_devcontainer.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
name: 'pre-built devcontainer'
6+
7+
permissions:
8+
contents: read
9+
id-token: write
10+
packages: write
11+
612
on:
713
push:
814
branches:
@@ -11,10 +17,6 @@ on:
1117
jobs:
1218
devcontainer-build-and-push:
1319
runs-on: ubuntu-latest
14-
permissions:
15-
contents: read
16-
id-token: write
17-
packages: write
1820
steps:
1921
- name: Checkout
2022
id: checkout

.github/workflows/reuse.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
name: REUSE Compliance Check
66

7+
permissions:
8+
contents: read
9+
710
on:
811
push:
912
branches:

.github/workflows/vulncheck.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
name: Vulnerability check
66

7+
permissions:
8+
contents: read
9+
710
on:
811
pull_request:
912
types:

0 commit comments

Comments
 (0)