-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
PKI: bug regarding "IP Subject Alternative Names are not allowed in this role, but was provided some via CSR" #2553
Comments
Can you provide the CSR? It would help with debugging/verification. |
Certainly. My goal with the CSR is to keep it minimal and use it only convey the public key (I didn't see another way to do so). Everything else I want in the signed cert is sent outside the CSR (in my case, I only use common_name and alt_names, not yet had a need to anything else like ip_sans). As a result I'm able to generate CSRs very simply with Go like this: Sample output:
Here's what OpenSSL thinks about this CSR:
|
The CSRs I send to Vault are minimal and do not contain IP SANs (or in fact any SANs). I hit the error in the subject after upgrading to 0.7.0 after being on 0.6.4. After looking at the code I see there's two places where this error is produced and I think I'm hitting this one:
https://github.com/hashicorp/vault/blob/v0.7.0/builtin/logical/pki/cert_util.go#L639
I'm hitting all the conditions: I am sending a CSR, the role does have CSR SANs enabled (since that's the default for this setting, and I wasn't setting it previously), and I do have IP SANs disabled for the role.
Looks like the fix is simple: something like changing the condition on line 637 to "if len(csr.IPAddresses) > 0 && !role.AllowIPSANs".
As a workaround I have disabled CSR SANs for the role which works out fine for my use case.
The text was updated successfully, but these errors were encountered: