-
Notifications
You must be signed in to change notification settings - Fork 596
cosign doesn't correctly respect individual TSA certificate chains #4098
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
Comments
A fix would be welcome, though if it’s a significant change, feel free to not and we will fix it indirectly with Sigstore-go. |
@haydentherapper I see two ways to fix this basically:
I think going for the second option makes more sense (a little more code required, but not breaking API), WDYT? |
We don't offer any gurantees around API breakages for Cosign so making a breaking change would be fine. I'm OK with either approach. |
This PR is related to sigstore/cosign#4098 - in order to fix that issue, the cosign code has to access the target name to see if it's one of the "fallbacks" or not (and treat it accordingly as explained in the linked issue). I really wanted to keep this change contained to cosign codebase itself, but I just couldn't find a way to do this; I think adding this small PR here shouldn't hurt, as it is fully backwards compatible. Signed-off-by: Slavek Kabrda <[email protected]>
Description
I have a private Sigstore instance, in which I attempted to rotate the TSA certificate chain. When trying to verify any blob/image after the rotation, I get the following error:
This is because the
GetTSACerts
function inpkg/cosign/tsa.go
only expects to parse out a single certificate chain, because of the assumption that these individual chains are provided as individual TUF targets.However in order to be able to properly rotate the TSA certificate chain, one needs to provide the whole TSA certificate chain as a single TUF target (which is possible and I do it). However, when I attempt to introduce a new TSA chain as a new TUF target and keeping the old one as "Expired", I get the above error when verifying any artifact.
I think the
GetTSACerts
function should behave more likeGetRekorPubs
, which returns multiple keys and all of them are considered valid for verification.I think this will actually work fine in the future with #3844 because of how the timestamp verification function from sigstore-go works. I can submit a PR to fix this if you think it's still worth it before #3844 gets merged - I think it's worth because of private Sigstore deployments that might be slower to upgrade.
Version
2.4.1, but applies to latest main branch as well AFAICS
The text was updated successfully, but these errors were encountered: