-
Notifications
You must be signed in to change notification settings - Fork 525
Limit workflow job permissions to bare minimum #3706
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
Conversation
This allows to narrow down workflow permissions in GitHub settings See https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs and https://docs.github.com/en/actions/security-guides/automatic-token-authentication\#permissions-for-the-github_token Signed-off-by: Marco Franssen <[email protected]>
69ae172
to
d4a2a98
Compare
|
||
env: | ||
NIGHTLY: true | ||
|
||
jobs: | ||
build-and-publish-images: | ||
runs-on: ubuntu-20.04 | ||
|
||
permissions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to job level, so we don't run the chance new job added in this workflow will also have write access by default.
Looks like flaky test. Can someone retrigger this test? |
@@ -1,12 +1,13 @@ | |||
name: 'Dependency Review' | |||
on: [pull_request] | |||
|
|||
permissions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we leave this action level permission here, does it apply to any jobs that omit the permissions configuration? If so, it seems safer to leave it in so that any future jobs that neglect to configure permissions will only get read (assuming the org level default is higher).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contents: read
is the default anyhow. You don't even have to define that.
I just like to define it explicitly so it is clear what permissions a job has.
See the link in the pr description.
This allows to narrow down workflow permissions in GitHub settings See https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs and https://docs.github.com/en/actions/security-guides/automatic-token-authentication\#permissions-for-the-github_token Signed-off-by: Marco Franssen <[email protected]> Signed-off-by: divaspathak <[email protected]>
This reverts commit 9d0b194.
This reverts commit 9d0b194. Signed-off-by: Ryan Turner <[email protected]>
This reverts commit 9d0b194. Signed-off-by: Ryan Turner <[email protected]>
- Fixes a recent regression in permissions on the publish-artifact job (introduced by spiffe#3706). - Makes image publishing rely on the same jobs as artifact publishing so that we don't publish images but fail to publish the release if there is a failure in the windows jobs. Signed-off-by: Andrew Harding <[email protected]>
- Fixes a recent regression in permissions on the publish-artifact job (introduced by #3706). - Makes image publishing rely on the same jobs as artifact publishing so that we don't publish images but fail to publish the release if there is a failure in the windows jobs. Signed-off-by: Andrew Harding <[email protected]>
This allows to narrow down workflow permissions in GitHub settings See https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs and https://docs.github.com/en/actions/security-guides/automatic-token-authentication\#permissions-for-the-github_token Signed-off-by: Marco Franssen <[email protected]>
- Fixes a recent regression in permissions on the publish-artifact job (introduced by spiffe#3706). - Makes image publishing rely on the same jobs as artifact publishing so that we don't publish images but fail to publish the release if there is a failure in the windows jobs. Signed-off-by: Andrew Harding <[email protected]>
This allows to narrow down workflow permissions in GitHub settings
See https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
and https://docs.github.com/en/actions/security-guides/automatic-token-authentication\#permissions-for-the-github_token
Pull Request check list
Affected functionality
Description of change
This allows to set workflows by default to readonly and only request the permissions as they are needed for a certain job, reducing potential attack surface.
A repo admin can change the following setting once this is merged.
https://github.com/spiffe/spire/settings/actions
Which issue this PR fixes