-
Notifications
You must be signed in to change notification settings - Fork 558
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
Fix BYO-root with intermediate to fetch intermediates from annotation #2244
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2244 +/- ##
==========================================
+ Coverage 28.57% 28.60% +0.02%
==========================================
Files 131 131
Lines 7852 7855 +3
==========================================
+ Hits 2244 2247 +3
Misses 5302 5302
Partials 306 306
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
5e42630
to
de2ae2a
Compare
I tried these changes with my sample workflow. Unfortunately I now get a panic when attempting to verify my test image. I'm not sure I fully described my test scenario, so that might help to know those details. // environment description
// Using cosign without these changes the verify fails as previously described // When testing with cosign built from this PR I get the following panic
|
What version of Cosign are you on? We've made some changes recently that should add support for more key types. |
The original cosign version was v1.9.0. That's what I used to sign with. The version that got the panic I built from cloning your fork. But I just realized that I didn't switch branches before building so I didn't build the right code. I just switched to the fix-byo-root branch and rebuilt. Now I don't get the panic, I do get the tuf warning messages, but it still appears to error. This is with a build of cosign from your branch
|
The warnings can be ignored, we're fixing that in a downstream library now. Lemme see if I can replicate this issue with the commands you specified. To confirm, you're passing no other flags to |
Correct, no other flags are used. |
Have you set |
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.
It might be nice to have a test for the original issue, too. I need to be convinced that making the intermediatePool
to be nil
solves the problem 😄
@znewman01 I'll add more tests! @gmarks-ntap Without reproducing this yet, I'm pretty certain Zach is correct, that the issue is not specifying |
When I try to verify using
I get the same results whether SIGSTORE_ROOT_FILE is set to the CA root certificate only or a chain file with my intermediate cert first followed by the root CA cert. I haven't yet tried setting up my own TUF root. The blog looks like a good guide, but I will hold of on trying that unless you think that really will provide useful information beyond using SIGSTORE_ROOT_FILE env variable. |
This is likely because the experimental flag wasn’t set on signing, so no entry was created in the transparency log. if you don’t set it on verify (or you do set it on sign and verify), it should work |
This fixes a regression where intermediates, when not present in the intermediate certificate pool, would be fetched from the OCI chain annotation. Ref sigstore#1554, which includes more details Signed-off-by: Hayden Blauzvern <[email protected]>
de2ae2a
to
7ad31ee
Compare
@znewman01 Was there another test you wanted here? I think this test should be testing the original issue, where the specified root file is missing an intermediate |
Yep. I pushed a new image and signed it while using the experimental env variable. Once I did that I'm able to validate my image with the 'attached' cert and cert-chain using the verify command without specifying any parameters to the cosign verify command. Interestingly, I can verify with cosign version 1.9.0 as well as the cosign built from this branch. So it appears, at least for my case, my issue was really just that I didn't use experimental mode when signing. Additionally, I tried setting SIGSTORE_ROOT_FILE to both by root CA certificate as well as my CA chain file. Cosign was able to validate the image with either file specified, with both cosign versions I tried. I'm not sure if that is expected or not but just some extra data. |
This is working as intended. If you don't specify the intermediates in |
This fixes a regression where intermediates, when not present in the intermediate certificate pool, would be fetched from the OCI chain annotation.
Ref #1554, which includes more details
Signed-off-by: Hayden Blauzvern [email protected]
Summary
Release Note
Fixed bug where intermediate certificates were not automatically read from the OCI chain annotation
Documentation