Skip to content

Commit 5f3a505

Browse files
committed
Set permissions for GitHub token in workflows
1 parent 2a4384d commit 5f3a505

File tree

9 files changed

+27
-1
lines changed

9 files changed

+27
-1
lines changed

.github/workflows/checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Checks
22

33
on:
44
workflow_call:
5+
permissions:
6+
content: read
57

68
jobs:
79

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
CI:
1717
uses: ./.github/workflows/merge-gate.yml
1818
secrets: inherit
19+
permissions:
20+
contents: read
1921

2022
Metrics:
2123
needs: [ CI ]
2224
uses: ./.github/workflows/report.yml
25+
permissions:
26+
contents: read

.github/workflows/matrix-all.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Build Matrix (All Versions)
22

33
on:
44
workflow_call:
5+
permissions:
6+
content: read
57
outputs:
68
matrix:
79
description: "Generates the all versions build matrix"

.github/workflows/matrix-exasol.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Build Matrix (Exasol)
22

33
on:
44
workflow_call:
5+
permissions:
6+
content: read
57
outputs:
68
matrix:
79
description: "Generates the exasol version build matrix"

.github/workflows/matrix-python.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Build Matrix (Python)
22

33
on:
44
workflow_call:
5+
permissions:
6+
content: read
57
outputs:
68
matrix:
79
description: "Generates the python version build matrix"

.github/workflows/report.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Status Report
22

33
on:
44
workflow_call:
5+
permissions:
6+
content: read
57

68
jobs:
79

.github/workflows/slow-checks.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Slow-Checks
22

33
on:
44
workflow_call:
5+
permissions:
6+
content: read
57

68
jobs:
79

doc/changes/unreleased.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,16 @@ This should also create a 'github-pages' environment, if it does not yet exist.
1313
For most repos using the PTB, the updating of the github pages only happens when a
1414
PR is merged to main, so please check post-merge that it worked as expected.
1515

16+
With #422, we have hardened the security in our GitHub workflows by explicitly
17+
setting permissions to the default GitHub token. In a few repos who greatly differ
18+
from the default PTB setup, this might lead to small issues which require the allowed
19+
permissions to be increased for specific jobs.
20+
1621
## ⚒️ Refactorings
1722

1823
* [#412](https://github.com/exasol/python-toolbox/issues/392): Refactored pre commit hook package version.py into nox task
1924

2025
## Security
2126

22-
* [#420](https://github.com/exasol/python-toolbox/issues/420): Replaced 3rd party action with GitHub actions for gh-pages
27+
* [#420](https://github.com/exasol/python-toolbox/issues/420): Replaced 3rd party action with GitHub actions for gh-pages
28+
* [#422](https://github.com/exasol/python-toolbox/issues/422): Set permissions within the GitHub workflows to restrict usage of the default GitHub token

exasol/toolbox/templates/github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ jobs:
1616
CI:
1717
uses: ./.github/workflows/merge-gate.yml
1818
secrets: inherit
19+
permissions:
20+
contents: read
1921

2022
Metrics:
2123
needs: [ CI ]
2224
uses: ./.github/workflows/report.yml
25+
permissions:
26+
contents: read

0 commit comments

Comments
 (0)