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

X509 Name support #2288

Closed
chojnack opened this issue Oct 25, 2019 · 3 comments · Fixed by #2518
Closed

X509 Name support #2288

chojnack opened this issue Oct 25, 2019 · 3 comments · Fixed by #2518
Labels
area/api Indicates a PR directly modifies the 'pkg/apis' directory kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@chojnack
Copy link

Is your feature request related to a problem? Please describe.

Currently Certificates only include Common name and Organization fields that identify the originator of the CSR.
During implementation of ADCS Issuer (see: ADCS Issuer) I foud this as a limitation that doesn't allow cert-manager to be used in production environment where TLS certificates must include all X509 Name fields (X509Name).

Describe the solution you'd like

The Certificate CRD could be extended like this:

type CertificateSpec struct {
        // Full X509 name specification (https://golang.org/pkg/crypto/x509/pkix/#Name).
        // If specified, overrides any other name elements below.
        // +optional
        X509Name *X509DistinguishedName `json:"x509Name,omitempty"`
        ...
}

type X509DistinguishedName struct {
        // Country/Region
        Country            []string `json:"country,omitempty"`
        Organization       []string `json:"organization,omitempty"`
        OrganizationalUnit []string `json:"organizationalUnit,omitempty"`
        // City
        Locality []string `json:"locality,omitempty"`
        // State/Province
        Province      []string `json:"province,omitempty"`
        StreetAddress []string `json:"streetAddress,omitempty"`
        PostalCode    []string `json:"postalCode,omitempty"`
        SerialNumber  string   `json:"serialNumber,omitempty"`
        CommonName    string   `json:"commonName,omitempty"`
}


Describe alternatives you've considered
Currently we're using private build of cert-manager where support for full X509 name has been locally implemented.

Additional context
ADCS Issuer implementation

Environment details (if applicable):

  • cert-manager version 0.11.0

/kind feature

@jetstack-bot jetstack-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 25, 2019
@munnerz
Copy link
Member

munnerz commented Oct 29, 2019

So we can definitely expose more of these options on our Certificate resource type, first of all 😄

Based on the fields on the Name structure, it seems we still need to expose:

  • Country
  • OrganizationalUnit
  • Locality
  • Province
  • StreetAddress
  • PostalCode

What is the relation between SerialNumber and the *big.Int SerialNumber field on the x509.Certificate? Do we need to allow explicitly setting the subject serial number field?

/area api
/priority important-longterm

@jetstack-bot jetstack-bot added area/api Indicates a PR directly modifies the 'pkg/apis' directory priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. labels Oct 29, 2019
@chojnack
Copy link
Author

I'd put all the elements of X509 name in separate sub-section of the config, just for clarity (later, the stand-alone Common name and Organization could be made obsolete).

Reg. the serial number, I couldn't find any information how it's presence in the request should be interpreted by the issuers. I think, a safe solution could be allowing to set it optionally in the request and leaving the interpretation of the presence/absence to the issuer (whether use it, ignore, overwrite or reject the request). Current cert-manager's issuers could just ignore it.

Marcin

@leifmadsen
Copy link

Not having OrganizationalUnit also affects me, so this would be a welcome addition!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Indicates a PR directly modifies the 'pkg/apis' directory kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants