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

feat: adds cert-utility. #1870

Merged
merged 17 commits into from
Jan 24, 2025
Merged

Conversation

ianhundere
Copy link
Contributor

@ianhundere ianhundere commented Nov 21, 2024

closes #1869

Summary

currently, there is no standard method for creating cert chains for fulcio or tsa. the community has used an assortment of open source scripts/tools, but i thought it would be nice to have a small cloud agnostic go app to create/sign (via awskms, gcpkms, or azurekms) certificates. the smallstep crypto library is fairly comprehensive in its kms/cert capabilities.

@haydentherapper / @bobcallaway gave the go ahead in proceeding w/ this work.

Release Note

  • Adds certificate utility to create and sign certificates via AWS KMS, Google Cloud KMS, or Azure Key Vault.

Documentation

added docs to ./docs folder and updated README.md to point to docs.

@ianhundere ianhundere changed the title feat: adds cert templates. feat: adds cert-utility. Nov 22, 2024
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 63.47687% with 229 lines in your changes missing coverage. Please review.

Project coverage is 52.08%. Comparing base (cf238ac) to head (3fb1a80).
Report is 288 commits behind head on main.

Files with missing lines Patch % Lines
pkg/certmaker/certmaker.go 48.20% 162 Missing and 40 partials ⚠️
cmd/certificate_maker/certificate_maker.go 87.97% 16 Missing and 3 partials ⚠️
pkg/certmaker/template.go 89.87% 7 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1870      +/-   ##
==========================================
- Coverage   57.93%   52.08%   -5.85%     
==========================================
  Files          50       73      +23     
  Lines        3119     5646    +2527     
==========================================
+ Hits         1807     2941    +1134     
- Misses       1154     2431    +1277     
- Partials      158      274     +116     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ianhundere ianhundere force-pushed the feat/adds-cert-maker branch 5 times, most recently from 2fbc59f to aa6d7aa Compare November 25, 2024 20:03
@ianhundere ianhundere marked this pull request as ready for review November 25, 2024 20:18
@ianhundere ianhundere force-pushed the feat/adds-cert-maker branch 16 times, most recently from 61d9f68 to 8193f47 Compare December 1, 2024 06:39
@ianhundere
Copy link
Contributor Author

ianhundere commented Dec 1, 2024

i think this is ready for 👀 now. just a couple of notes.

  1. the following use-cases are now covered:
  • root ca -> leaf
  • root ca -> intermediate ca -> leaf
  1. the following kms providers are working:
  • awskms
  • azurekms
  • gcpkms
  1. hashivault was added, but has not been tested.

i think that about covers it.

cc @haydentherapper

@haydentherapper
Copy link
Contributor

Thanks @ianhundere, I’ll take a look at this later this week.

@ianhundere ianhundere force-pushed the feat/adds-cert-maker branch 2 times, most recently from 563de59 to 78b06b6 Compare December 4, 2024 09:14
… consistent w/ flags.

Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
…e flag to gcp-credentials-file.

Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
…son error.

Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
…per, and other PR fb.

Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
@ianhundere ianhundere force-pushed the feat/adds-cert-maker branch 4 times, most recently from 82bd95b to 21ebe36 Compare January 23, 2025 03:48
Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
@ianhundere ianhundere force-pushed the feat/adds-cert-maker branch 3 times, most recently from 8769dc9 to 385226d Compare January 24, 2025 05:03
@ianhundere
Copy link
Contributor Author

@haydentherapper okidoki, i implemented all your suggested feedback including templating.

the behavior now is that templates will be included via the embed package which are used as defaults / a user can still use their own templates to take advantage of https://pkg.go.dev/go.step.sm/crypto/x509util for advanced use-cases.

@ianhundere ianhundere force-pushed the feat/adds-cert-maker branch from 385226d to 5356758 Compare January 24, 2025 05:19
…vements.

Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
@ianhundere ianhundere force-pushed the feat/adds-cert-maker branch from 5356758 to 819a5de Compare January 24, 2025 11:56
…mplates.

Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
Copy link
Contributor

@haydentherapper haydentherapper left a comment

Choose a reason for hiding this comment

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

Thank you for the great work on this!

@haydentherapper haydentherapper merged commit 065f2c2 into sigstore:main Jan 24, 2025
13 checks passed
@ianhundere
Copy link
Contributor Author

Thank you for the great work on this!

absolutely, the tsa PR is also up for review. have a good wknd!

@haydentherapper
Copy link
Contributor

@ianhundere Just realized one thing when reviewing the TSA PR. Should we remove the leaf certificate template processing from Fulcio? For the TSA, this is needed, as the leaf certificate signs timestamps. For Fulcio, Fulcio is the CA so it issues leaf certificates.

@ianhundere ianhundere deleted the feat/adds-cert-maker branch January 24, 2025 21:54
@ianhundere ianhundere restored the feat/adds-cert-maker branch January 24, 2025 21:54
@ianhundere
Copy link
Contributor Author

@haydentherapper ah, good point / so just to confirm, essentially remove all elements associated w/ leaf cert creation (e.g. leaf template, flags etc), correct ?

and should i do that in a separate PR ?

@haydentherapper
Copy link
Contributor

Sorry for two separate threads! I just replied on the TSA PR as well. I'd suggest that we make the leaf cert creation optional, and then point TSA operators to this repo, which will reduce code duplication. The only thing we need in the TSA repo then is the TSA templates for root/intermediate/leaf and a README.

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.

light tool to create/sign (via kms) certs (ca, leaf etc)
3 participants