Skip to content

Commit 06164ed

Browse files
authored
Switch to OIDC Federation Service instead of GitHub App (#1708)
Currently, the [Gardener GitHub-Actions App](https://github.com/apps/gardener-github-actions) is used to provide more privileged access than available via the default `GITHUB_TOKEN`, for example to circumvent branch protection rules (GitHub Apps can be configured as bypassers) or cross repository privileges. To prevent sharing the GitHub App secret with each and every repository/workflow which requires usage of it, the [GitHub OIDC Federation Service](https://github.com/gardener/github-oidc-federation) has been developed. In essence, it holds the credentials for a central GitHub App and creates short-lived access tokens with a configured scope based on a centrally configured OIDC configuration. See related changes which have been necessary for this repository: - gardener/.github-oidc@479f31e Signed-off-by: Jonas Brand (i538859) <j.brand@sap.com>
1 parent 7bda505 commit 06164ed

5 files changed

Lines changed: 5 additions & 13 deletions

File tree

.github/workflows/build.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ on:
1717
jobs:
1818
prepare:
1919
uses: gardener/cc-utils/.github/workflows/prepare.yaml@master
20+
permissions:
21+
id-token: write
2022
with:
2123
mode: ${{ inputs.mode }}
2224
version-operation: ${{ inputs.release-version }}
@@ -67,7 +69,6 @@ jobs:
6769
contents: read
6870
packages: write
6971
id-token: write
70-
pull-requests: write
7172
uses: gardener/cc-utils/.github/workflows/oci-ocm.yaml@master
7273
strategy:
7374
matrix:
@@ -115,7 +116,6 @@ jobs:
115116
contents: read
116117
packages: write
117118
id-token: write
118-
pull-requests: write
119119
uses: gardener/cc-utils/.github/workflows/helmchart-ocm.yaml@master
120120
strategy:
121121
matrix:

.github/workflows/non-release.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,16 @@ jobs:
2222
uses: ./.github/workflows/build.yaml
2323
with:
2424
mode: snapshot
25-
secrets: inherit
2625
permissions:
27-
contents: write
26+
contents: read
2827
packages: write
2928
id-token: write
30-
pull-requests: write
3129

3230
component-descriptor:
3331
if: ${{ github.event_name != 'pull_request_target' || (github.event_name == 'pull_request_target' && github.event.label.name == vars.DEFAULT_LABEL_OK_TO_TEST && vars.DEFAULT_LABEL_OK_TO_TEST != '') }}
3432
uses: gardener/cc-utils/.github/workflows/post-build.yaml@master
3533
needs:
3634
- build
37-
secrets: inherit
3835
permissions:
3936
id-token: write
4037
contents: write

.github/workflows/pullrequest-trust-helper.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ on:
99
jobs:
1010
pullrequest-trusted-helper:
1111
permissions:
12-
pull-requests: write
13-
secrets: inherit # access to `GitHub-Actions`-App is needed to read teams
12+
id-token: write
1413
uses: gardener/cc-utils/.github/workflows/pullrequest-trust-helper.yaml@master
1514
with:
1615
trusted-teams: 'core,gardener-extension-provider-aws-maintainers'

.github/workflows/release.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,9 @@ jobs:
2222
build:
2323
uses: ./.github/workflows/build.yaml
2424
permissions:
25-
contents: write
25+
contents: read
2626
packages: write
2727
id-token: write
28-
pull-requests: write
2928
with:
3029
mode: release
3130
release-version: ${{ inputs.release-version }}
@@ -55,7 +54,6 @@ jobs:
5554
contents: write
5655
packages: write
5756
id-token: write
58-
pull-requests: write
5957

6058
close-release-milestone:
6159
if: ${{ inputs.next-version == 'bump-minor' && inputs.release-version == 'set-prerelease' }}

.github/workflows/update-images.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ on:
1313
jobs:
1414
update-images:
1515
uses: gardener/cc-utils/.github/workflows/update-extension-provider-images.yaml@master
16-
# Pass all available secrets (like the private key)
17-
secrets: inherit
1816
permissions:
1917
contents: write
2018
id-token: write

0 commit comments

Comments
 (0)