-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 support for Vault’s PKI secret engine #18636
Conversation
kdubb
commented
Jul 13, 2021
•
edited
Loading
edited
- Supports all endpoints of PKI secret engine, except prvileged endpoints.
- Has complete test coverage for all endpoints and options.
Sovled: Beans must be added to |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 91659ee
Full information is available in the Build summary check run. Test Failures⚙️ JVM Tests - JDK 11 #📦 integration-tests/vault✖ ⚙️ JVM Tests - JDK 16 #📦 integration-tests/vault✖ ⚙️ Native Tests - Security3 #📦 integration-tests/vault✖ |
@vsevel @sberyozkin This is complete support for Vault's PKI secret engine with complete test coverage. Can I get this reviewed and your thoughts on it? One point to note is that supporting "dynamic" engine's was a requirement, as opposed to listing them in the configuration. To facilitate this we added a default |
This is a quality contribution IMHO - I don't understand all the details but it looks like it naturally fits into the existing Quarkus Vault ecosystem of services. |
I agree with @sberyozkin. I will take a look in the next few days. |
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.
Hello @kdubb
This looks very good already.
2 main points:
- I am wondering if there is a better way to implement
VaultPKIManager
, which is used sometimes as a CDI bean (when injected directly), and sometimes as a simple java object inVaultPKIManagerFactory.engine(String)
. what do you think @sberyozkin - I agree with @sberyozkin there should be a dedicated guide either following https://www.vaultproject.io/docs/secrets/pki, https://learn.hashicorp.com/tutorials/vault/pki-engine or https://blog.revolve.team/2019/09/12/vault-pki/ (in french)
...src/main/java/io/quarkus/vault/runtime/client/secretengine/VaultInternalPKISecretEngine.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/quarkus/vault/runtime/client/secretengine/VaultInternalPKISecretEngine.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/quarkus/vault/runtime/client/secretengine/VaultInternalPKISecretEngine.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/quarkus/vault/runtime/client/secretengine/VaultInternalPKISecretEngine.java
Outdated
Show resolved
Hide resolved
...ault/model/src/main/java/io/quarkus/vault/runtime/client/dto/pki/VaultPKIRoleUpdateBody.java
Outdated
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/VaultPKISecretEngine.java
Outdated
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/VaultPKISecretEngine.java
Outdated
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/pki/ConfigCRLOptions.java
Outdated
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/pki/ConfigURLsOptions.java
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/pki/RoleOptions.java
Outdated
Show resolved
Hide resolved
@vsevel Updated with undisputed changes. |
hello @kdubb
if making progress on this PR is important to you, and if @sberyozkin has any spare time, may be you two can work together while I am away. |
As I said, I've added the format to all the methods that use an API that are format selectable. I will also add a blurb about it, along with the reasoning, to the
I am working on a guide for the documentation and am gonna try and add it in the next few days. |
hi @kdubb if the
and a
is that because you think that the client would not have the right to access this endpoint? I did some tests with the endpoint you are using In other words, if I enable the
then I execute the same call with no data I get a
and if I query again the urls, the
we are kind of lucky that it works but that is very fragile. so if the |
@vsevel The problem is only that none of Vault's methods (including Using the I guess there's an argument to be made that we only need to see if "something" is mounted and then the querying app can assume it's |
understood. but yes, I agree that checking that a named engine exists should be enough for what you are doing. if the client wrongly specified another engine such as actually if you are not using the actually I am now thinking that the |
f1f7090
to
a5e22e7
Compare
@vsevel I'm thinking all that's left is the docs we've discussed. |
@vsevel @sberyozkin I've added a PKI guide modeled after the Transit guide. Let me know what you think. I'm hoping to get this PR wrapped up soon. |
@kdubb I will take a look before the next 2 days. |
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.
hello @kdubb I like a lot your documentation. it really adds value. I also like the added services around the tuneInfo
.
I reviewed carefully the format issue (beyond the default value itself). I think there is a bit more to discuss here.
There is also a point of discussion on where to locate the enable/disable operations.
overall I think we are closing on. I am very excited with your work.
...ons/vault/model/src/main/java/io/quarkus/vault/runtime/client/dto/pki/VaultPKIConstants.java
Outdated
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/VaultPKISecretEngineFactory.java
Outdated
Show resolved
Hide resolved
33fc2bf
to
d1e9534
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.
I like how you modeled the CertificateData
.
I reviewed all methods that treated PEM encoded arguments. there are different situations.
- sometimes vault's api does not leave you the choice. may be we should use
CertificateData.PEM
for the type of the arg
it has to be pem. - sometimes it gives you the choice. in that case may be there should be an extra argument of type
DataFormat
. e.g.getCertificateRevocationList(DataFormat)
we can still keep your methods such as getCertificateRevocationList()
, and treat them as opiniated in the sense that they decide that it will be PEM
(because it is the usual case).
extensions/vault/runtime/src/main/java/io/quarkus/vault/runtime/VaultPKIManager.java
Outdated
Show resolved
Hide resolved
...src/main/java/io/quarkus/vault/runtime/client/secretengine/VaultInternalPKISecretEngine.java
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/runtime/VaultPKIManager.java
Outdated
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/VaultPKISecretEngine.java
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/VaultPKISecretEngine.java
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/VaultPKISecretEngine.java
Show resolved
Hide resolved
extensions/vault/runtime/src/main/java/io/quarkus/vault/VaultPKISecretEngine.java
Show resolved
Hide resolved
1ed5458
to
c49e57d
Compare
c49e57d
to
a00711a
Compare
@vsevel I think all of your issues that can be addressed have been. |
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building a00711a
Full information is available in the Build summary check run. Failures⚙️ Native Tests - Security3 #- Failing: integration-tests/vault-agroal
📦 integration-tests/vault-agroal✖
✖
✖
|
a00711a
to
e1cb5a2
Compare
hello @kdubb did not have time today to look at your previous changes and answers. |
I love it! it is a go for me. have you checked the generated documentation? |
e1cb5a2
to
49996de
Compare
@vsevel Squashed and rebased!
I've generated the docs locally and all seems to be good. |
@vsevel @sberyozkin @gsmet Any chance of merging this before next release? |
@sberyozkin @gsmet hope you are well. I feel confident about this PR. I will merge it early next week (which should allow it to make 2.3), unless you want to take a look, and need more time. |
@kdubb hello, can you rebase one last time, and I will merge it afterward. thanks. |
* Supports all endpoints of PKI secret engine, except prvileged endpoints. * Has complete test coverage for all endpoints and options.
49996de
to
2aefe24
Compare
@vsevel Done! |