Skip to content
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

Disable credential persisting for actions/checkout #1859

Closed
nedsalk opened this issue Mar 12, 2024 · 4 comments
Closed

Disable credential persisting for actions/checkout #1859

nedsalk opened this issue Mar 12, 2024 · 4 comments
Labels
chore Issue is a chore

Comments

@nedsalk
Copy link
Contributor

nedsalk commented Mar 12, 2024

It seems that the default behavior of persist-credentials:true is generally a security issue (actions/checkout#485). We should be disabling it in all of our workflows. Some jobs might fail if they were depending on this persisted value. The solution would be to define it in the job's environment, e.g.:

- name: Do something
  run: echo something
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 

For more info, take a look at #1848 where this problem was found.

@nedsalk nedsalk added the chore Issue is a chore label Mar 12, 2024
@maschad
Copy link
Member

maschad commented Apr 11, 2024

@nedsalk Is this issue still relevant? It seems that the only place persist-credentials is used is here and it's set to false

@nedsalk
Copy link
Contributor Author

nedsalk commented Apr 12, 2024

@maschad Yes, it's still relevant. I disabled persist-credentials only in that place to fix the issue in #1848, but from what was said in actions/checkout#485, we might want to set it to false everywhere. The work to set it to false everywhere was out of the scope of #1848 so I created this issue. Also note that I created it mainly based on actions/checkout#485 and didn't delve much deeper into investigating it. It made sense when I read it at that time.

@maschad
Copy link
Member

maschad commented Apr 12, 2024

Thanks for clarifying @nedsalk , there seems to be discrepancy though between the documented default and the code though, so it may actually be a documentation issue in actions/checkout#485 and the default of persist-credentials is actually false

Reference: actions/checkout#485 (comment)

@maschad
Copy link
Member

maschad commented Apr 21, 2024

I'm closing this based on my previous comment, feel free to re-open otherwise.

@maschad maschad closed this as completed Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Issue is a chore
Projects
None yet
Development

No branches or pull requests

3 participants