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

feature: added name constraints in certs with isCA enabled #6500

Merged

Conversation

tanujd11
Copy link
Member

@tanujd11 tanujd11 commented Nov 19, 2023

Pull Request Motivation

Add name constraints feature in certificates with isCA enabled. Check #3655 for more details. The PR implements RFC: https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10

Following is an example of the certificate using the nameConstraint:

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
  name: ca-cert-example
spec:
  secretName: example-ca-key-pair
  isCA: true
  issuerRef:
    name: selfsigned
    kind: ClusterIssuer
  commonName: "example1.com"
  dnsNames:
  - example1.com
  nameConstraints:
    critical: true
    permitted:
      dnsDomains: ["example1.com", "example2.com"]
      ipRanges: ["10.10.0.0/16"]
      emailAddress: ["example@example.org"]
    excluded:
      ipRanges: ["10.10.0.0/24"]

Verification: Checkout the nameConstraint section of the CA cert generated by above yaml.

openssl x509 -in cert.crt -text
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number:
            51:81:28:14:0f:9b:fc:41:06:59:95:60:ff:2c:53:ed
        Signature Algorithm: sha256WithRSAEncryption
        Issuer: CN = example1.com
        Validity
            Not Before: Nov 23 06:11:27 2023 GMT
            Not After : Feb 21 06:11:27 2024 GMT
        Subject: CN = example1.com
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
                Public-Key: (2048 bit)
                Modulus:
                    00:b7:fd:2c:bc:48:53:c2:f8:b8:2c:1d:54:62:ef:
                    04:d3:73:48:6d:24:2b:c9:37:cb:ba:7d:f3:b8:56:
                    f2:c7:59:26:70:a9:fd:7d:e2:34:3d:52:f9:ad:3d:
                    c9:54:17:1f:6e:92:56:cd:5f:4a:f2:fc:32:20:48:
                    94:b5:cf:30:8e:90:76:91:a5:34:bc:de:74:ab:8a:
                    a6:03:0b:41:74:f4:b8:c7:fd:93:19:e4:ed:d6:5f:
                    35:7f:2a:27:31:1c:9b:f0:92:05:c1:2f:19:73:de:
                    e1:b3:6b:6f:59:bd:89:5b:42:63:9c:82:6e:00:4c:
                    00:24:61:7f:4e:8d:95:0d:7b:b1:8b:2f:55:f8:d6:
                    a1:2e:0c:84:a4:64:38:a6:15:a5:1e:8d:8d:89:20:
                    55:52:15:ad:7b:ce:ac:b5:b8:f7:6b:18:24:54:0c:
                    63:fe:de:e4:1e:40:26:92:e8:e5:87:cf:23:0c:49:
                    f2:85:bb:94:ae:2f:4b:97:fb:97:ab:b5:b0:06:45:
                    51:69:95:d3:90:41:75:b1:4a:ed:6b:2d:fd:25:73:
                    51:83:8a:44:8c:f8:a0:20:dd:41:a4:d4:f5:4b:ef:
                    d8:6c:df:10:e6:51:67:15:c7:0d:ea:c3:d2:b1:64:
                    a5:57:04:00:5b:2e:91:31:97:ef:40:85:c5:9c:64:
                    74:67
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Key Usage: critical
                Digital Signature, Key Encipherment, Certificate Sign
            X509v3 Basic Constraints: critical
                CA:TRUE
            X509v3 Subject Key Identifier:
                8B:00:98:38:52:1F:A1:03:83:12:B0:0A:D9:35:14:27:E2:FB:69:D4
            X509v3 Subject Alternative Name:
                DNS:example1.com
            X509v3 Name Constraints: critical
                Permitted:
                  DNS:example1.com
                  DNS:example2.com
                  IP:10.10.0.0/255.255.0.0
                  email:example@example.org
                Excluded:
                  IP:10.10.0.0/255.255.255.0
    Signature Algorithm: sha256WithRSAEncryption
    Signature Value:
        25:0f:c4:ea:e3:1b:29:c7:04:6a:ad:e1:78:bc:39:21:72:e3:
        a5:fc:4e:57:33:e1:92:c8:c3:41:b2:2b:22:ec:0f:2b:a8:3d:
        80:b3:3d:4b:c9:29:8e:fb:e9:0b:99:f5:2c:6c:02:b5:78:06:
        19:3b:55:f4:9e:1d:6a:b1:7d:3a:c8:07:47:50:68:d5:7d:c8:
        f6:83:45:6d:12:12:b5:15:ce:b9:e8:be:1c:81:ef:8a:01:08:
        66:e7:66:5c:02:fe:25:c7:f5:83:4e:9c:63:d2:3c:a3:eb:3a:
        77:8a:ef:8b:cc:fe:67:33:02:51:4f:81:d4:ff:8e:8b:e9:d0:
        7f:2a:f1:2e:51:5e:90:ea:ef:fd:62:54:9c:a0:82:1c:f5:ed:
        05:1a:a4:ee:aa:45:47:77:80:75:79:0c:04:d7:ee:4f:6a:1c:
        7e:f4:f7:83:d4:9a:e3:eb:28:13:88:fc:6c:70:df:c1:89:ab:
        76:b3:b7:e0:7f:63:53:bf:cc:92:c4:d2:4c:cb:ce:89:a3:dc:
        a3:09:13:14:88:aa:42:0a:87:df:86:3d:64:fe:36:cc:54:94:
        2e:51:77:2a:6c:98:ab:64:db:3b:cf:72:c9:9f:4f:48:bb:c3:
        f2:e2:cd:19:b7:f7:ea:29:0f:97:6c:65:92:ba:33:08:96:95:
        17:44:bc:50
-----BEGIN CERTIFICATE-----
MIIDdjCCAl6gAwIBAgIQUYEoFA+b/EEGWZVg/yxT7TANBgkqhkiG9w0BAQsFADAX
MRUwEwYDVQQDEwxleGFtcGxlMS5jb20wHhcNMjMxMTIzMDYxMTI3WhcNMjQwMjIx
MDYxMTI3WjAXMRUwEwYDVQQDEwxleGFtcGxlMS5jb20wggEiMA0GCSqGSIb3DQEB
AQUAA4IBDwAwggEKAoIBAQC3/Sy8SFPC+LgsHVRi7wTTc0htJCvJN8u6ffO4VvLH
WSZwqf194jQ9UvmtPclUFx9uklbNX0ry/DIgSJS1zzCOkHaRpTS83nSriqYDC0F0
9LjH/ZMZ5O3WXzV/KicxHJvwkgXBLxlz3uGza29ZvYlbQmOcgm4ATAAkYX9OjZUN
e7GLL1X41qEuDISkZDimFaUejY2JIFVSFa17zqy1uPdrGCRUDGP+3uQeQCaS6OWH
zyMMSfKFu5SuL0uX+5ertbAGRVFpldOQQXWxSu1rLf0lc1GDikSM+KAg3UGk1PVL
79hs3xDmUWcVxw3qw9KxZKVXBABbLpExl+9AhcWcZHRnAgMBAAGjgb0wgbowDgYD
VR0PAQH/BAQDAgKkMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFIsAmDhSH6ED
gxKwCtk1FCfi+2nUMBcGA1UdEQQQMA6CDGV4YW1wbGUxLmNvbTBfBgNVHR4BAf8E
VTBToEMwDoIMZXhhbXBsZTEuY29tMA6CDGV4YW1wbGUyLmNvbTAKhwgKCgAA//8A
ADAVgRNleGFtcGxlQGV4YW1wbGUub3JnoQwwCocICgoAAP///wAwDQYJKoZIhvcN
AQELBQADggEBACUPxOrjGynHBGqt4Xi8OSFy46X8Tlcz4ZLIw0GyKyLsDyuoPYCz
PUvJKY776QuZ9SxsArV4Bhk7VfSeHWqxfTrIB0dQaNV9yPaDRW0SErUVzrnovhyB
74oBCGbnZlwC/iXH9YNOnGPSPKPrOneK74vM/mczAlFPgdT/jovp0H8q8S5RXpDq
7/1iVJygghz17QUapO6qRUd3gHV5DATX7k9qHH7094PUmuPrKBOI/Gxw38GJq3az
t+B/Y1O/zJLE0kzLzomj3KMJExSIqkIKh9+GPWT+NsxUlC5RdypsmKtk2zvPcsmf
T0i7w/LizRm39+opD5dsZZK6MwiWlRdEvFA=
-----END CERTIFICATE-----

Kind

feature

Release Note

Users can now use nameConstraints in CA certificates. To know more details on name constraints check out RFC section https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10

@jetstack-bot jetstack-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Nov 19, 2023
@jetstack-bot
Copy link
Contributor

Hi @tanujd11. Thanks for your PR.

I'm waiting for a cert-manager member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jetstack-bot jetstack-bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration labels Nov 19, 2023
@tanujd11 tanujd11 marked this pull request as ready for review November 19, 2023 08:08
@jetstack-bot jetstack-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 19, 2023
@tanujd11 tanujd11 marked this pull request as draft November 20, 2023 04:29
@jetstack-bot jetstack-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 20, 2023
@tanujd11 tanujd11 force-pushed the feature/ca-cert-name-constraint branch from b55381a to 09b2cfd Compare November 20, 2023 08:32
@tanujd11 tanujd11 marked this pull request as ready for review November 20, 2023 08:32
@jetstack-bot jetstack-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 20, 2023
@maelvls
Copy link
Member

maelvls commented Nov 20, 2023

Hi! I'll turn on testing for you.

/ok-to-test
/kind feature

@jetstack-bot jetstack-bot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 20, 2023
@maelvls maelvls added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 20, 2023
@jetstack-bot jetstack-bot removed the needs-kind Indicates a PR lacks a `kind/foo` label and requires one. label Nov 20, 2023
@maelvls
Copy link
Member

maelvls commented Nov 20, 2023

Hi! Great work on this, I'm really glad you were able to take a stab at this!!

Regarding the choice of going with a feature flag, I imagine that the point of gating this feature is to refine the API surface? Or should we have to worry about the consequence of turning on this feature for everyone for some unexpected reason?

Could you add an example of what the API would look like in the PR description too? Thanks!

@tanujd11
Copy link
Member Author

Hi @maelvls I have added the API in the PR description. Also added validating name constraint step at issuer before signing the certificate. Please take a look. Thanks

@tanujd11 tanujd11 force-pushed the feature/ca-cert-name-constraint branch from 07f1a08 to 2fa82ad Compare November 23, 2023 09:37
@maelvls
Copy link
Member

maelvls commented Dec 4, 2023

The test "certificates: TestGeneratesNewPrivateKeyPerRequest" fails because one of the HTTP calls in the test code isn't being retried and thus fails when a benign optimistic locking error shows up:

generates_new_private_key_per_request_test.go:273: failed to update certificate: Operation cannot be fulfilled on certificates.cert-manager.io "testcrt": the object has been modified; please apply your changes to the latest version and try again

I am surprised that we still get this kind of problem, I tried to fix most of them a year ago 😅 Let's re-run the test, the error should go away.

@maelvls
Copy link
Member

maelvls commented Dec 4, 2023

For context for anyone reading this, this PR is in three folds:

  • A new feature gate UseCertificateRequestNameConstraints introduced in alpha. I am still unsure whether this is needed. Previously, we used the feature gate UseCertificateRequestBasicConstraints because it would suddenly change the contents of CertificateRequests if they had isCA: true. I am unsure whether it also applies to this name constraints PR.
  • A pre-signing check specific to the CA issuer: when the CA issuer is about to sign a certificate, the CA issuer performs an ad-hoc check of the nameConstraints with respect to the DNS names, URIs, emails, and IP addresses. I think I need help in knowing whether having an ad-hoc func is a good idea here.
  • An addition to the Certificate API: the nameConstraints field is added. I think this change in not controversial, the API seems OK to me.

About the pre-signing check in the CA issuer (func validateNameConstraints):

  • The reason we want to add this pre-signing check is because Tanuj found out that it is easy to mistakenly to have the CA issuer issue a leaf certificate that doesn't comply with the name constraints. That's because the signed cert isn't validated after signing it in the CA issuer.
  • For context, the name constraints are meant to be validated by the client during the TLS handshake. The client validates that the name constraints of the intermediate CAs and root CA match its subject DN and SANs.
  • After looking at the complexity of the Name Constraints section in the RFC, I worry that this ad-hoc pre-signing check won't match the actual rules. The risk is minimal since it is the client's responsibility to check these constraints, not ours. The worst case scenario is that the pre-signing check is too tight, in which case we can always patch cert-manager.
  • Go's x509 package has an internal func checkNameConstraints that does this correctly, but it is much more involved and requires knowing about the whole chain, not just the (possibly) intermediate CA cert. The CA issuer doesn't have the information about the whole chain which prevents us from vendoring the Go lib's func.
  • To conclude, although validateNameConstraints is imperfect, I am happy with keeping it as-is and not trying to re-implement the whole name constraints validation.

@SgtCoDFish Am I correct in thinking that the CA issuer can't validate its own issued certificates when the CA issuer is given an intermediate CA certificate and private key?

@tanujd11
Copy link
Member Author

tanujd11 commented Dec 4, 2023

/retest

@tanujd11
Copy link
Member Author

tanujd11 commented Dec 6, 2023

Thanks @inteon for pointing this one out. Somehow I thought I fixed the typo but it was not the case. Have done it now, Also please let me know of your thoughts on the other comment

@maelvls
Copy link
Member

maelvls commented Dec 7, 2023

Hey! It seems like all the remarks from @inteon have been resolved. I'd be happy to have this merged once we have a documentation PR. Since this new feature applies to the next version of cert-manager (1.14), the changes need to be done to the docs/ folder and branched from the release-next branch. Let me know if you need help!

Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
…lidateNameConstraints

Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
@jetstack-bot jetstack-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 7, 2023
@tanujd11 tanujd11 force-pushed the feature/ca-cert-name-constraint branch from b602353 to 28ca431 Compare December 7, 2023 17:02
@jetstack-bot jetstack-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 7, 2023
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
@tanujd11 tanujd11 force-pushed the feature/ca-cert-name-constraint branch from a7f1d3d to a29a591 Compare December 7, 2023 18:12
Copy link
Member

@inteon inteon left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm
/hold in case someone else wants to review

@jetstack-bot jetstack-bot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 7, 2023
Copy link
Member

@maelvls maelvls left a comment

Choose a reason for hiding this comment

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

The documentation PR is ready: cert-manager/website#1358. Thanks Tanuj!

/lgtm

@jetstack-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon, maelvls

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@inteon
Copy link
Member

inteon commented Dec 8, 2023

/unhold

@jetstack-bot jetstack-bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 8, 2023
@jetstack-bot jetstack-bot merged commit e8d2790 into cert-manager:master Dec 8, 2023
5 of 6 checks passed

// NameConstraints represents the NameConstraints extension.
type NameConstraints struct {
PermittedDNSDomainsCritical bool `asn1:"optional,explicit,tag:0"`
Copy link
Member

Choose a reason for hiding this comment

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

I missed this in the review, but this is not correct, this is not what is described in the x509 spec.
/cc @maelvls

Copy link
Member

Choose a reason for hiding this comment

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

@tanujd11 could you create a new PR to fix this?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hey @inteon , what exactly are you referring here?

Copy link
Member

@inteon inteon Dec 11, 2023

Choose a reason for hiding this comment

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

The marshalled NameConstraints extension in the CSR has to match the format defined in the RFC 5280, 4.2.1.10 (see https://www.alvestrand.no/objectid/2.5.29.30.html).
The encoding you specified seems to be custom.
We can use the logic the x509 library uses: https://cs.opensource.google/go/go/+/refs/tags/go1.21.5:src/crypto/x509/x509.go;l=1189-1285;drc=82c713feb05da594567631972082af2fcba0ee4f

@inteon
Copy link
Member

inteon commented Dec 12, 2023

NOTE: we found that we missed something in this PR and fixed the issue in #6542.

nrdufour added a commit to nrdufour/home-ops that referenced this pull request Feb 4, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [cert-manager](https://github.com/cert-manager/cert-manager) | minor | `v1.13.3` -> `v1.14.1` |

---

### Release Notes

<details>
<summary>cert-manager/cert-manager (cert-manager)</summary>

### [`v1.14.1`](https://github.com/cert-manager/cert-manager/releases/tag/v1.14.1)

[Compare Source](cert-manager/cert-manager@v1.14.0...v1.14.1)

cert-manager is the easiest way to automatically manage certificates in Kubernetes and OpenShift clusters.

cert-manager 1.14 brings a variety of features, security improvements and bug fixes, including: support for creating X.509 certificates with "Other Name" fields, and support for creating CA certificates with "Name Constraints" and "Authority Information Accessors" extensions.

> 📢 cert-manager `v1.14.1` fixes bugs found *during* the release of `v1.14.0`.
>
> When upgrading to cert-manager release 1.14, please skip `v1.14.0` and install this patch version instead.

##### Documentation

-   [Release notes](https://cert-manager.io/docs/releases/release-notes/release-notes-1.14)
-   [Upgrade notes](https://cert-manager.io/docs/releases/upgrading/upgrading-1.13-1.14)
-   [Installation instructions](https://cert-manager.io/docs/installation/)

##### Changes since `v1.14.0`

##### Bug or Regression

-   Fix broken cainjector image value in Helm chart ([#&#8203;6693](cert-manager/cert-manager#6693), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   Fix bug in cmctl namespace detection which prevented it being used as a startupapicheck image in namespaces other than cert-manager. ([#&#8203;6706](cert-manager/cert-manager#6706), [@&#8203;inteon](https://github.com/inteon))
-   Fix bug in cmctl which caused `cmctl experimental install` to panic. ([#&#8203;6706](cert-manager/cert-manager#6706), [@&#8203;inteon](https://github.com/inteon))

### [`v1.14.0`](https://github.com/cert-manager/cert-manager/releases/tag/v1.14.0)

[Compare Source](cert-manager/cert-manager@v1.13.3...v1.14.0)

cert-manager is the easiest way to automatically manage certificates in Kubernetes and OpenShift clusters.

cert-manager 1.14 brings a variety of features, security improvements and bug fixes, including: support for creating X.509 certificates with "Other Name" fields, and support for creating CA certificates with "Name Constraints" and "Authority Information Accessors" extensions.

> ⚠️ This version has known issues. Please install `v1.14.1` instead.
>
> During the release of `v1.14.0`, the Helm chart was found to use the wrong OCI image for the `cainjector` Deployment,
> which caused the Helm installation and the static manifest based installation to fail.
> Upon discovery of this bug, the release of `v1.14.0` was paused before the Helm chart or GitHub release were published;
> but the Git tag and the OCI images had already been published.
>
> The cert-manager team next fixed the Helm chart and two other bugs which are listed in the "Known Issues" section below,
> and then released `v1.14.1`, which is the version that users are strongly advised to install when they upgrade to 1.14.
>
> In order to complete the stalled `v1.14.0` release,
> the Helm chart and static YAML installation files were regenerated on a team member's laptop,
> using exactly the same build scripts as are used in the automated release process,
> and using the `v1.14.1` version of the code.
> The working  `v1.14.0` Helm chart was published,
> and the working versions of the static manifest files attached to the draft `v1.14.0` GitHub release,
> and that was then published.
>
> For these reasons, users are strongly advised to skip this version and install the `v1.14.1` Helm chart instead.

##### Known Issues

-   During the release of `v1.14.0`, the Helm chart for this version was found to use the wrong OCI image for the `cainjector` Deployment,
    which caused the Helm installation to fail.
    In order to complete the release, the cert-manager team have manually updated the Helm chart for this version,
    which contains all the Helm chart fixes which are in `v1.14.1`.
    But users are strongly advised to skip this version and install the `v1.14.1` Helm chart instead.
-   A bug in cmctl namespace detection prevents it being used as a `startupapicheck` image in namespaces other than cert-manager.
-   A bug in cmctl causes `cmctl experimental install` to panic.

##### Breaking Changes

The startupapicheck job uses a new OCI image called "startupapicheck", instead of the ctl image.
If you run in an environment in which images cannot be pulled, be sure to include the new image.

The KeyUsage and BasicConstraints extensions will now be encoded as critical in the CertificateRequest's CSR blob.

##### Major Themes

##### New X.509 Features

The cert-manager Certificate resource now allows you to configure a subset of "Other Name" SANs,
which are described in the [Subject Alternative Name section of RFC 5280](https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.6) (on page 37).

We specifically support any `otherName` type with a `UTF-8` value, such as the [User Principal Name](https://docs.venafi.com/Docs/current/TopNav/Content/Certificates/r-UEP-support-SANs.php) or [`sAMAccountName`](https://learn.microsoft.com/en-us/windows/win32/ad/naming-properties).
These are useful when issuing unique certificates for authenticating with LDAP systems such as Microsoft Active Directory.
For example you can create certificates with this block in the spec:

      otherNames:
        - oid: 1.3.6.1.4.1.311.20.2.3 # UPN OID
          utf8Value: upn@domain.local

The feature is still in alpha stage and requires you to [enable the `OtherName` feature flag in the controller and webhook components](../../installation/configuring-components.md#feature-gates).

##### New CA certificate Features

You can now specify the X.509 v3 Authority Information Accessors extension,
with URLs for certificates issued by the CA issuer.

Users can now use name constraints in CA certificates.
To know more details on name constraints check out RFC section https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10

##### Security

An ongoing security audit of the cert-manager code revealed some weaknesses which we have addressed in this release,
such as using more secure default settings in the HTTP servers that serve metrics, healthz and pprof endpoints.
This will help mitigate denial-of-service attacks against those important services.

All the cert-manager containers are now configured with read only root file system by default,
to prevent unexpected changes to the file system of the OCI image.

And it is now possible to configure the metrics server to use HTTPS rather than HTTP,
so that clients can verify the identity of the metrics server.

##### Other

The liveness probe of the cert-manager controller Pod is now enabled by default.

There is a new option `.spec.keystores.pkcs12.algorithms` to specify encryption and MAC algorithms for PKCS.

##### Community

Thanks again to all open-source contributors with commits in this release, including:

-   [@&#8203;ABWassim](https://github.com/ABWassim)
-   [@&#8203;JoeNorth](https://github.com/JoeNorth)
-   [@&#8203;allenmunC1](https://github.com/allenmunC1)
-   [@&#8203;asapekia](https://github.com/asapekia)
-   [@&#8203;jeremycampbell](https://github.com/jeremycampbell)
-   [@&#8203;jkroepke](https://github.com/jkroepke)
-   [@&#8203;jsoref](https://github.com/jsoref)
-   [@&#8203;lauraseidler](https://github.com/lauraseidler)
-   [@&#8203;pevidex](https://github.com/pevidex)
-   [@&#8203;phillebaba](https://github.com/phillebaba)
-   [@&#8203;snorwin](https://github.com/snorwin)
-   [@&#8203;tanujd11](https://github.com/tanujd11)
-   [@&#8203;tberreis](https://github.com/tberreis)
-   [@&#8203;vinny](https://github.com/vinny)

Thanks also to the following cert-manager maintainers for their contributions during this release:

-   [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish)
-   [@&#8203;SpectralHiss](https://github.com/SpectralHiss)
-   [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot)
-   [@&#8203;hawksight](https://github.com/hawksight)
-   [@&#8203;inteon](https://github.com/inteon)
-   [@&#8203;maelvls](https://github.com/maelvls)
-   [@&#8203;wallrj](https://github.com/wallrj)

Equally thanks to everyone who provided feedback, helped users and raised issues on GitHub and Slack and joined our meetings!

Thanks also to the [CNCF](https://www.cncf.io/), which provides resources and support, and to the AWS open source team for being good community members and for their maintenance of the [PrivateCA Issuer](https://github.com/cert-manager/aws-privateca-issuer).

In addition, massive thanks to [Venafi](https://www.venafi.com/) for contributing developer time and resources towards the continued maintenance of cert-manager projects.

##### Changes

##### Feature

-   ACME challenge solver Pod for HTTP01 will get a default annotation of `"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"`. You can provide an annotation of `"cluster-autoscaler.kubernetes.io/safe-to-evict": "false"` in your `podTemplate` if you don't like this. ([#&#8203;6349](cert-manager/cert-manager#6349), [@&#8203;jsoref](https://github.com/jsoref))
-   Added a clock skew detector liveness probe that will force a restart in case we detect a skew between the internal monotonic clock and the system clock of more than 5 minutes.
    Also, the controller's liveness probe is now enabled by default. ([#&#8203;6328](cert-manager/cert-manager#6328), [@&#8203;inteon](https://github.com/inteon))
-   Added a new flag (--dynamic-serving-leaf-duration) that can adjust the lifetime of the dynamic leaf certificates ([#&#8203;6552](cert-manager/cert-manager#6552), [@&#8203;allenmunC1](https://github.com/allenmunC1))
-   Added support for `otherName` SANS in Certificates ([#&#8203;6404](cert-manager/cert-manager#6404), [@&#8203;SpectralHiss](https://github.com/SpectralHiss))
-   Added the option to specify the  X.509 v3 Authority Information Accessors extension CA Issuers URLs for certificates issued by the CA issuer. ([#&#8203;6486](cert-manager/cert-manager#6486), [@&#8203;jeremycampbell](https://github.com/jeremycampbell-okta))
-   Adds cert-manager's new core infrastructure initiative badge! See more details on https://www.bestpractices.dev/projects/8079 ([#&#8203;6497](cert-manager/cert-manager#6497), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   All Pods are now configured with `readOnlyRootFilesystem` by default. ([#&#8203;6453](cert-manager/cert-manager#6453), [@&#8203;wallrj](https://github.com/wallrj))
-   MAYBE BREAKING: The startupapicheck job is now handled by an entirely new container called "startupapicheck". This replaces the previous ctl container. If you run in an environment in which images cannot be pulled, be sure to include the new container. ([#&#8203;6549](cert-manager/cert-manager#6549), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   New option `.spec.keystores.pkcs12.algorithms` to specify encryption and MAC algorithms for PKCS[#&#8203;12](cert-manager/cert-manager#12) keystores. Fixes issues [#&#8203;5957](cert-manager/cert-manager#5957) and [#&#8203;6523](cert-manager/cert-manager#6523). ([#&#8203;6548](cert-manager/cert-manager#6548), [@&#8203;snorwin](https://github.com/snorwin))
-   The ACME HTTP01 solver Pod is now configured with `readOnlyRootFilesystem: true` ([#&#8203;6462](cert-manager/cert-manager#6462), [@&#8203;wallrj](https://github.com/wallrj))
-   Updates the AWS SDK for Go to 1.48.7 to support Amazon EKS Pod Identity ([#&#8203;6519](cert-manager/cert-manager#6519), [@&#8203;JoeNorth](https://github.com/JoeNorth))
-   Users can now use name constraints in CA certificates. To know more details on name constraints check out RFC section https://datatracker.ietf.org/doc/html/rfc5280#section-4.2.1.10 ([#&#8203;6500](cert-manager/cert-manager#6500), [@&#8203;tanujd11](https://github.com/tanujd11))
-   ⚠️ potentially breaking ⚠️: The KeyUsage and BasicConstraints extensions will now be encoded as critical in the CertificateRequest's CSR blob. ([#&#8203;6053](cert-manager/cert-manager#6053), [@&#8203;inteon](https://github.com/inteon))
-   Add TLS support to the metrics endpoint through either a certificate file or through dynamically issued certificates ([#&#8203;6574](cert-manager/cert-manager#6574), [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot))
-   Helm Chart: allow changing the default Deployment `revisionHistoryLimit` ([#&#8203;6248](cert-manager/cert-manager#6248), [@&#8203;tberreis](https://github.com/tberreis))
-   Security: Limit the size of the response body read from HTTP requests by cert-manager. ([#&#8203;6619](cert-manager/cert-manager#6619), [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot))
-   Support custom `spec.namespaceSelector` for webhooks ([#&#8203;6638](cert-manager/cert-manager#6638), [@&#8203;jkroepke](https://github.com/jkroepke))

##### Bug or Regression

-   BUGFIX\[helm]: Fix issue where webhook feature gates were only set if controller feature gates are set. ([#&#8203;6380](cert-manager/cert-manager#6380), [@&#8203;asapekia](https://github.com/asapekia))
-   Controller ConfigMap is now created only if `.Values.config` is set. ([#&#8203;6357](cert-manager/cert-manager#6357), [@&#8203;ABWassim](https://github.com/ABWassim))
-   Fix runaway bug caused by multiple Certificate resources that point to the same Secret resource. ([#&#8203;6406](cert-manager/cert-manager#6406), [@&#8203;inteon](https://github.com/inteon))
-   Fix(helm): templating of required value in controller and webhook ConfigMap resources ([#&#8203;6435](cert-manager/cert-manager#6435), [@&#8203;ABWassim](https://github.com/ABWassim))
-   Fixed a webhook validation error message when the key algorithm was invalid. ([#&#8203;6571](cert-manager/cert-manager#6571), [@&#8203;pevidex](https://github.com/pevidex))
-   Fixed error messaging when setting up vault issuer ([#&#8203;6433](cert-manager/cert-manager#6433), [@&#8203;vinny](https://github.com/vinny-sabatini))
-   `GHSA-vgf6-pvf4-34rq`: The webhook server now returns HTTP error 413 (Content Too Large) for requests with body size `>= 3MiB`. This is to mitigate DoS attacks that attempt to crash the webhook process by sending large requests that exceed the available memory.
    The webhook server now returns HTTP error 400 (Bad Request) if the request contains an empty body.
    The webhook server now returns HTTP error 500 (Internal Server Error) rather than crashing, if the code panics while handling a request. ([#&#8203;6498](cert-manager/cert-manager#6498), [@&#8203;inteon](https://github.com/inteon))
-   Increase the default webhook timeout to its maximum value of 30 seconds, so that the underlying timeout error message has more chance of being returned to the end user. ([#&#8203;6488](cert-manager/cert-manager#6488), [@&#8203;wallrj](https://github.com/wallrj))
-   Listeners that do not support TLS on Gateway resources will now not raise `BadConfig` warnings anymore ([#&#8203;6347](cert-manager/cert-manager#6347), [@&#8203;lauraseidler](https://github.com/lauraseidler))
-   Mitigate potential Slowloris attacks by setting `ReadHeaderTimeout` in all `http.Server` instances ([#&#8203;6534](cert-manager/cert-manager#6534), [@&#8203;wallrj](https://github.com/wallrj))
-   The Venafi issuer now properly resets the certificate and should no longer get stuck with `WebSDK CertRequest Module Requested Certificate` or `This certificate cannot be processed while it is in an error state. Fix any errors, and then click Retry.`. ([#&#8203;6398](cert-manager/cert-manager#6398), [@&#8203;maelvls](https://github.com/maelvls))
-   Update experimental install and uninstall commands to have flag parity with the rest of the CLI ([#&#8203;6562](cert-manager/cert-manager#6562), [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot))
-   Webhook ConfigMap if now created only if `.Values.webhook.config` is set. ([#&#8203;6360](cert-manager/cert-manager#6360), [@&#8203;ABWassim](https://github.com/ABWassim))
-   BUGFIX: Ensure `otherName` SAN changes in Certificate resources trigger re-issuance. ([#&#8203;6620](cert-manager/cert-manager#6620), [@&#8203;SpectralHiss](https://github.com/SpectralHiss))
-   Bugfix: Publish the `startupapicheck` image to `quay.io` ([#&#8203;6609](cert-manager/cert-manager#6609), [@&#8203;wallrj](https://github.com/wallrj))

##### Other (Cleanup or Flake)

-   Cert-manager is now built with Go 1.21.5 ([#&#8203;6545](cert-manager/cert-manager#6545), [@&#8203;wallrj](https://github.com/wallrj))
-   Bump Go to `1.21.3` to address `CVE-2023-39325`. Also bumps base images. ([#&#8203;6410](cert-manager/cert-manager#6410), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   Bump `golang.org/x/net v0.15.0 => v0.17.0` as part of addressing `CVE-2023-44487` / `CVE-2023-39325` ([#&#8203;6427](cert-manager/cert-manager#6427), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   Check code for unintended use of `crypto/md5`, a weak cryptographic primitive; using `golangci-lint` / `gosec` (G501). ([#&#8203;6581](cert-manager/cert-manager#6581), [@&#8203;wallrj](https://github.com/wallrj))
-   Check code for unintended use of `crypto/sha1`, a weak cryptographic primitive; using `golangci-lint` / `gosec` (G505). ([#&#8203;6579](cert-manager/cert-manager#6579), [@&#8203;wallrj](https://github.com/wallrj))
-   Check code for unintended use of weak random number generator (`math/rand` instead of `crypto/rand`); using `golangci-lint` / `gosec` (G404). ([#&#8203;6582](cert-manager/cert-manager#6582), [@&#8203;wallrj](https://github.com/wallrj))
-   Cleanup: Restrict MutatingWebhookConfiguration to only CertificateRequest resources ([#&#8203;6311](cert-manager/cert-manager#6311), [@&#8203;hawksight](https://github.com/hawksight))
-   Deprecated `pkg/util.RandStringRunes` and `pkg/controller/test.RandStringBytes`. Use `k8s.io/apimachinery/pkg/util/rand.String` instead. ([#&#8203;6585](cert-manager/cert-manager#6585), [@&#8203;wallrj](https://github.com/wallrj))
-   Enabled verbose logging in startupapicheck by default, so that if it fails, users can know exactly what caused the failure. ([#&#8203;6495](cert-manager/cert-manager#6495), [@&#8203;wallrj](https://github.com/wallrj))
-   Fix gosec G601: Implicit memory aliasing of items from a range statement ([#&#8203;6551](cert-manager/cert-manager#6551), [@&#8203;wallrj](https://github.com/wallrj))
-   Fix handling of serial numbers in literal certificate subjects. Previously a serial number could be specified in `subject.serialNumber` while using a literal certificate subject. This was a mistake and has been fixed. ([#&#8203;6533](cert-manager/cert-manager#6533), [@&#8203;inteon](https://github.com/inteon))
-   The end-to-end tests can now test the cert-manager Vault Issuer on an OpenShift cluster. ([#&#8203;6391](cert-manager/cert-manager#6391), [@&#8203;wallrj](https://github.com/wallrj))
-   Update cert-manager's distroless base images from Debian 11 to Debian 12. This should have no practical effects on users. ([#&#8203;6583](cert-manager/cert-manager#6583), [@&#8203;inteon](https://github.com/inteon))
-   Updated all code using GatewayAPI to use the now GA v1 APIs ([#&#8203;6559](cert-manager/cert-manager#6559), [@&#8203;ThatsMrTalbot](https://github.com/ThatsMrTalbot))
-   Upgrade Go from 1.20.7 to 1.20.8. ([#&#8203;6369](cert-manager/cert-manager#6369), [@&#8203;inteon](https://github.com/inteon))
-   Upgrade `github.com/emicklei/go-restful/v3` to `v3.11.0` because `v3.10.2` is labeled as "DO NOT USE". ([#&#8203;6366](cert-manager/cert-manager#6366), [@&#8203;inteon](https://github.com/inteon))
-   Use the new generic `sets.Set` type in place of the deprecated `sets.String`. ([#&#8203;6586](cert-manager/cert-manager#6586), [@&#8203;wallrj](https://github.com/wallrj))
-   cert-manager is now built with Go `v1.21.6` ([#&#8203;6628](cert-manager/cert-manager#6628), [@&#8203;SgtCoDFish](https://github.com/SgtCoDFish))
-   Update the Azure SDK and remove deprecated `autorest` dependency ([#&#8203;5452](cert-manager/cert-manager#5452), [@&#8203;phillebaba](https://github.com/phillebaba))
-   The cert-manager E2E tests can now be run on Kubernetes 1.29 ([#&#8203;6641](cert-manager/cert-manager#6641), [@&#8203;wallrj](https://github.com/wallrj))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNjUuMCIsInVwZGF0ZWRJblZlciI6IjM3LjE2NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Reviewed-on: https://git.home/nrdufour/home-ops/pulls/358
Co-authored-by: Renovate <renovate@ptinem.io>
Co-committed-by: Renovate <renovate@ptinem.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/api Indicates a PR directly modifies the 'pkg/apis' directory area/deploy Indicates a PR modifies deployment configuration dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. ok-to-test release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants