Repository navigation
Conversation
Bumps [docker/login-action](https://github.com/docker/login-action) from 1.10.0 to 2.1.0. - [Release notes](https://github.com/docker/login-action/releases) - [Commits](docker/login-action@v1.10.0...v2.1.0) --- updated-dependencies: - dependency-name: docker/login-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
|
I'm having deja vu and wonder if I typed this already on another repo. Reasoning which half of this commit solves the issue vs which half is heading to a more tightly constrained set of permissions as a future best practice is below: I don't believe we need to grant additional permissions to push when this is run on However this is probably not a bad thing to be explicit about; we should in general follow the principle of least privilege. There are multiple places these permissions can be defined which is confusing. I initially wondered if this started breaking because someone has clicked a clickops setting somewhere like: https://github.com/wbstack/widar/settings/actions or https://github.com/organizations/wbstack/settings/actions but this doesn't seem to be the case. Both are still set to be super permissive. I assume this is actually because dependabot PRs are run and have permissions as though they are created from a fork. This patch does change the status quo that now PRs written by human authors will also not be pushed (see for example the successful push here). I think this is acceptable but we need to adjust the description of this PR to make it clear |
There was a problem hiding this comment.
I'm having deja vu and wonder if I typed this already on another repo.
I'm having deja vu too! 😅 I think we might have discussed this verbally at some point (maybe at the end of a daily?).
I don't believe we need to grant additional permissions to push when this is run on
main.
Agreed 👍
However this is probably not a bad thing to be explicit about; we should in general follow the principle of least privilege.
Indeed, I was thinking about this yesterday evening.
- We should have a look at our GitHub Action settings in our repos; in particular the permissions we give workflows by default.
- You can specify
permission: {}to remove all permissions and then only set the permissions that are required: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#defining-access-for-the-github_token-scopes-1 (or we change the setting to only some read-only permissions by default and then we are required to add the permissions we need - see point above)
This patch does change the status quo that now PRs written by human authors will also not be pushed (see for example the successful push here). I think this is acceptable but we need to adjust the description of this PR to make it clear
I was saying just recently, I think to @dati18 about the queryservice-ui, that I wanted CI (particularly the docker build workflow) to run on every push1 as I think having dev images for code not yet merged into main in a container registry that we can more easily pull into our local minikube clusters is useful. We need to make sure we handle permissions sensibly (especially around things like forked repositories and dependabot), but I would prefer it if we kept building and pushing for PRs created by trusted repo members.
1: I don't think it always runs on every commit. If you push several commits at once I think the CI workflow(s) only run for the last pushed commit. That's not a problem, just explaining my word choice.
This change fixes[1] failures caused by GitHub Container Registry authorization during
pull_requestruns.PR workflows from dependabot completed the the GHCR login step but with read-only permission and then still attempted to push images with
buildx.The PR does two things:
mainin GHCR[1] https://github.com/wbstack/widar/actions/runs/36420982691/job/108923351027?pr=105
Bug: T438725