Skip to content

Upgrade to Pebble v2.7.0 - #7771

Merged
cert-manager-prow[bot] merged 15 commits into
cert-manager:masterfrom
wallrj:upgrade-letsencrypt-pebble
Jun 3, 2025
Merged

cert-manager-prow[bot] merged 15 commits into
cert-manager:masterfrom
wallrj:upgrade-letsencrypt-pebble

Conversation

@wallrj

@wallrj wallrj commented Jun 1, 2025 •

Copy link
Copy Markdown
Member

The main reason that I'm upgrading Pebble to v2.7.0 is so that I can test ACME profiles in #7752.

We were using a very old version (letsencrypt/pebble@ba5f81d) from 2022, and there have been many changes in Pebble since then which break the cert-manager E2E tests.

Which is why this PR includes the following changes to the verifications and assertions in the E2E tests:

// Requested key usages and extended key usages.
// These usages are used to set the `usages` field on the created CertificateRequest
// resources. If `encodeUsagesInRequest` is unset or set to `true`, the usages
// will additionally be encoded in the `request` field which contains the CSR blob.
//
// If unset, defaults to `digital signature` and `key encipherment`.
// +optional
Usages []KeyUsage `json:"usages,omitempty"`

The back story is that @inteon had originally tried to upgrade Pebble in #6287, but found that it broke many of the ACME tests.

One thing that broke was that the new Pebble did not accept Ed255519 signatures,
so @inteon create a PR for Pebble, and switched cert-manager to use his fork of Pebble:

The cert-manager Ed255519 ACME conformance tests passed, because the old version of Pebble lacks strict CSR signature checks.

See https://github.com/letsencrypt/pebble/releases/tag/v2.7.0

(cherry picked from commit c9dabe0)

ACME E2E Tests: Upgraded Pebble to v2.7.0 and modified the ACME tests to match latest Pebble behaviour.

@cert-manager-prow

ghost commented Jun 1, 2025

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@cert-manager-prow cert-manager-prow Bot added release-note-none Denotes a PR that doesn't merit a release note. 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. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 1, 2025
@wallrj

ghost commented Jun 1, 2025

Copy link
Copy Markdown
Member Author

/test pull-cert-manager-master-e2e-v1-32

@cert-manager-prow cert-manager-prow Bot added area/testing Issues relating to testing size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 1, 2025
@wallrj

ghost commented Jun 1, 2025

Copy link
Copy Markdown
Member Author

/test pull-cert-manager-master-e2e-v1-32

@wallrj
wallrj force-pushed the upgrade-letsencrypt-pebble branch from 8c58860 to 2450a00 Compare June 1, 2025 08:49
@wallrj

ghost commented Jun 1, 2025

Copy link
Copy Markdown
Member Author

/test pull-cert-manager-master-e2e-v1-32

@wallrj
wallrj force-pushed the upgrade-letsencrypt-pebble branch from 2450a00 to c836ead Compare June 1, 2025 11:12
@cert-manager-prow cert-manager-prow Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 1, 2025
@wallrj
wallrj force-pushed the upgrade-letsencrypt-pebble branch from c836ead to 12356d5 Compare June 1, 2025 11:17
Richard Wall added 7 commits June 1, 2025 12:20
Pebble drops the CN since letsencrypt/pebble#420
Support may be added back in letsencrypt/pebble#491

Signed-off-by: Richard Wall <[email protected]>
(cherry picked from commit 487a54f)
This test is identical to an earlier test called:
> should obtain a signed certificate with a single CN from the ACME server

...which we are skipping now anyway, because Pebble drops the CN

Signed-off-by: Richard Wall <[email protected]>
(cherry picked from commit 3239a9a)
Pebble drops the CN

Signed-off-by: Richard Wall <[email protected]>
(cherry picked from commit 31b436a)
It drops any other KUs that are in the CSR.
Make sure that Digital Signature is the only KU we request so that the
CSR and the signed certificate match during the verification at the end of the test.

- letsencrypt/pebble#472
- https://github.com/letsencrypt/pebble/releases/tag/v2.7.0

Signed-off-by: Richard Wall <[email protected]>
(cherry picked from commit 62f4c81)
It drops the CN:
- letsencrypt/pebble#420

And it drops any other KUs that are in the CSR.
Make sure that Digital Signature is the only KU we request so that the
CSR and the signed certificate match during the verification at the end of the test.

- letsencrypt/pebble#472
- https://github.com/letsencrypt/pebble/releases/tag/v2.7.0

Signed-off-by: Richard Wall <[email protected]>
(cherry picked from commit 0c50492)
@wallrj
wallrj force-pushed the upgrade-letsencrypt-pebble branch from 12356d5 to 13794f3 Compare June 1, 2025 11:21
@wallrj
wallrj marked this pull request as ready for review June 1, 2025 11:21
@cert-manager-prow cert-manager-prow Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 1, 2025
@wallrj

ghost commented Jun 1, 2025

Copy link
Copy Markdown
Member Author

/kind cleanup

@cert-manager-prow cert-manager-prow Bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Jun 1, 2025
@cert-manager-prow cert-manager-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed needs-kind Indicates a PR lacks a `kind/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. labels Jun 1, 2025
@wallrj
wallrj requested a review from Copilot June 1, 2025 11:23

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Upgrades the embedded Pebble ACME test server to v2.7.0 and adapts the E2E and conformance tests to match Pebble’s stricter CSR and certificate behaviors.

  • Replace base64-encoded EAB keys with raw secrets and update the Pebble configmap.
  • Change PEBBLE_COMMIT to the official v2.7.0 tag and correct download URL.
  • Add explicit SetCertificateRequestKeyUsages(v1.UsageDigitalSignature) and adjust defaultKeyUsagesToAdd logic; skip tests that relied on dropped CN values.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/e2e/suite/issuers/acme/issuer.go Removed base64 encoding, switched to raw key bytes for EAB.
test/e2e/suite/issuers/acme/certificaterequest/http01.go Skipped CN tests; added digitalSignature usage to all requests.
test/e2e/suite/issuers/acme/certificaterequest/dns01.go Added digitalSignature usage; removed CSR commonName parameters.
test/e2e/suite/conformance/certificatesigningrequests/acme/acme.go Switched EAB secret key to raw string.
test/e2e/suite/conformance/certificates/acme/acme.go Switched EAB secret key to raw string.
test/e2e/framework/helper/certificates.go Updated default EXT key usages: only serverAuth for ACME.
make/e2e-setup.mk Updated PEBBLE_COMMIT to v2.7.0 and corrected download URL.
make/config/pebble/chart/templates/configmap.yaml Updated externalAccountMACKeys to use the new raw HMAC key.

Comment thread make/e2e-setup.mk Resolved
Richard Wall added 2 commits June 2, 2025 20:06
Signed-off-by: Richard Wall <[email protected]>
(cherry picked from commit 833433d)
…h Pebble

Signed-off-by: Richard Wall <[email protected]>
(cherry picked from commit f4f21a7)
@wallrj
wallrj requested a review from inteon June 2, 2025 21:31
Signed-off-by: Richard Wall <[email protected]>
@cert-manager-prow cert-manager-prow Bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 3, 2025
Richard Wall added 2 commits June 3, 2025 13:40
Because the test helpers now handle these special ACME / Pebble special cases

Signed-off-by: Richard Wall <[email protected]>
…of Key Encipherment KU for ECDSA keys

Signed-off-by: Richard Wall <[email protected]>
@wallrj
wallrj requested a review from Copilot June 3, 2025 13:17

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

Upgrades the embedded Pebble test server to v2.7.0 (from an older fork) and adjusts ACME E2E tests and helper logic to match Pebble’s updated behavior.

  • Switch EAB secrets to use raw 256-bit keys instead of base64 encoding
  • Refactor certificate request validation to compute expected key usages per issuer
  • Update Makefiles and configmap to point at the new Pebble commit and matching MAC key

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/e2e/suite/issuers/acme/issuer.go Use raw key bytes for EAB secret
test/e2e/suite/conformance/certificatesigningrequests/acme/** Replace base64-encoded EAB key with raw 256-bit key
test/e2e/suite/conformance/certificates/tests.go Skip CommonName assertion when CN feature unsupported
test/e2e/suite/conformance/certificates/acme/acme.go Use raw key bytes for EAB secret
test/e2e/framework/helper/validation/validation.go Conditionally include CN validation based on feature flags
test/e2e/framework/helper/certificates.go Remove legacy key-usage helper functions
test/e2e/framework/helper/certificaterequests.go Introduce computeExpectedKeyUsages and refactor CSR validation logic
make/e2e-setup.mk Point PEBBLE_COMMIT to new fork supporting Ed25519, update comments
make/config/pebble/chart/templates/configmap.yaml Align externalAccountMACKeys with test secret key
Comments suppressed due to low confidence (1)

make/e2e-setup.mk:412

  • [nitpick] The comments refer both to “@inteon's fork” and “Tim's fork” of Pebble in the same file. Consider using a single consistent reference for clarity.
# We are using Tim's fork of Pebble, which adds support for signing CSRs with

@inteon

ghost commented Jun 3, 2025

Copy link
Copy Markdown
Member

This is clearly an area that deserves a bit more attention.
Thanks @wallrj for initiating this effort and putting us in a good place to keep improving our ACME issuer.
/approve
/lgtm

@cert-manager-prow cert-manager-prow Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2025
@cert-manager-prow

ghost commented Jun 3, 2025

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: inteon

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

The pull request process is described here

Details 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

@cert-manager-prow cert-manager-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 3, 2025
@cert-manager-prow
cert-manager-prow Bot merged commit 12b010e into cert-manager:master Jun 3, 2025
@wallrj
wallrj deleted the upgrade-letsencrypt-pebble branch June 3, 2025 14:23
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/testing Issues relating to testing dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants