-
Notifications
You must be signed in to change notification settings - Fork 138
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
[bug] Don't use package: write
permissions for container workflow
#1257
Comments
If the GitHub token does not have This may be an issue with cosign or the workflow's usage of it. Maybe it's trying to use the job's GHA token rather than using Docker's login credentials?
|
The workflow uses |
#1283 will reopen this. It seems there is an issue with I created sigstore/cosign#2489 to track. |
This appears to be also failing against Artifact Registry (full trace for the above error here) main.go:62: error during command execution: signing us-west1-docker.pkg.dev/cloudy-s3c/s3cme/s3cme@sha256:f17fc9c49e3e1cef22022332c0f55a51d60b12d7403990a6aac6564f4bbd4910: GET https://us-west1-docker.pkg.dev/v2/token?scope=repository%3Acloudy-s3c%2Fs3cme%2Fs3cme%3Apull&service=: DENIED: Permission "artifactregistry.repositories.downloadArtifacts" denied on resource "projects/cloudy-s3c/locations/us-west1/repositories/s3cme" (or it may not exist) This is despite of the login to us-west1-docker.pkg.dev
auth.go:191: logged in via /home/runner/.docker/config.json Also, COSIGN_EXPERIMENTAL=1 cosign attest --force --predicate predicate.json --type slsaprovenance $IMG_DIGEST I ended up abandoning this reusable workflow and just used the released FWIW, a Go app repo template with image build/publish pipelines, SBOM, and SLSA provenance (using your |
Using
package: write
on the workflow is convenient but is not setting least privilege in the case where users are not using ghcr.io. We should force users to set the username and password and log into ghcr.io manually.Related to #547
The text was updated successfully, but these errors were encountered: