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 Clean up unused CRL entries when issuer is removed into release/1.13.x #23029

Conversation

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

Backport

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

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@cipherboy
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/vault/merges: 409 Merge conflict []

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


When a issuer is removed, the space utilized by its CRL was not freed, both from the CRL config mapping issuer IDs to CRL IDs and from the CRL storage entry. We thus implement a two step cleanup, wherein orphaned CRL IDs are removed from the config and any remaining full CRL entries are removed from disk.

This relates to a Consul<->Vault interop issue (#22980), wherein Consul creates a new issuer on every leadership election, causing this config to grow. Deleting issuers manually does not entirely solve this problem as the config does not fully reclaim space used in this entry.

Notably, an observation that when deleting issuers, the CRL was rebuilt on secondary clusters (due to the invalidation not caring about type of the operation); for consistency and to clean up the unified CRLs, we also need to run the rebuild on the active primary cluster that deleted the issuer as well.

This approach does allow cleanup on existing impacted clusters by simply rebuilding the CRL.


TODO:

  • Tests

Overview of commits

@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/cipherboy-fix-crl-removal/locally-profound-mongoose branch from 91c9e1e to 6efff0a Compare September 12, 2023 21:00
@hc-github-team-secure-vault-core hc-github-team-secure-vault-core force-pushed the backport/cipherboy-fix-crl-removal/locally-profound-mongoose branch from 6efff0a to 91c9e1e Compare September 12, 2023 21:01
@hashicorp-cla
Copy link

hashicorp-cla commented Sep 12, 2023

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 Sep 12, 2023
@cipherboy cipherboy self-assigned this Sep 12, 2023
@github-actions
Copy link

CI Results:
All Go tests succeeded! ✅

Co-authored-by: Alexander Scheel <alex.scheel@hashicorp.com>
Co-authored-by: Steven Clark <steven.clark@hashicorp.com>
@cipherboy cipherboy marked this pull request as ready for review September 13, 2023 12:50
@cipherboy cipherboy force-pushed the backport/cipherboy-fix-crl-removal/locally-profound-mongoose branch from d7be90b to 8d12609 Compare September 13, 2023 12:51
@cipherboy cipherboy requested a review from a team as a code owner September 13, 2023 12:51
Signed-off-by: Alexander Scheel <alex.scheel@hashicorp.com>
@github-actions
Copy link

github-actions bot commented Sep 13, 2023

Build Results:
All builds succeeded! ✅

@cipherboy cipherboy enabled auto-merge (squash) September 13, 2023 13:51
@cipherboy cipherboy merged commit c4a31da into release/1.13.x Sep 13, 2023
@cipherboy cipherboy deleted the backport/cipherboy-fix-crl-removal/locally-profound-mongoose branch September 13, 2023 13:57
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.

4 participants