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

Default generated PEM labels to SIGSTORE #2735

Merged
merged 1 commit into from
Mar 17, 2023

Conversation

ivanayov
Copy link
Contributor

Summary

This change adds "SIGSTORE" PEM label and accepts both the old "COSIGN" label and the new one.
Newly generated keys are now created with "SIGSTORE" label

Resolves #2471

As #2376 is not closed yet, this change updates to generating private keys with "SIGSTORE" PEM label by default.

Did not update the CI (in particular .github/workflows/cosign-test.key) for backwards compatibility safety (i.e. still available "COSIGN" label support).

Release Note

Generated PEM labels were updated to "SIGSTORE" rather than the previous "COSIGN". Both are still supported and accepted, but newly generated will be with the updated label.

Documentation

PEM labels were not previously referenced in the docs, so nothing to update.

Copy link
Contributor

@znewman01 znewman01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the slow review! I should be quicker in the future.

Can we add a test case to make sure that both are read successfully?

One for writing too would be good.

@ivanayov ivanayov force-pushed the update_pem_labels branch 2 times, most recently from 6da70f6 to d912415 Compare March 17, 2023 12:21
@ivanayov
Copy link
Contributor Author

Thanks @znewman01 !

I added tests for reading both the old and the new type, and writing the new type, as the current change defaults to "SIGSTORE".

You mentioned an option to emit the old "COSIGN" type for backwards compatibility and I have some questions:

  • As both are accepted successfully now, do we consider it's breaking the backwards compatibility for not emitting "COSIGN"? (To me it looks like No, but you might know some use-cases where people would still need generating the old type.)
  • Supporting both would mean giving a cmd or config options to select from and I have some concerns here:
    • Generating key pair at the moment is pretty simple and straightforward and adding one more step for something that's usually auto-generated might look confusing
    • Allowing an option to select a PEM label looks a bit strange from user perspective and I think if we do that, there should be some strong reasoning behind
    • I had a look and it requires some refactoring - not big, but touching generic functionality. I'm ok with addressing that if you think it's worth and not risky for a temporary change (considering it's going to be removed in several months)

This is why the current change emits only "SIGSTORE", but I'm happy to add support for both if you think that would be the right approach.

Thank you for your input in advance.

@znewman01
Copy link
Contributor

As both are accepted successfully now, do we consider it's breaking the backwards compatibility for not emitting "COSIGN"? (To me it looks like No, but you might know some use-cases where people would still need generating the old type.)

The question is: are we worried about scenarios where a new client generates a key and an older client uses that key?

I can see an argument for "no" because this is mostly a client-side concern, but I worry about public keys generated by new clients.

That said--I'd be okay omitting the option for now for the other reasons you mention.

znewman01
znewman01 previously approved these changes Mar 17, 2023
@znewman01
Copy link
Contributor

If you fix lint I'm happy with this!

This change adds SIGSTORE PEM label and accepts both the old
COSIGN label and the new one. Newly generated keys are now created
with SIGSTORE label

Signed-off-by: Ivana Atanasova <[email protected]>
@ivanayov
Copy link
Contributor Author

Thanka @znewman01, I pushed an update

@znewman01 znewman01 enabled auto-merge (squash) March 17, 2023 15:47
@codecov
Copy link

codecov bot commented Mar 17, 2023

Codecov Report

Merging #2735 (dfbb56c) into main (9d55c5e) will decrease coverage by 0.01%.
The diff coverage is 87.50%.

@@            Coverage Diff             @@
##             main    #2735      +/-   ##
==========================================
- Coverage   29.54%   29.54%   -0.01%     
==========================================
  Files         151      151              
  Lines        9646     9658      +12     
==========================================
+ Hits         2850     2853       +3     
- Misses       6357     6366       +9     
  Partials      439      439              
Impacted Files Coverage Δ
pkg/cosign/keys.go 59.25% <87.50%> (+0.92%) ⬆️

... and 10 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@znewman01 znewman01 merged commit 6c41101 into sigstore:main Mar 17, 2023
@github-actions github-actions bot added this to the v1.14.0 milestone Mar 17, 2023
dmitris pushed a commit to dmitris/cosign that referenced this pull request Mar 24, 2023
This change adds SIGSTORE PEM label and accepts both the old
COSIGN label and the new one. Newly generated keys are now created
with SIGSTORE label

Signed-off-by: Ivana Atanasova <[email protected]>
Co-authored-by: Ivana Atanasova <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generated PEM labels should say "SIGSTORE" rather than "COSIGN"
2 participants