Skip to content

Commit 0f4ff80

Browse files
authored
Switch to OIDC Federation Service instead of GitHub App (#707)
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@24948bd Signed-off-by: Jonas Brand (i538859) <j.brand@sap.com>
1 parent bae50f5 commit 0f4ff80

File tree

5 files changed

+5
-13
lines changed

5 files changed

+5
-13
lines changed

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
mode: ${{ inputs.mode }}
1919
version-commit-callback-action-path: ./.github/actions/prepare-release
2020
permissions:
21-
contents: read
21+
id-token: write
2222

2323
build-gardenctl:
2424
permissions:

.github/workflows/cherry-pick.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [created]
66

77
permissions:
8-
contents: none # we rely on the GitHub App token instead
8+
id-token: write # required for GitHub OIDC Federation Service token
99

1010
jobs:
1111
cherry-pick:
@@ -18,5 +18,3 @@ jobs:
1818
with:
1919
pr-number: ${{ github.event.issue.number }}
2020
comment-body: ${{ github.event.comment.body }}
21-
secrets:
22-
GARDENER_GITHUB_ACTIONS_PRIVATE_KEY: ${{ secrets.GARDENER_GITHUB_ACTIONS_PRIVATE_KEY }}

.github/workflows/non-release.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@ jobs:
88
uses: ./.github/workflows/build.yaml
99
with:
1010
mode: snapshot
11-
secrets: inherit
1211
permissions:
13-
contents: write
14-
packages: write
12+
contents: read
1513
id-token: write
1614

1715
component-descriptor:
1816
uses: gardener/cc-utils/.github/workflows/post-build.yaml@master
1917
needs:
2018
- build
21-
secrets: inherit
2219
permissions:
2320
id-token: write
2421
contents: write

.github/workflows/prepare-hotfix-branch.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ on:
99
type: string
1010

1111
permissions:
12-
contents: none # we rely on the GitHub App token instead
12+
id-token: write # required for GitHub OIDC Federation Service token
1313

1414
jobs:
1515
call-dashboard-workflow:
1616
uses: gardener/dashboard/.github/workflows/prepare-hotfix-branch.yaml@master
1717
with:
1818
tag: ${{ inputs.tag }}
19-
secrets:
20-
GARDENER_GITHUB_ACTIONS_PRIVATE_KEY: ${{ secrets.GARDENER_GITHUB_ACTIONS_PRIVATE_KEY }}

.github/workflows/release.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ jobs:
1212
build:
1313
uses: ./.github/workflows/build.yaml
1414
permissions:
15-
contents: write
15+
contents: read
1616
id-token: write
17-
packages: write
1817
with:
1918
mode: release
2019

0 commit comments

Comments
 (0)