-
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
Add full CA Chain to /pki/cert/ca_chain response #13935
Conversation
This allows callers to get the full chain (including issuing certificates) from a call to /cert/ca_chain. Previously, most endpoints (including during issuance) do not include the root authority, requiring an explicit call to /cert/ca to fetch. This allows full chains to be constructed without without needing multiple calls to the API. Resolves: #13489 Signed-off-by: Alexander Scheel <[email protected]>
We test three main scenarios: 1. A root-only CA's `/cert/ca_chain`'s `.data.ca_chain` field should contain only the root, 2. An intermediate CA (with root provide) should contain both the root and the intermediate. 3. An external (e.g., `/config/ca`-provided) CA with both root and intermediate should contain both certs. Signed-off-by: Alexander Scheel <[email protected]>
Signed-off-by: Alexander Scheel <[email protected]>
Signed-off-by: Alexander Scheel <[email protected]>
a971f57
to
fa29083
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually approving this time. Looks good to me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks great 👍
I would just like to see an update to the "Read CA Certificate Chain" api docs to mention if they want the full CA Certificate chain it is available within the "Read Certificate" api with the ca_chain parameter...
Signed-off-by: Alexander Scheel <[email protected]>
Thanks @stevendpclark, I've added a note -- let me know if that seems right? |
Thanks all for the reviews! Going ahead and merging. :-) |
* Include full chain in /cert/ca_chain response This allows callers to get the full chain (including issuing certificates) from a call to /cert/ca_chain. Previously, most endpoints (including during issuance) do not include the root authority, requiring an explicit call to /cert/ca to fetch. This allows full chains to be constructed without without needing multiple calls to the API. Resolves: #13489 Signed-off-by: Alexander Scheel <[email protected]> * Add test case for full CA issuance We test three main scenarios: 1. A root-only CA's `/cert/ca_chain`'s `.data.ca_chain` field should contain only the root, 2. An intermediate CA (with root provide) should contain both the root and the intermediate. 3. An external (e.g., `/config/ca`-provided) CA with both root and intermediate should contain both certs. Signed-off-by: Alexander Scheel <[email protected]> * Add documentation for new ca_chain field Signed-off-by: Alexander Scheel <[email protected]> * Add changelog entry Signed-off-by: Alexander Scheel <[email protected]> * Add note about where to find the entire chain Signed-off-by: Alexander Scheel <[email protected]>
As mentioned in #13489, calls to read
/pki/cert/ca_chain
would return a partial chain, excluding the root authority. By adding a new field,ca_chain
to the response, we can include the entire chain without breaking backwards compatibility.We test three main scenarios:
/cert/ca_chain
's.data.ca_chain
field should contain only the root,/config/ca
-provided) CA with both root and intermediate should contain both certs.n.b.: I think the existing note around
ca_chain
in the documentation is wrong, hence its removal.Additional note: this is only the full chain as known to Vault. If the entire (from a TLS client's PoV) chain wasn't provided during either
/intermediate/set-signed
or/config/ca
, Vault wouldn't know the entire chain and thus couldn't provided. That'd be an enhancement for the future.