-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[pip][design] PIP 289: Secure Pulsar Connector Configuration #20903
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
[pip][design] PIP 289: Secure Pulsar Connector Configuration #20903
Conversation
|
On the three problems you mentioned:
@FieldDoc(
defaultValue = "",
help = "Config properties to pass to the kafka connector."
sensitiveNames="password-1, password-2"
)
private Map<String, String> kafkaConnectorConfigProperties;My point is to avoid introducing complicated configurations for users to understand. Thanks. |
It's possible, but it would likely require a change/expansion to the way the
I already proposed this as part of the PIP here: #20902.
The Kafka Config is the real reason for this PIP. We need arbitrary interpolation because the Kafka Config works as a wrapper. For example, it is possible to configure it with any connector that works with Kafka. See https://github.com/datastax/pulsar-3rdparty-connector for many third party connectors that are simply plugged into the Kafka Adapter Connector without any additional work. Since it is a wrapper, it is not possible to annotate the relevant fields with a custom Pulsar annotation ( |
|
Hi, @michaeljmarshall. Thanks for your explanation. I got it. I think we can avoid adding a new config: What's the problem with us calling the method by default? Only when the user uses placeholders will it merge secrets to the config map, right? This way we just need to explain to the user that we provide a new more general way to set secrets. |
Great question, thanks @shibd. I wrote this text in the PIP explaining why I didn't want to enable it by default:
In taking a closer look, the proposed change will only affect k8s based deployments, which probably means we can enable it by default. However, the only remaining risk could be to users that have created their own extensions and are using these classes in unknown ways. Given your comments, I think we should remove the configuration option and always enable it. Let me know what you think, thanks. |
eolivelli
left a comment
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.
Lgtm
+1 (binding)
|
@shibd - I updated the text of the PIP. PTAL |
shibd
left a comment
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.
Nice work!
PIP: #20903 Relates to: #20862 ### Motivation The primary motivation is to make it possible to configure Pulsar Connectors in a secure, non-plaintext way. See the PIP for background and relevant details. The new interpolation feature only applies when deploying with functions to Kubernetes. ### Modifications * Add `SecretsProvider#interpolateSecretForValue` method with a default that maintains the current behavior. * Override `interpolateSecretForValue` in the `EnvironmentBasedSecretsProvider` so that configuration values formatted as `${my-env-var}` will be replaced with the result of `System.getEnv("my-env-var")` if the result is not `null`. * Implement a recursive string interpolation method that will replace any configuration value that the `interpolateSecretForValue` implementation determines ought to be replaced. ### Verifying this change Tests are added/modified. ### Documentation - [x] `doc-required` ### Matching PR in forked repository PR in forked repository: michaeljmarshall#55
PIP: apache#20903 Relates to: apache#20862 The primary motivation is to make it possible to configure Pulsar Connectors in a secure, non-plaintext way. See the PIP for background and relevant details. The new interpolation feature only applies when deploying with functions to Kubernetes. * Add `SecretsProvider#interpolateSecretForValue` method with a default that maintains the current behavior. * Override `interpolateSecretForValue` in the `EnvironmentBasedSecretsProvider` so that configuration values formatted as `${my-env-var}` will be replaced with the result of `System.getEnv("my-env-var")` if the result is not `null`. * Implement a recursive string interpolation method that will replace any configuration value that the `interpolateSecretForValue` implementation determines ought to be replaced. Tests are added/modified. - [x] `doc-required` PR in forked repository: michaeljmarshall#55 (cherry picked from commit bfde0de)
Fixes: #20862
Motivation
PIP for improving connector configuration security. See content for details.
Modifications
Add the design doc for PIP 289.
Current implementation PRs:
Documentation
doc