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

Add -k8s flag to generate-key-pair #345

Merged
merged 3 commits into from
Jun 2, 2021
Merged

Conversation

priyawadhwa
Copy link
Contributor

@priyawadhwa priyawadhwa commented Jun 1, 2021

This command will:

  1. generate the key-pair in memory
  2. prompt the user for a password
  3. store cosign.pub, cosign.key and cosign.password as a Kubernetes secret
  4. store cosign.pub to disk

This will be useful for chains!

Usage:

cosign generate-key-pair -k8s default/cosign-secret

Outputs a secret with the following data fields:

  • cosign.key (private key)
  • cosign.pub (public key)
  • cosign.password (password)

This command will:
1. generate the key-pair in memory
2. prompt the user for a password
3. store cosign.pub, cosign.key and cosign.password as a Kubernetes secret
4. store cosign.pub to disk

Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
Copy link
Member

@dlorenc dlorenc left a comment

Choose a reason for hiding this comment

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

This looks great! One nit about the way the secret is stored/accessed. Do you think it would make sense to also support passing this as a ref to cosign sign -key k8s://<namespace>/<secret>...? Same for verify. Those can be todos or issues though.

pkg/cosign/keys.go Outdated Show resolved Hide resolved
Signed-off-by: Priya Wadhwa <priyawadhwa@google.com>
@priyawadhwa
Copy link
Contributor Author

Do you think it would make sense to also support passing this as a ref to cosign sign -key k8s:///...? Same for verify.

I could see people using this if they're running cosign in k8s as well -- opened up #347 to track it.

@dlorenc dlorenc merged commit 8b0bcec into sigstore:main Jun 2, 2021
@cpanato cpanato added this to the v0.5.0 milestone Jun 2, 2021
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.

3 participants