Skip to content

Gitea as an OIDC IdP for Actions #26383

Open
@jtackaberry

Description

@jtackaberry

Feature Description

Gitea should issue OIDC ID tokens for Actions jobs. By adding one's Gitea instance as an IdP in, for example, AWS IAM, it would allow jobs to assume IAM roles without the need to store AWS credentials as secrets (and the associated burden of regular rotations).

GitHub can do this: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/configuring-openid-connect-in-cloud-providers
GitLab too: https://docs.gitlab.com/ee/ci/cloud_services/

GitHub requires jobs to hit an endpoint defined in $ACTIONS_ID_TOKEN_REQUEST_URL to retrieve a token (typically via an action -- for example -- though it can be done with curl as shown in the above URL), while GitLab automatically generates one and injects it into the job's environment. I find GitLab's approach much more convenient, but I suppose Gitea would follow GitHub's approach given it's copying Actions.

The basic plumbing seems to be in place already (notably OIDC Discovery), Gitea would just need to issue ID tokens with the appropriate aud and sub claims.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/gitea-actionsrelated to the actions of Giteatype/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions