-
Notifications
You must be signed in to change notification settings - Fork 56
Fail to sign artifacts when ExtendedKeyUsage
claim is absent from issuer certificate
#658
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
Hmm, could you say more about the expected behavior here? From this:
-- it sounds like your backing CA isn't using a Precertificate Signing Certificate per RFC 6962. My read of the RFC is that the CA is required to do one of two things:
We haven't seen the latter in practice with Sigstore, but maybe that's what's happening here 🙂 |
Yes indeed, we are hitting the second case with the TBS that need to be signed by the same Authority than the final one. As such the CA doesn't need to have the CT EKU, in fact it does not need to have an EKU at all. ext_key_usage = issuer.extensions.get_extension_for_class(ExtendedKeyUsage) Assumes that we have at least one EKU and only checks whether or not CT is one of them, wich doesn't comply with the RFC which only require EKU for the Precertificate Signing Certificate. One last thing, I might be wrong but the Precertificate Signing Certificate and the certificate signing the final certificate should both be trusted CA, I couldn't found the part of the code that is verify the |
Cool, thanks for confirming.
I believe that's right, concerningly -- I don't remember why we don't do the full chain verification here. I'll have some more time to look into this later today. CC @asraa and @haydentherapper -- I figure one or both of you might have some more context here, including what other clients do w/r/t SCT chain validation 🙂 |
Answering my question: we don't do chain verification in the precertificate case because we're doing plain-old public key cryptography here, with the |
+1 to @woodruffw. Agreed that we should ideally support all of RFC6962, but given that we'll have to do a bit of work to support that (it's going to differ by language, golang has good SCT support but other languages don't), are you open to signing with a separate key rather than the CA? |
I think I see the reasoning behind not verifying the chain (we blindly trust that TUF is providing us the right CA cert for the CT), even though it would be better to do it just to prevent edge cases in a perfect world. If I've read correctly, the RFC 6962 states that in the precertificate case, we should have the Anyway the problem of @mayaCostantini isn't with the precertificate case but in the case where the CT CA is the same for both, the TBS and the final certificate. ext_key_usage = issuer.extensions.get_extension_for_class(ExtendedKeyUsage) It should be at least catch |
Agreed; I'll add that check 🙂
Makes sense to me, I'll add that as well. |
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present Resolves: sigstore#658
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]> Update sigstore/_utils.py Signed-off-by: William Woodruff <[email protected]> Update CHANGELOG.md Signed-off-by: William Woodruff <[email protected]> Signed-off-by: Cyril Cordoui <[email protected]>
RFC 6962 stipulate that the TBSCertificate can be either signed by: - A special purpose CA Precertificate Signing Certificate with an EKU - The final CA Certificate with no mandatory EKU In _is_preissuer was failing on the later if no EKU was present In both case, the certificate must be a valid CA Resolves: sigstore#658 Signed-off-by: Cyril Cordoui <[email protected]> Update sigstore/_utils.py Signed-off-by: William Woodruff <[email protected]> Update CHANGELOG.md Signed-off-by: William Woodruff <[email protected]> Signed-off-by: Cyril Cordoui <[email protected]>
Description
Signing an artifact against a private instance of Fulcio deployed with a password-protected private key backend raises an
ExtensionNotFound
error. After investigation, it seems like when verifying the SCT, the_is_preissuer
internal method fails if it cannot find theExtendedKeyUsage
extension in the issuer certificate.However I did not observe this behavior when signing with Cosign against the same instances.
The issue is also absent when signing with
sigstore-python
against another private instance of Sigstore deployed with a Google CA backend, which seems to provide the correct extensions.Version
sigstore-python v1.1.1
The text was updated successfully, but these errors were encountered: