Setting Up Authentication for Kafka
You can set up authentication and SSL to improve security between BusinessEvents and Kafka broker.
You must configure Kafka broker and Kafka client (BusinessEvents) for authentication.
- Procedure
- Configure the Kafka broker for a security protocol that you require for authentication, for example
SASL_PLAIN
.For more details about the steps involved for configuring a Kafka broker for a security protocol (JAAS configuration, JVM parameter, and server properties), refer to the Kafka documentation at https://kafka.apache.org/documentation/#security. - Start ZooKeeper and Kafka broker.
- In BusinessEvents studio, configure the Kafka channel fields for security (Security Protocol and
Security Mechanism).
For more details, see Kafka and Kafka Streams Channel Configuration Properties.For example,
SASL_PLAINTEXT
is selected as the value of Security Protocol andPLAIN
is selected as the value of Security Mechanism fields respectively. - Open the BusinessEvents default JAAS configuration file (BE_HOME\mm\config\jaas-config.config) for editing.
Note: If you want to use your own JAAS configuration file (for example,
kafka_client_jaas.config
) specify its location in thejava.security.auth.login.config
CDD property. For example:<property name="java.security.auth.login.config" value="D:/kafka_client_jaas.config"/>
- Configure the
KafkaClient
section in the JAAS configuration file. Specify the login module based on the Security Mechanism selected in the Kafka channel properties (see Kafka and Kafka Streams Channel Configuration Properties).You can configure theKafkaClient
using the following login modules for authentication:org.apache.kafka.common.security.plain.PlainLoginModule
- SpecifyPlainLoginModule
forPLAIN
SASL security mechanism when you want to send plain text (non-encrypted) password for authentication. Specify your user name and non-encrypted password in the section.com.tibco.cep.driver.kafka.security.BEPlainLoginModule
- SpecifyBEPlainLoginModule
forPLAIN
SASL security mechanism when you want to send your encrypted password for authentication. Specify your user name and encrypted password in the section. You can usestudio-tools
utility to encrypt the password, see Generating Encrypted Passwords.com.sun.security.auth.module.Krb5LoginModule
- SpecifyKrb5LoginModule
forGSSAPI
(Kerberos) SASL security mechanism.org.apache.kafka.common.security.scram.ScramLoginModule
- SpecifyScramLoginModule
forSCRAM-SHA-256
andSCRAM-SHA-512
SASL security mechanisms.
For more information on the setting configuring JAAS file for Kafka clients, refer to the Kafka documentation at https://kafka.apache.org/documentation/#security.
For example, see the following sample configuration of theKafkaClient
section for thePLAIN
SASL security mechanism and to send encrypted password:KafkaClient { com.tibco.cep.driver.kafka.security.BEPlainLoginModule required //BEPlainLoginModule is a wrapper over Kafka's PlainLoginModule with added support of TIBCO encrypted passwords. username=admin password="#!8McplDveXbBUsDBnPWzGvAfwlNhVIYS/"; };
- Save the JAAS configuration file and start BusinessEvents engine (producer and consumer).
Kafka Broker Configuration
Kafka Client (BusinessEvents) Configuration