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.14.x #23030

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.14.x.

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/unlikely-crack-maggot branch 2 times, most recently from a3aaac4 to 4bffd2a Compare September 12, 2023 21:01
@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 enabled auto-merge (squash) September 12, 2023 21:01
@cipherboy cipherboy self-assigned this Sep 12, 2023
@github-actions
Copy link

Build Results:
All builds succeeded! ✅

@cipherboy cipherboy merged commit 5c880d4 into release/1.14.x Sep 12, 2023
@cipherboy cipherboy deleted the backport/cipherboy-fix-crl-removal/unlikely-crack-maggot branch September 12, 2023 21:18
@github-actions
Copy link

CI Results:
All Go tests succeeded! ✅

cipherboy added a commit that referenced this pull request Sep 13, 2023
Co-authored-by: Alexander Scheel <[email protected]>
cipherboy added a commit that referenced this pull request Sep 13, 2023
Co-authored-by: Alexander Scheel <[email protected]>
cipherboy added a commit that referenced this pull request Sep 13, 2023
…elease/1.12.x (#23028)

* backport of commit e2ff1f1 (#23030)

Co-authored-by: Alexander Scheel <[email protected]>

* backport of commit 293e8b8 (#23045)

Co-authored-by: Steven Clark <[email protected]>

* Remove unified CRLs references from v1.12.x

Signed-off-by: Alexander Scheel <[email protected]>

---------

Signed-off-by: Alexander Scheel <[email protected]>
Co-authored-by: Alexander Scheel <[email protected]>
Co-authored-by: Steven Clark <[email protected]>
cipherboy added a commit that referenced this pull request Sep 13, 2023
…elease/1.13.x (#23029)

* backport of commit e2ff1f1 (#23030)

Co-authored-by: Alexander Scheel <[email protected]>

* backport of commit 293e8b8 (#23045)

Co-authored-by: Steven Clark <[email protected]>

* Fix call of crlBuilder.rebuild

Signed-off-by: Alexander Scheel <[email protected]>

---------

Signed-off-by: Alexander Scheel <[email protected]>
Co-authored-by: Alexander Scheel <[email protected]>
Co-authored-by: Steven Clark <[email protected]>
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.

2 participants