Switch to OIDC Federation Service instead of GitHub App#2794
Switch to OIDC Federation Service instead of GitHub App#2794
Conversation
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@1cc1fe4 Signed-off-by: Jonas Brand (i538859) <j.brand@sap.com>
📝 WalkthroughWalkthroughMultiple GitHub workflow files are updated to migrate from GitHub App token-based authentication using private keys to OIDC federated token-based authentication. Permission configurations are adjusted across workflows to enable id-token: write for OIDC token generation, and fine-grained permission scopes are refined. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/cherry-pick.yaml (1)
12-13: Workflow is disabled byfalse &&condition.The cherry-pick workflow is effectively disabled with
false &&at the start of the condition. Is this intentional for the migration period, or should this be addressed in a follow-up?🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/cherry-pick.yaml around lines 12 - 13, The workflow condition starts with the literal `false &&`, which disables the entire cherry-pick workflow; remove the `false &&` prefix from the `if:` expression (or replace it with the intended boolean or environment/secret check) so the workflow can run, or if this is intentionally temporary add an explicit comment and a TODO and ensure the real condition (e.g., `github.event_name == 'push'` or the intended env var check) replaces `false &&` before merging; change the `if:` expression where `false &&` appears to implement the desired behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/cherry-pick.yaml:
- Around line 12-13: The workflow condition starts with the literal `false &&`,
which disables the entire cherry-pick workflow; remove the `false &&` prefix
from the `if:` expression (or replace it with the intended boolean or
environment/secret check) so the workflow can run, or if this is intentionally
temporary add an explicit comment and a TODO and ensure the real condition
(e.g., `github.event_name == 'push'` or the intended env var check) replaces
`false &&` before merging; change the `if:` expression where `false &&` appears
to implement the desired behavior.
|
@holgerkoser, @grolu, @klocke-io You have pull request review open invite, please check |
What this PR does / why we need it:
Currently, the Gardener GitHub-Actions App 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 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:Special notes for your reviewer:
This change requires the organisation variable
FEDERATED_GITHUB_ACCESS_TOKEN_SERVERto be made accessible to this repository first.Release note:
Summary by CodeRabbit