-
Notifications
You must be signed in to change notification settings - Fork 496
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
Feature - Scorecard should sign releases with cosign #1201
Comments
This can be achieved by using goreleaser build hooks
|
Here is the output of The subject is [
{
"critical": {
"identity": {
"docker-reference": "gcr.io/distroless/base"
},
"image": {
"docker-manifest-digest": "sha256:46d4514c17aca7a68559ee03975983339fc548e6d1014e2d7633f9123f2d3c59"
},
"type": "cosign container image signature"
},
"optional": {
"Bundle": {
"SignedEntryTimestamp": "MEQCIF3do8LYSm6VPqefOx5LCFLYd+b2688gRILpXCgv7yeAAiA4/zg5U8s2y3NbdE5VwUa5zNdnlM/ZYugxH2nFxwj7EQ==",
"Payload": {
"body": "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiIwYjkxM2QzNzI0N2RlYjU2YmYyNTM2MjQ2MDEyMGI3YzdhYWFlMWUzODIzODlhOTkxNmI3MzY4NzAxYjYzYzkxIn19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FVUNJQTd4QXU3enJMOW1GaCtMZy9McnFqcTNpR0M2OFhrQ05MeDBteXlVcFBFUEFpRUF5aG1uU2JiK0prd05wODRHZGtRYW9wSVM5dHhrSkc3LzRlUDVRVXJmQmI0PSIsImZvcm1hdCI6Ing1MDkiLCJwdWJsaWNLZXkiOnsiY29udGVudCI6IkxTMHRMUzFDUlVkSlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENrMUpTVU4xYWtORFFXdERaMEYzU1VKQlowbFZRVTlIUjFkWmJ6Sk9kRE5UY2xCNFkyb3lMelp2Vmxoc1pGSkZkME5uV1VsTGIxcEplbW93UlVGM1RYY0tTMnBGVmsxQ1RVZE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UlZGRlFpOTNVWFZOUTNsQ1MyMTBiR1ZYZUd4ak0wNUJXa2RzZW1SSVNuWmlSMVo2WTNrMWNGbFhNSFZhTTA1c1kyNWFjQXBaTWxab1dUSk9kbVJYTlRCTWJVNTJZbFJCY0VKbmIzSkNaMFZGUVZsUEwwMUJSVUpDUW5SdlpFaFNkMk42YjNaTU1rWnFXVEk1TVdKdVVucE1iV1IyQ21JeVpITmFVelZxWWpJd2QwTm5XVWxMYjFwSmVtb3dSVUYzVFVSaFFVRjNXbEZKZUVGTVVqWkdaSGcwZVUxNFdEY3JlbGRJU2pSSlRrbHFTMHhxY2xJS2VucFZLekZtZERObU5VSlJWazF5UjAxV1RXRkJhR3RNVGpkdFNsZG5SakZSVm5JeGMwRkpkME5QUlcxdWMzTllURVZ0VERKamNGSm1abWxqVjFjeFRncE9iazFCUldGdFdqbEJVR2syWjJKWU5HOU9RaTlqYldsR09HWTFOMWxvWTFadVkwOHJNV0kwQ2kwdExTMHRSVTVFSUVORlVsUkpSa2xEUVZSRkxTMHRMUzBLIn19fX0=",
"integratedTime": 1635353701,
"logIndex": 801413,
"logID": "c0d23d6ad406973f9559f3ba2d1ca01f84147d8ffc5b8445c224f98b9591801d"
}
},
"Subject": "keyless@distroless.iam.gserviceaccount.com"
}
},
{
"critical": {
"identity": {
"docker-reference": "gcr.io/distroless/base"
},
"image": {
"docker-manifest-digest": "sha256:46d4514c17aca7a68559ee03975983339fc548e6d1014e2d7633f9123f2d3c59"
},
"type": "cosign container image signature"
},
"optional": {
"Bundle": {
"SignedEntryTimestamp": "MEQCIBRd84Tr6hRYfzrDNwoIbObgz5fnQiJ/v6GdNrbu03rsAiA6vWYUBXPHqajcXIqLIddC53L72P4hmnkHrAf23SeiuQ==",
"Payload": {
"body": "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiI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": 1635354731,
"logIndex": 801774,
"logID": "c0d23d6ad406973f9559f3ba2d1ca01f84147d8ffc5b8445c224f98b9591801d"
}
},
"Subject": "keyless@distroless.iam.gserviceaccount.com"
}
}
] And here is the output of the container that was pushed by GH Action The subject is [
{
"critical": {
"identity": {
"docker-reference": "ghcr.io/naveensrinivasan/stunning-tribble"
},
"image": {
"docker-manifest-digest": "sha256:141e2110aeb16aa9d53de57d37a1664a408e366992ee017abc6ed049d1ec91f9"
},
"type": "cosign container image signature"
},
"optional": {
"Bundle": {
"SignedEntryTimestamp": "MEUCIDqOR4QP/xXYPgFmKM+b0Ry32LFqmU6Q6t4wr5cAsQlJAiEAxayIJF9JOUZbRHhIzVyHZDBLIr8WtcK1yCLt1t5CVsA=",
"Payload": {
"body": "eyJhcGlWZXJzaW9uIjoiMC4wLjEiLCJraW5kIjoicmVrb3JkIiwic3BlYyI6eyJkYXRhIjp7Imhhc2giOnsiYWxnb3JpdGhtIjoic2hhMjU2IiwidmFsdWUiOiJkMTAwMmFlYWQwZmMyMjU0Yjc2NTFjZTJlZGI4OTBhYTAzOWY4M2Q2NmMyNjljODRkMzdlOTc4ZjMzMWM4MzZmIn19LCJzaWduYXR1cmUiOnsiY29udGVudCI6Ik1FWUNJUURUeWIzV0UwNTViQytBRWRKbzNhaHRoOVhsM1RVTmNnVkZaMzEwbFZNa0VRSWhBSXdMQ29wZlNOMjVqRC9PTWRWcDI5ZnRoRGVlR2h5dFpNdFF2ZWpDVjFiaSIsImZvcm1hdCI6Ing1MDkiLCJwdWJsaWNLZXkiOnsiY29udGVudCI6IkxTMHRMUzFDUlVkSlRpQkRSVkpVU1VaSlEwRlVSUzB0TFMwdENrMUpTVVJHZWtORFFYQXlaMEYzU1VKQlowbFZRVTgzUW1OUk1raDNOVVpQYms1dFlreFFhbWN3VTNoQlZFNDRkME5uV1VsTGIxcEplbW93UlVGM1RYY0tTMnBGVmsxQ1RVZEJNVlZGUTJoTlRXTXliRzVqTTFKMlkyMVZkVnBIV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JUREprY0dSSGFERlphVFZxWWpJd2RtSnRSakphVjFaMVl6TktjQXBpYld3eVdWaE9hR0pwT1hwa1NGWjFZbTFzZFZwNU1UQmpiV3hwV1cxNGJFeDVOVzVoV0ZKdlpGZEpkbVF5T1hsaE1scHpZak5rZWt3eVVuWlpNblJzQ21OcE1YcGhWMlIxVEc1c2RHSkZRbmxhVjFwNlRESm9iRmxYVW5wTU1scHNXVmhSZG1FeVZqVmlSMVo2WTNreGVtRlhaSFZoVnpWdVRVUnJSME5wYzBjS1FWRlJRbWMzT0hkQlVVVkZTekpvTUdSSVFucFBhVGgyWkVjNWNscFhOSFZaVjA0d1lWYzVkV041Tlc1aFdGSnZaRmRLTVdNeVZubFpNamwxWkVkV2RRcGtRelZxWWpJd2QwTm5XVWxMYjFwSmVtb3dSVUYzVFVSaFFVRjNXbEZKZDBsWmRHdHBaa2hXYWtwYVQyeGpkVWRWVFdwcVZuRjJWM2xEVlVSMlVsVlhDbVowY3pVMlNWZExhVzU0WkVabE1uTTBkVlk1YjJaUVpYUjNlRzEzZGpNdlFXcEZRU3N5UkVVcmNIVXZlVXRJZFdGM1dXWlhOMmRHVWtOeWR6TXlTMkVLUWxjdmFETjRZazlSUjNOSFJHRlZOM05UUkhOWVVrRjVaalZVY1V4VVVIQkNlUzlGQ2kwdExTMHRSVTVFSUVORlVsUkpSa2xEUVZSRkxTMHRMUzBLIn19fX0=",
"integratedTime": 1635624614,
"logIndex": 810844,
"logID": "c0d23d6ad406973f9559f3ba2d1ca01f84147d8ffc5b8445c224f98b9591801d"
}
},
"Subject": "https://github.com/naveensrinivasan/stunning-tribble/.github/workflows/docker-sign.yml@refs/heads/feat/keyless-signing"
}
}
]
@azeemshaikh38 / @laurentsimon This proves the Let me know if you have any other questions. |
This looks great! But since this is for a docker image, and we are concerned with the release artifacts in this issue, want to clarify that my understanding translates well:
@asraa for any additional feedback. |
Yeah, to get around this you would need the workflow to sign with an annotation over the GIT_SHA, and then have the author sign the GIT_SHA
Yes, with
Yes, you can detach the signature with cosign and upload it
Yes, but also with |
Awesome, thanks @asraa! So along with @naveensrinivasan let me know if you are interested in taking this. |
It could be removed with sigstore/fulcio#208 resolved, but yes! |
I will take it. Thanks |
Is the plan to sign in a GH workflow or from GCP? |
GH Workflow. |
@asraa The |
Ah, this is true. Blobs don't have layers so annotations can't be stored there. In that case it will need to come from the cert from issue sigstore/fulcio#208 You may still sign-blob with keyless, but the GIT_SHA will be missing until that issue is resolved. |
Thanks, Do you have an idea as to when is it likely to be worked up on sigstore/fulcio#208? |
Should be in pretty soon! You can still use sign-blob as is, just won't see git_sha in the cert yet. |
+1 |
Thanks! |
Ran into this issue sigstore/cosign#990 |
@asraa Ran into this issue sigstore/rekor#481 |
Marking #1126 as a duplicate of this and closing the other issue. |
Keyless mode is not the only option for providing provenance. There are other ways to do the same thing like the following (I mentioned them in the issue that was closed a while ago): |
@azeemshaikh38, this issue also duplicates with #309 🤔 |
looks like goreleaser/goreleaser#2659 will make everything simpler, thanks to @developer-guy |
Keyless still has an issue in rekor when uploading binaries sigstore/rekor#481. Till there is a solution for this we cannot sign-blob using keyless. |
Thanks @developer-guy! Looks like the goreleaser option would be the simplest/easiest to implement. Any advantages or reasons to prefer the keyless way over this? @naveensrinivasan @developer-guy for feedback.
It's related, but it's for the Docker container images rather than the release artifacts. So keeping it open since this issue does not solve #309. |
Hello @azeemshaikh38, I have great news for you. Recently, we've opened an issue in GoReleaser to support keyless mode.1 There are lots of helpful information and conversation in there. I highly recommend you to take a look at those. Also, we already did some work on the ko project to adapt to these new changes2, and we are now waiting for the new releases for both cosign and GoReleaser projects. We can do the same for the scorecard project too 🙋🏻♂️ Footnotes |
Advantages of Keyless https://github.com/sigstore/cosign/blob/main/KEYLESS.md https://docs.google.com/document/d/189w4Fp1GEA1b2P633HyqTwtcWFNTu_Af4meolMa_1_8/edit?resourcekey=0-QoqNqcHXvSuPnMUdn8RGOQ# @dlorenc wrote about this. Like I mentioned before Keyless signing of blobs is not possible until the We already have The only advantage of signing our binaries with So we should wait until we get the KeyLess option and also Keyless is still experimental and not yet GA. |
@naveensrinivasan @azeemshaikh38 this blog post1 also explains Footnotes |
@naveensrinivasan @azeemshaikh38 GoReleaser v1.0.0 has just been released and is ready for the Keyless signing with cosign. https://github.com/goreleaser/goreleaser/releases/tag/v1.0.0. |
Thanks |
@naveensrinivasan does this unblock us now from implementing this issue or do we have pending blockers still? |
Till this fixed sigstore/rekor#481 no one can use rekor with large files for signing blob. So it is still a blocker. |
Makes sense, thanks! |
I heard about cosign but have never used it. I wonder if it's production-ready so to speak in the sense that it could be easily used by people packaging software to verify tarballs and maybe could even be integrated into package managers? So far everybody seems to have been using GPG partly because it seems to be everywhere. (I'm sorry if it's completely off-topic here. I'm just trying to figure out what cosign is and whether it could potentially be used to sign releases consumed downstream somewhere) |
While I was experimenting with signing and verifying blobs without keys I came across https://github.com/sigstore/cosign#what--is-not--production-ready, which I think answers my question regarding whether Looking for packages I noticed that it seems it's packaged on Arch Linux only: https://archlinux.org/packages/community/x86_64/cosign/ so my takeaway is that cosign looks promising but it doesn't seem to be possible to switch to it at this point unfortunately if releases are supposed to be verified by people packaging software for various distributions. |
This issue is stale because it has been open for 60 days with no activity. |
Is your feature request related to a problem? Please describe.
Scorecard should sign when a new GitTag is pushed to using OIDC and Keyless Option https://github.com/sigstore/cosign
COSIGN_EXPERIMENTAL=1 ./cosign sign-blob --key cosign.key <(git rev-parse HEAD)
https://github.com/sigstore/cosign/blob/main/FUN.mdFor now, it should sign with the gpg key and cosign (keyless option)
The text was updated successfully, but these errors were encountered: