smallstep / certificates

πŸ›‘οΈ A private certificate authority (X.509 & SSH) & ACME server for secure automated certificate management, so you can use TLS everywhere & SSO for SSH.
https://smallstep.com/certificates
Apache License 2.0
6.6k stars 431 forks source link

Allow x509 Service CA implementation to be injected through ca and authority options #1684

Closed venkyg-sec closed 7 months ago

venkyg-sec commented 7 months ago

Name of feature:

Dependency injection of an externally implemented X509 CA.

Pain or issue this feature alleviates:

Step-ca currently supports 3 types of X509 CA implementations (Vault CA, another Step-CA or Google Cloud CA). For folks who have their own CA implementation and protocol, there's no flexibility to inject such custom code. This PR makes small additions to the Options for CA and Authority and allows the Application to provide a custom X509 CA Service interface.

Is there documentation on how to use this feature? If so, where?

Not yet - but happy to update the sample application in this repository, include tests and include documentation if this feature is of interest.

In what environments or workflows is this feature supported?

Anyone using step-ca as an integrated library

Test

venkyg@venkyg-fedora-PC2HVLQL:~/certificates$ make test
βœ“  acme (3.249s) (coverage: 64.1% of statements)
βœ“  acme/api (142ms) (coverage: 92.4% of statements)
βœ“  acme/db/nosql (11ms) (coverage: 97.0% of statements)
βœ“  api/log (2ms) (coverage: 52.9% of statements)
βˆ…  api/models
βœ“  api/render (2ms) (coverage: 83.7% of statements)
βœ“  api/read (3ms) (coverage: 100.0% of statements)
βˆ…  authority/admin
βˆ…  authority/administrator
βœ“  authority/admin/db/nosql (17ms) (coverage: 94.8% of statements)
βœ“  authority/admin/api (25ms) (coverage: 88.3% of statements)
βœ“  authority/policy (7ms) (coverage: 41.7% of statements)
βœ“  authority/internal/constraints (8ms) (coverage: 81.6% of statements)
βœ“  authority/config (15ms) (coverage: 67.5% of statements)
βœ“  authority (731ms) (coverage: 46.0% of statements)
βœ“  cas (3ms) (coverage: 95.0% of statements)
βœ“  cas/apiv1 (4ms) (coverage: 97.4% of statements)
βœ“  ca/identity (31ms) (coverage: 93.3% of statements)
βœ“  cas/cloudcas (112ms) (coverage: 96.4% of statements)
βœ“  api (5.26s) (coverage: 76.9% of statements)
βœ“  cas/softcas (765ms) (coverage: 91.3% of statements)
βˆ…  cmd/step-ca
βˆ…  commands
βœ“  cas/vaultcas/auth/kubernetes (9ms) (coverage: 87.5% of statements)
βœ“  cas/vaultcas/auth/approle (11ms) (coverage: 86.4% of statements)
βœ“  cas/vaultcas (18ms) (coverage: 79.7% of statements)
βˆ…  examples/basic-client
βˆ…  examples/basic-federation/client
βˆ…  examples/basic-federation/server
βœ“  errs (3ms) (coverage: 7.6% of statements)
βœ“  db (8ms) (coverage: 26.5% of statements)
βˆ…  examples/bootstrap-client
βˆ…  examples/bootstrap-mtls-server
βˆ…  examples/bootstrap-tls-server
βˆ…  monitoring
βœ“  logging (7ms) (coverage: 30.6% of statements)
βˆ…  scripts/badger-migration
βˆ…  server
βœ“  scep/api (26ms) (coverage: 27.4% of statements)
βœ“  policy (47ms) (coverage: 93.0% of statements)
βœ“  pki (208ms) (coverage: 33.8% of statements)
βœ“  scep (211ms) (coverage: 5.0% of statements)
βœ“  webhook (2ms) (coverage: 71.1% of statements)
βœ“  templates (8ms) (coverage: 93.5% of statements)
βœ“  cas/stepcas (3.556s) (coverage: 93.9% of statements)
βœ“  authority/provisioner (14.574s) (coverage: 79.0% of statements)
βœ“  ca (26.841s) (coverage: 43.0% of statements)

DONE 4352 tests in 40.318s
βœ“  acme (5.286s) (coverage: 73.0% of statements)

DONE 302 tests in 7.218s

πŸ’”Thank you!

CLAassistant commented 7 months ago

CLA assistant check
All committers have signed the CLA.

CLAassistant commented 7 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.