8000 Vault issues expired certificates with leaf_not_after_behavior truncate · Issue #30621 · hashicorp/vault · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Vault issues expired certificates with leaf_not_after_behavior truncate #30621

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

Open
andy-d2019 opened this issue May 14, 2025 · 0 comments
Open
Labels
bug Used to indicate a potential bug secret/pki

Comments

@andy-d2019
Copy link

Describe the bug
Vault issues expired certificates when the leaf_not_after_behavior is set to truncate and the default issuer in a pki has expired.

To Reproduce
Steps to reproduce the behavior:

  1. Setup a vault pki with a given default issuer
  2. Let the default Issuer expire
  3. Request a certificate from the default issuer

This bug can be easily replicated with the following setup:

id=$(kubectl exec vault-0 -i -- vault list -format json pki/issuers | jq -r '.[0]') kubectl exec vault-0 -i -- vault write pki/issuer/$id leaf_not_after_behavior=truncate

With the err behavior, Vault errors because the cert's NotAfter goes beyond the issuer's. This prevents Vault from issuing when the CA has expired.

With truncate, Vault copies the NotAfter e.g.:

min(cert's NotAfter, CA's NotAfter)

Which leads to Vault issuing expired certificates.

Expected behavior
Vault should not issue expired certificates with the truncate leaf_not_after_behavior.

Environment:

  • Vault Server Version: 1.17.2
  • Vault CLI Version: 1.17.2
  • Server Operating System/Architecture: Kubernetes

Additional context
This issue lead to a problem with cert-manager for us: cert-manager/cert-manager#7741
But the original root cause seems to be in vault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Used to indicate a potential bug secret/pki
Projects
None yet
Development

No branches or pull requests

2 participants
0