Configuring Kafka authentication

Choose how Cloudera SQL Stream Builder (SSB) authenticates to Kafka, and where to keep the credentials and certificates. The SASL mechanism and the TLS stores that you select in the Kafka data source apply to every table that uses it.

Supported methods

Table 1. Kafka authentication methods
Method Protocol Where you configure it
No authentication PLAINTEXT Protocol
TLS server authentication SSL, SASL/SSL Kafka TrustStore
TLS client authentication (mutual TLS) SSL, SASL/SSL Kafka KeyStore (Optional)
PLAIN SASL/SSL, SASL/PLAINTEXT SASL Username and SASL Password
SCRAM-SHA-256, SCRAM-SHA-512 SASL/SSL, SASL/PLAINTEXT SASL Username and SASL Password
OAUTHBEARER SASL/SSL only OAuth Token Endpoint URL, Client ID, Client Secret
KERBEROS SASL/SSL, SASL/PLAINTEXT The Cloudera Base Connector, and your keytab in Manage Keytab

Obtain the credentials and certificates

Before you register the data source, collect the following items from your Kafka administrator or OAuth provider:

  • The broker endpoints. For where the Kafka cluster can run, see Kafka clusters that you can connect to.
  • For PLAIN and SCRAM, the username and password.
  • For OAUTHBEARER, the token endpoint URL, the client ID, and the client secret.
  • The certificate authority certificates of the brokers, as a truststore in the JKS, PKCS12, BCFKS, or PEM format.
  • For mutual TLS, the client keystore and its password.
  • For KERBEROS, your keytab and a connected Cloudera Base Connector.
  1. In the Streaming SQL Console, click Projects in the left navigation pane, and click the name of your project.
    The project opens, with the Explorer panel on the left. To open the Streaming SQL Console, see Accessing Cloudera SQL Stream Builder.
  2. In the Explorer, open the menu of Kafka under Data Sources, and click New Kafka Data Source.
  3. Enter the Name and the Brokers (Comma-separated List), and select the Protocol.
  4. For a SASL protocol, select the SASL Mechanism, and complete the fields.
    • For PLAIN, SCRAM-SHA-256, and SCRAM-SHA-512: enter the SASL Username and the SASL Password.
    • For OAUTHBEARER: enter the OAuth Token Endpoint URL, the Client ID, and the Client Secret. If the token endpoint uses a private certificate authority, configure the OAuth TrustStore: select Use Project File and the OAuth TrustStore Project File, or enter the OAuth TrustStore File Path, and select the OAuth TrustStore Type.
    • For KERBEROS: no credentials are needed in the data source. To run jobs that read the topics, upload your own keytab with Manage Keytab in the User menu. Jobs use the keytab of the user who runs them.
  5. For SSL and SASL/SSL, configure the truststore and, if the brokers require client authentication, the keystore.
    For the fields, see Adding a Kafka data source.
  6. Click Validate, and then click Create.

Store files and secrets

  • Upload truststore and keystore files to the project, and select them with Use Project File. For more information, see Managing project files.
  • The data source stores passwords and secrets so that the editor does not display them again. When you edit a data source, turn on Modify next to a secret to replace it.
  • In DDL, use ${ssb.project-file:[***PATH***]} to point a property at a project file. For more information, see Registering a Kafka data source with DDL.