Secure secrets in Hashicorp Vault and use them in Kafka Connect.
Add the plugin to the worker classloader isolation via the plugin.path option:
plugin.path=/usr/share/connectors,/opt/secret-providers
Multiple authentication methods are support:
approle
userpass
kubernetes
cert
token
ldap
gcp
awsiam
jwt
github
https://sts.amazonaws.com
Example Worker Properties
config.providers=vault config.providers.vault.class=io.lenses.connect.secrets.providers.VaultSecretProvider config.providers.vault.param.vault.addr=http://localhost:8200 config.providers.vault.param.vault.auth.method=token config.providers.vault.param.vault.token=my-token config.providers.vault.param.file.dir=/connector-files/vault
To use this provider in a connector, reference the Hashicorp Vault containing the secret and the key name for the value of the connector property.
The indirect reference is in the form ${provider:path:key} where:
For example, if we store two secrets as keys:
in a secret called secret/my-vault-secret we would set:
name=my-sink class=my-class topics=mytopic username=${vault:secret/my-vault-secret:my_username_key} password=${vault:secret/my-vault-secret:my_password_key}
This would resolve at runtime to:
name=my-sink class=my-class topics=mytopic username=lenses password=my-secret-password
The provider handles the following types:
The provider will look for keys prefixed with:
The UTF8 means the value returned is the string retrieved for the secret key. The BASE64 means the value returned is the base64 decoded string retrieved for the secret key.
If the value for the tag is UTF8_FILE the string contents are written to a file. The returned value from the connector configuration key will be the location of the file. The file location is determined by the file.dir configuration option given to the provider via the Connect worker.properties file.
If the value for the tag is BASE64_FILE the string contents are based64 decoded and are written to a file. The returned value from the connector configuration key will be the location of the file. For example, if a connector needs a PEM file on disk set, this as the prefix as BASE64_FILE. The file location is determined by the file.dir configuration option given to the provider via the Connect worker.properties file.
If no prefix is found the contents of the secret string are returned.
On this page