Core: Add support for HashiCorp Vault KMS client - #16075
Conversation
a988363 to
7e97bf6
Compare
fe0aed2 to
a896b32
Compare
d0d8db7 to
c458222
Compare
c458222 to
6bc3124
Compare
|
I think we should talk on the dev list about adding a new project and supporting a new KMS client. |
a96a6d5 to
a4ff3a3
Compare
|
tysm @ebyhr for picking this up. I will test this KMS implementation against our staging env on Monday and get back to you if I spot anything. |
caushie-akamai
left a comment
There was a problem hiding this comment.
I tried reproducing this today with the following steps:
- Build jar
./gradlew build :iceberg-hashicorp:build -DsparkVersions=3.5 -x test -x integrationTest -x revapi --parallel - Copy iceberg jar + hashicorp jar into spark
- Spawn spark-sql shell with vault configuration
But i am getting a java.lang.NoClassDefFoundError: org/apache/hc/core5/http/HttpEntity
Should we also shade http jars in here or would it be better to change the imports to the shaded version? WDYT
|
|
||
| String configuredVaultToken = newProperties.get(VaultProperties.VAULT_TOKEN_PROP); | ||
| appRoleId = newProperties.get(VaultProperties.VAULT_ROLE_ID_PROP); | ||
| appSecretId = newProperties.get(VaultProperties.VAULT_SECRET_ID_PROP); |
There was a problem hiding this comment.
What are your thoughts about using an env var instead of explicitly specifying secretID in the config?
I believe this would be beneficial for folks who use spark-operator in k8s and would not like sensitive credentials to live in the spark config.
Internally we also grab the secretID from an environment variable to avoid this.
There was a problem hiding this comment.
Environment variables don't align well with Trino's catalog-based architecture, because in theory the value can differ per catalog (even if that's not practical). I've added support for both properties and environment variables.
There was a problem hiding this comment.
sounds good to me, this way we are supporting both query engines.
| if (httpClient == null) { | ||
| synchronized (this) { | ||
| if (httpClient == null) { | ||
| httpClient = HttpClients.createDefault(); |
There was a problem hiding this comment.
WDYT about also allowing clients to configure SSL config in the http client? There may be folks who do a mTLS vault deployment or who need to trust their vault deployment's CA.
I believe the bettercloud vault had a similar solution: https://github.com/BetterCloud/vault-java-driver/blob/master/src/main/java/com/bettercloud/vault/SslConfig.java#L44
I am trying to find if such a thing is also possible with the apache http client
There was a problem hiding this comment.
Adding TLS support with the Apache HTTP client is straightforward. However, I'd like to keep the initial PR focused. Can we add TLS support in a follow-up?
44744c4 to
446bbee
Compare
|
@caushie-akamai I've added the following lines to iceberg-hashicorp project in build.gradle: Could you please confirm whether the NoClassDefFoundError issue has been resolved? |
|
TYSM @ebyhr , i'll try to test this against staging tomorrow morning and get back to you |
|
@ebyhr I tested this again today, I still see the error |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
446bbee to
957d9e4
Compare
957d9e4 to
05343ab
Compare
|
I was on PTO the last 3 weeks, saw you pushed some changes. will test these this week |
|
@ebyhr I took a stab at this today, and i still see the IMO this should be fine as we are not introducing any 3rd party dependency wdyt? After that I tried testing the integration with vault but I was facing constantly certificate issues.
I then added the CA in the truststore and keystore but that also didn't help. I'll try to do a deeper dive on this tomorrow as well. What are your thoughts moving forward? |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
Co-Authored-By: Endi Caushi <42871239+mrendi29@users.noreply.github.com>
05343ab to
c8f4bdd
Compare
Restores #14451 with additional changes:
hashicorptoencryption.kms-typehashicorp/vaultdocker imageMailing list: https://lists.apache.org/thread/1269w5pzoy723sr1c6xxq8jg02zcf3on
Fixes #14437