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

Backport of Sort CA chain into root and intermediates on VerifyCertificate. into release/1.18.x #29256

Conversation

hc-github-team-secure-vault-core
Copy link
Collaborator

@hc-github-team-secure-vault-core hc-github-team-secure-vault-core commented Dec 23, 2024

Backport

This PR is auto-generated from #29255 to be assessed for backporting due to the inclusion of the label backport/1.18.x.

The below text is copied from the body of the original PR.


Description

In order for the Certificate.Verify method to work correctly, the certificates in the CA chain need to be sorted into separate root and intermediate certificate pools.

Add unit tests to verify that name constraints in both the root and intermediate certificates are checked.

TODO only if you're a HashiCorp employee

  • Backport Labels: If this fix needs to be backported, use the appropriate backport/ label that matches the desired release branch. Note that in the CE repo, the latest release branch will look like backport/x.x.x, but older release branches will be backport/ent/x.x.x+ent.
    • LTS: If this fixes a critical security vulnerability or severity 1 bug, it will also need to be backported to the current LTS versions of Vault. To ensure this, use all available enterprise labels.
  • ENT Breakage: If this PR either 1) removes a public function OR 2) changes the signature
    of a public function, even if that change is in a CE file, double check that
    applying the patch for this PR to the ENT repo and running tests doesn't
    break any tests. Sometimes ENT only tests rely on public functions in CE
    files.
  • Jira: If this change has an associated Jira, it's referenced either
    in the PR description, commit message, or branch name.
  • RFC: If this change has an associated RFC, please link it in the description.
  • ENT PR: If this change has an associated ENT PR, please link it in the
    description. Also, make sure the changelog is in this PR, not in your ENT PR.

Overview of commits

Copy link

hashicorp-cla-app bot commented Dec 23, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label Dec 23, 2024
Copy link

github-actions bot commented Dec 23, 2024

CI Results:
All Go tests succeeded! ✅

@victorr victorr force-pushed the backport/victorr/vault-33182-chained-cert-name-constraints/ideally-eminent-dinosaur branch from b747c90 to af91977 Compare December 23, 2024 20:01
@victorr victorr added this to the 1.18.4 milestone Dec 23, 2024
victorr
victorr previously approved these changes Dec 23, 2024
Copy link
Contributor

@victorr victorr left a comment

Choose a reason for hiding this comment

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

Conflicts merged manually.

@victorr victorr marked this pull request as ready for review December 23, 2024 20:05
@victorr victorr requested a review from a team as a code owner December 23, 2024 20:05
@victorr victorr enabled auto-merge (squash) December 23, 2024 20:05
Copy link

github-actions bot commented Dec 23, 2024

Build Results:
All builds succeeded! ✅

sgmiller
sgmiller previously approved these changes Dec 26, 2024
@kitography kitography dismissed stale reviews from sgmiller and victorr via c52ea83 January 3, 2025 22:23
victorr and others added 2 commits January 3, 2025 17:25
Sort CA chain into root and intermediates on VerifyCertificate.

In order for the Certificate.Verify method to work correctly, the certificates
in the CA chain need to be sorted into separate root and intermediate
certificate pools.

Add unit tests to verify that name constraints in both the root and intermediate
certificates are checked.
This replaces the code that generates a certificate with that extension
with a pregenerated (100year+ ttl) certificate with the extension.
@kitography kitography force-pushed the backport/victorr/vault-33182-chained-cert-name-constraints/ideally-eminent-dinosaur branch from c52ea83 to 1199797 Compare January 3, 2025 22:25
Copy link
Contributor

@stevendpclark stevendpclark left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this with the instructions on regenerating!

@victorr victorr merged commit 2dcd893 into release/1.18.x Jan 6, 2025
83 checks passed
@victorr victorr deleted the backport/victorr/vault-33182-chained-cert-name-constraints/ideally-eminent-dinosaur branch January 6, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants