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

[Bug]: Wrong creation of intermediate CA certificate with max_path_length = 0 #2257

Open
vaerh opened this issue Jun 5, 2024 · 0 comments
Open
Labels

Comments

@vaerh
Copy link
Contributor

vaerh commented Jun 5, 2024

Terraform Core Version

1.6.4

Terraform Vault Provider Version

4.2.0

Vault Server Version

1.16.2

Affected Resource(s)

resource "vault_pki_secret_backend_root_sign_intermediate"

Expected Behavior

When the max_path_length = 0 attribute is specified, the certificate is expected to contain the following restriction:

X509v3 Basic Constraints: critical
    CA:TRUE, pathlen:0

Actual Behavior

X509v3 Basic Constraints: critical
    CA:TRUE

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

# https://developer.hashicorp.com/vault/tutorials/secrets-management/pki-engine#step-2-generate-intermediate-ca

resource "vault_pki_secret_backend_root_sign_intermediate" "intermediate" {
  backend         = vault_mount.pki.path
  common_name     = "Intermediate CA"
  csr             = vault_pki_secret_backend_intermediate_cert_request.csr-request.csr
  format          = "pem_bundle"
  ttl             = local.ttl_1y
  issuer_ref      = vault_pki_secret_backend_root_cert.root-ca.issuer_name
  max_path_length = 0
}

Steps to Reproduce

terraform apply

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

#2060
#2253

Would you like to implement a fix?

Yes

@vaerh vaerh added the bug label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant