Skip to content

AzureKeyVault Integration not working #248

Open
@david-fischer

Description

@david-fischer

I would like to integrate my self-hosted kafka-connector with Azure Keyvault via your secret provider.

Setup

I installed the plugin in the Dockerfile I am using.

FROM confluentinc/cp-kafka-connect:7.6.0 
# ...
RUN confluent-hub install --no-prompt confluentinc/csid-secrets-provider-azure:latest
# ...

In the docker-compose I now set:

  connect: 
     # ...
        CONNECT_CONFIG_PROVIDERS: keyVault
        CONNECT_CONFIG_PROVIDERS_KEYVAULT_CLASS: io.confluent.csid.config.provider.azure.KeyVaultConfigProvider
        CONNECT_CONFIG_PROVIDERS_KEYVAULT_PARAM_VAULT_URL: ${KEY_VAULT_URL}
        CONNECT_CONFIG_PROVIDERS_KEYVAULT_PARAM_CREDENTIAL_TYPE: ClientSecret
        CONNECT_CONFIG_PROVIDERS_KEYVAULT_PARAM_CLIENT_SECRET: ${KEY_VAULT_CLIENT_SECRET}
        CONNECT_CONFIG_PROVIDERS_KEYVAULT_PARAM_TENANT_ID: ${KEY_VAULT_TENANT_ID}
        CONNECT_CONFIG_PROVIDERS_KEYVAULT_PARAM_CLIENT_ID: ${KEY_VAULT_CLIENT_ID}

(I also tried ...KEY_VAULT... but this also did not work)

and in the respective config file (minimal working example):

{
  "config": {
    "connector.class": "org.apache.kafka.connect.file.FileStreamSinkConnector",
    "file": "/home/appuser/${keyVault:test-secret:test_key}.txt",
    "tasks.max": "1",
    "topics": "connect-test"
  },
  "name": "file_sink_local"
}

Problem

The${keyVault:test-secret:test_key} part is never resolved and a file is created with the literal name ${keyVaulttest-secrettest_key}.txt is created.
No error is thrown and I did not notice a warning or info that the Azure Key Vault Config Provider encountered an issue in the logs.

Troubleshooting

  • I tried my credentials to the Azure Keyvault with a Python script and was able to obtain the secret.
  • I did not even see requests for the secret from my connector in the logs of the KeyVault
  • docker compose logs connect | grep KeyVault gave following result:
connect  | [2024-03-14 17:54:16,644] INFO Added plugin 'io.confluent.csid.config.provider.azure.KeyVaultConfigProvider' (org.apache.kafka.connec
t.runtime.isolation.DelegatingClassLoader)
connect  | [2024-03-14 17:54:16,650] INFO Added alias 'KeyVault' to plugin 'io.confluent.csid.config.provider.azure.KeyVaultConfigProvider' (org
.apache.kafka.connect.runtime.isolation.DelegatingClassLoader)
connect  | [2024-03-14 17:54:16,651] INFO Added alias 'KeyVaultConfigProvider' to plugin 'io.confluent.csid.config.provider.azure.KeyVaultConfig
Provider' (org.apache.kafka.connect.runtime.isolation.DelegatingClassLoader)
  • I read here that the config provider needs to be available in the CLASSPATH so I added a symlink:
ln -s  \
     /usr/share/confluent-hub-components/confluentinc-csid-secrets-provider-azure/lib/  \
     /usr/share/java/kafka/csid-secrets-provider-azure

Do you have an idea why this is not working? I would appreciate any input!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions