-
Notifications
You must be signed in to change notification settings - Fork 213
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
Support Kafka SASL_SSL/SSL security protocol for self signed certificate in Kafka Consumer #4181
Conversation
…ate in Kafka Consumer Signed-off-by: Dinu John <[email protected]>
…ate in Kafka Consumer Signed-off-by: Dinu John <[email protected]>
...s/src/main/java/org/opensearch/dataprepper/plugins/kafka/configuration/EncryptionConfig.java
Outdated
Show resolved
Hide resolved
...s/src/main/java/org/opensearch/dataprepper/plugins/kafka/configuration/EncryptionConfig.java
Outdated
Show resolved
Hide resolved
...s/src/main/java/org/opensearch/dataprepper/plugins/kafka/configuration/EncryptionConfig.java
Outdated
Show resolved
Hide resolved
- Renamed the field names for certificate, truststore and password. - Removed redundant information from build.gradle Signed-off-by: Dinu John <[email protected]>
…ate in Kafka Consumer - Add the copyright block to build.gradle Signed-off-by: Dinu John <[email protected]>
properties.put(SECURITY_PROTOCOL, "SASL_SSL"); | ||
setSecurityProtocolSSLProperties(properties, encryptionConfig); | ||
} else { // EncryptionType.NONE | ||
properties.put(SECURITY_PROTOCOL, "SASL_PLAINTEXT"); | ||
} |
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.
Why switch the statements here?
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.
encryptionType
can be null, so had added checkEncryptionType
method that does null check.
I could have kept the same order with if condition if (checkEncryptionType(encryptionConfig, EncryptionType.NONE)) {
, but since we are handling addition things for SSL, I reversed the order.
@@ -83,6 +83,10 @@ public class KafkaSecurityConfigurer { | |||
private static final String REGISTRY_BASIC_AUTH_USER_INFO = "schema.registry.basic.auth.user.info"; | |||
|
|||
private static final int MAX_KAFKA_CLIENT_RETRIES = 360; // for one hour every 10 seconds | |||
private static final String SSL_ENGINE_FACTORY_CLASS = "ssl.engine.factory.class"; | |||
private static final String CERTIFICATE_CONTENT = "certificateContent"; |
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.
Is this valid name? I don't seem to find it.
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.
It's internal property that is used in CustomClientSslEngineFactory
class to get the certificate content to setup TrustManager.
Signed-off-by: Dinu John <[email protected]>
Description
Support Kafka SASL_SSL/SSL security protocol for self signed certificate in Kafka Consumer
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.