Keyfactor / ejbca-cert-manager-issuer

External issuer for cert-manager for EJBCA
Apache License 2.0
3 stars 3 forks source link

Add spec value for endEntityName in Issuer/ClusterIssuer CRD, and add support for annotations #8

Closed m8rmclaren closed 1 year ago

m8rmclaren commented 1 year ago

Summary of additions:

EJBCA End Entity Name Configuration

The endEntityName field in the Issuer and ClusterIssuer resource spec allows you to configure how the End Entity Name is selected when issuing certificates through EJBCA. This field offers flexibility by allowing you to select different components from the Certificate Signing Request (CSR) or other contextual data as the End Entity Name.

Configurable Options

Here are the different options you can set for endEntityName:

Default Behavior

If the endEntityName field is not explicitly set, the EJBCA Issuer will attempt to determine the End Entity Name using the following default behavior:

If the Issuer is unable to determine a valid End Entity Name through these steps, an error will be logged and no End Entity Name will be set.

Annotation Overrides for Issuer and ClusterIssuer Resources

The Keyfactor EJBCA external issuer for cert-manager allows you to override default settings in the Issuer and ClusterIssuer resources through the use of annotations. This gives you more granular control on a per-Certificate/CertificateRequest basis.

Supported Annotations

Here are the supported annotations that can override the default values:

How to Apply Annotations

To apply these annotations, include them in the metadata section of your CertificateRequest resource:

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  annotations:
    ejbca-issuer.keyfactor.com/endEntityName: "dns"
    ejbca-issuer.keyfactor.com/certificateAuthorityName: "ManagementCA"
    # ... other annotations
spec:
# ... rest of the spec