Commit 80306da
authored
Enhance security of GitHub workflows using least privilege principle (#69)
### Motivation:
GitHub Actions workflows by default may have broader permissions than
necessary, increasing the attack surface for supply chain attacks and
credential theft. Explicitly scoping permissions prevents potential
exploitation if workflows are compromised.
### Modifications:
Add explicit `permissions: contents: read` declaration to all workflow
files:
- .github/workflows/main.yml
- .github/workflows/pull_request.yml
- .github/workflows/pull_request_label.yml
- .github/workflows/unit_tests.yml
### Result:
Workflows are restricted to read-only repository access, preventing
malicious code execution from modifying repository contents, pushing
commits, or escalating privileges even if the workflow is compromised.1 parent 7b98490 commit 80306da
File tree
4 files changed
+12
-0
lines changed- .github/workflows
4 files changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
0 commit comments