Skip to content
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

Bypass YubiKey Authentication for Self-Generated Key Pairs #3658

Open
abakerwrs opened this issue Apr 8, 2024 · 0 comments
Open

Bypass YubiKey Authentication for Self-Generated Key Pairs #3658

abakerwrs opened this issue Apr 8, 2024 · 0 comments
Labels
question Further information is requested

Comments

@abakerwrs
Copy link

Question

I have been working to get cosign to use an externally generated key pair for signing.
Using OpenSSL to generate the P-256 key pair, I then used yubico-piv-tool to import in the keys into slot 9C with ID 2.

When I tried to sign a blob using the command cosign sign-blob --sk test.file --bundle signature.bundle, I would get the following error message:

Error: signing test.file: data object or application not found
main.go:74: error during command execution: signing test.file: data object or application not found

In tracing through the code, I found that the function func (k *Key) SignerVerifier makes a call to k.card.Attest (within the go-piv/piv-go package). This function attests that the key was generated by the YubiKey. In my scenario, that is not true, so it errors out.

This appears limiting because if a private key is generated on a YubiKey, it cannot be exported for back up. Also, this precludes the use case have having keys generated from an external source and distributed onto a YubiKey.

Would it be possible to add a –-no-attest option to the list of –sk parameters to bypass this attestation as an enhancement?
Or is there another command sequence to support by use case?

@abakerwrs abakerwrs added the question Further information is requested label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant