Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Github OIDC authentication to Github actions #53

Closed
zetaab opened this issue Aug 15, 2023 · 1 comment
Closed

Implement Github OIDC authentication to Github actions #53

zetaab opened this issue Aug 15, 2023 · 1 comment

Comments

@zetaab
Copy link

zetaab commented Aug 15, 2023

What product do you want to improve?
uploader and codecov-api

Is your feature request related to a problem? Please describe.
no

Describe the solution you'd like
Currently minimal github action pipeline is following:

- uses: codecov/codecov-action@v3
  with:
    token: ${{ secrets.CODECOV_TOKEN }}

However, the I would like to propose removal of tokens in GHA pipelines. That can be achieved by using Github (or github enterprise) OIDC authentications (https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect).

After uploader and codecov-api supports Github oidc the new way of doing should be:

  1. github oidc enabled to repository (is this needed or enabled by default?).
  2. new gha pipeline:
jobs:
  build:
    permissions: # these are needed after oidc change
      id-token: write
      contents: read
    steps:
    ...
    - uses: codecov/codecov-action@v3

No more hassle with the hardcoded tokens and copy pasting them!

Basically, you can get the id token in github actions https://github.com/elisa-actions/healthcheck-event/blob/main/src/main.ts#L57 and that can be used for authenticating. Of course then codecov-api needs logic to verify the github id token correctly.

@zetaab zetaab changed the title Implement Github OIDC authentication Implement Github OIDC authentication to Github actions Aug 15, 2023
@rohan-at-sentry
Copy link

@zetaab I'm a PM at Codecov 👋

Thanks for raising this and opening up PRs for the the codecov action and codecov api as well. As @thomasrockhu-codecov noted in your PR, a vast majority of our customers aren't using the OIDC.

Having said that, I'd like to use discussion as way to gather more feedback on this, so I'm converting this into a discussion. I'll keep an eye on this here on out, and if we decide to move forward, I'll respond back here.

@rohan-at-sentry rohan-at-sentry converted this issue into discussion #70 Sep 6, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
Status: Waiting for: Product Owner
Development

No branches or pull requests

2 participants