-
Notifications
You must be signed in to change notification settings - Fork 564
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
Add support for cert and cert chain flags with PKCS11 tokens #1671
Conversation
Currently, Cosign attempts to automatically extract the certificate from the PKCS11 token, and there's no option to provide your own certificate chain or different certificate. Now, Cosign will respect those flags. Note that the chain must be valid, and the public key from the token must match the provided certificate from either the token or flag. Note that if a cert flag is specified, it will override the certificate fetched from the PKCS11 token if one is present, and log a warning. Signed-off-by: Hayden Blauzvern <[email protected]>
@bburky, would you be able to verify that this is working as expected? I don't have a setup with a PKCS11 token currently. Can you check that:
|
Codecov Report
@@ Coverage Diff @@
## main #1671 +/- ##
==========================================
+ Coverage 29.19% 29.26% +0.06%
==========================================
Files 140 140
Lines 8343 8348 +5
==========================================
+ Hits 2436 2443 +7
+ Misses 5642 5638 -4
- Partials 265 267 +2
Continue to review full report at Codecov.
|
My current smart card appears to have the key usage options incompatible with cosign and I only have an RSA key. With some quick patches from
However, I'm seeing both
This may not be a bug, but the above behavior is a little bit inconsistent (if this is intended, then It seems like the required key usage is Code Signing? I was testing with a critical "Digital Signature, Non Repudiation" certificate instead. For production use, I plan to have a Code Signing certificate issued, but do not currently have one available to test. If I replace this with Lines 846 to 848 in ba50ee0
I think this feature is working correctly, but we have no documentation about the required key usage. |
|
Thanks so much for testing this out. The error you saw, I'll write up some documentation on this. |
…e#1671) Currently, Cosign attempts to automatically extract the certificate from the PKCS11 token, and there's no option to provide your own certificate chain or different certificate. Now, Cosign will respect those flags. Note that the chain must be valid, and the public key from the token must match the provided certificate from either the token or flag. Note that if a cert flag is specified, it will override the certificate fetched from the PKCS11 token if one is present, and log a warning. Signed-off-by: Hayden Blauzvern <[email protected]>
Currently, Cosign attempts to automatically extract the certificate from
the PKCS11 token, and there's no option to provide your own certificate
chain or different certificate. Now, Cosign will respect those flags.
Note that the chain must be valid, and the public key from the token
must match the provided certificate from either the token or flag.
Note that if a cert flag is specified, it will override the certificate
fetched from the PKCS11 token if one is present, and log a warning.
Signed-off-by: Hayden Blauzvern [email protected]
Summary
Ticket Link
Ref #1554
Release Note