Vault CA Provider does not clean up old issuers and keys in Vault #18779
Labels
theme/certificates
Related to creating, distributing, and rotating certificates in Consul
theme/consul-vault
Relating to Consul & Vault interactions
Overview of the Issue
If Consul is using Vault as CA, it does not clean up old issuers and keys when generating a new leaf-signing certificate (e.g. when a new leader is elected).
This is usually not a problem in stable clusters. Leadership change is infrequent and Consul configures its intermediate mount to auto-tidy its expired issuers (leaf-signing certificates have a default expiry time of 1 year).
However, in clusters which experience frequent leadership change, the rate at which issuers and keys are created may outpace the rate at which they expire and get auto-tidied. In one case, a user reported degraded Vault performance at 1850 issuers created by Consul's CA system.
Workaround
List all non-default issuer IDs:
Find the key ID associated with each issuer:
Delete the issuer first:
Delete the key after issuer is deleted:
The text was updated successfully, but these errors were encountered: