Skip to main content

Kafka Writer Initial Setup

Before you configure Kafka Writer, prepare the connection profiles, authentication credentials, encryption settings, and Schema Registry connectivity required to reach your Kafka cluster.

Review before you start

If you landed here directly, review these sections before creating the Kafka Writer application:

  • Key Concepts, because the steps below assume familiarity with Kafka topics, partitions, consumer groups, schema registries, and connection profiles.

  • Writing to AWS MSK, because Amazon MSK uses different broker addresses, authentication types, and setup steps than a self-managed Kafka cluster or Confluent Cloud.

  • Using the Striim Vault, because certificate-based authentication methods (Mutual TLS, SASL over SSL) require certificates and keys to be uploaded to the Vault before you configure a connection profile.

  • Connecting to Schema Registry, because the Avro Formatter and schema evolution depend on a Schema Registry connection profile being set up before you create the Kafka Writer application.

  • Required ACLs, because your Kafka administrator must grant these permissions to the Striim service account before Striim can connect.

  • Kafka Connection Profile Properties, for the full list of connection profile properties referenced throughout the steps below.

Supported Authentication Methods

Before configuring a connection profile, confirm your Kafka cluster and Schema Registry support one of the following authentication methods. Each is covered in detail in the setup steps below.

Kafka connection profiles support the following authentication methods:

Confluent Schema Registry connection profiles support the following authentication methods:

Setting up Connection Encryption

Striim allows a secure communication channel between Striim and the Kafka broker using encryption only, without any form of client authentication. This mode ensures data confidentiality over the network but does not enforce identity verification of the client. For Amazon MSK-specific guidance, see Setting up Connection Encryption under Writing to AWS MSK.

This configuration is suitable when:

  • The data that is sent needs to be encrypted.

  • The Kafka broker does not require authenticating the client (e.g., test environments or internal trusted networks).

  • The Kafka broker is configured to allow one-way SSL.

Configure the Kafka Connection Profile with the following SSL-only settings:

Property Name

Value

Authentication Type

Choose NONE

Use SSL

True

Use Certificate

True (recommended) or False

CA Certificate

Path to PEM file (if Use Certificate is true)

SSL Truststore Location

Path to truststore file (if Use Certificate is false)

SSL Truststore Password

Password for truststore (if Use Certificate is false and truststore is password protected)

Note

To add encryption to SASL-based authentication, enable Use SSL in addition to configuring the JAAS Config for your chosen SASL mechanism. See Using SASL Authentication for details.

Using the Striim Vault

To securely reference configurations in a Kafka Connection Profile, you can store certificates and keys in the Vault.

Step 1: Create a New Vault

If you do not already have a vault, create one in Manage Striim → Vault.

Step 2: Upload Certificate Files

Upload the following files as FILE type in the vault:

  • CA Certificate File

  • SSL KeyStore Key

  • SSL KeyStore Certificate

Step 3: Configure the Kafka Connection Profile

Reference the uploaded Vault entries by entering the appropriate vault name and key names in the Kafka Connection Profile fields.

Connecting to Schema Registry

Setting up Connection to Confluent Schema Registry

Supported Authentication Mechanisms

  • Basic

  • Confluent Cloud API

  • Mutual TLS

  • None

Using SASL Authentication

Confluent Cloud API

Confluent Cloud API Keys are credentials used to authenticate clients connecting to Confluent Cloud services. Schema Registry in Confluent Cloud uses HTTPS and Basic Auth (API key/secret).

Prerequisites:

  • A Confluent Cloud Kafka Cluster.

  • An API Key and Secret. Create one via: Confluent Cloud Console > Clusters > Choose the Cluster > on the left, click Schema Registry > click API Access in the top-right > click Create Key.

Configure the Schema Registry Connection Profile:

Property Name

Value

Schema Registry URL

Your Confluent Cloud Schema Registry endpoint

Authentication Type

Confluent Cloud API

API Key

Your Schema Registry API Key

API Secret

Your Schema Registry API Secret

Use SSL

True

Basic Authentication

Basic authentication means clients authenticate with Schema Registry using a username and password, sent as a Base64-encoded string in the HTTP Authorization header.

Note

Basic authentication is not supported on the Confluent Cloud Schema Registry.

Configure the Schema Registry Connection Profile:

Property Name

Value

Authentication Type

Basic

Username

Your Schema Registry username

Password

Your Schema Registry password

Using Mutual TLS

Mutual TLS (mTLS) requires both the Schema Registry server and the client to present certificates. For steps to generate certificates, see Using Mutual TLS under Setting up Connection to Kafka.

For local (self-managed) Schema Registry deployment, configure the schema-registry.properties:

listeners=https://0.0.0.0:8081
ssl.client.auth=required
ssl.keystore.location=/path/to/server.keystore.jks
ssl.keystore.password=changeit
ssl.key.password=changeit
ssl.truststore.location=/path/to/server.truststore.jks
ssl.truststore.password=changeit

Note

Mutual TLS is currently not supported for the Confluent Cloud Schema Registry.

Configure the Schema Registry Connection Profile with mTLS settings:

Property Name

Value

Authentication Type

Mutual TLS

Use SSL

True

Use Certificate

True (recommended) or False

CA Certificate

Path to CA PEM file (if Use Certificate is true)

SSL Key Store Certificate Chain

PEM-formatted client certificate chain (if Use Certificate is true)

SSL Key Store Key

PEM-formatted private key (if Use Certificate is true)

SSL Key Password

Password if the private key is encrypted

SSL Key Store Location

Path to keystore file (if Use Certificate is false)

SSL Key Store Password

Keystore password (if Use Certificate is false)

Setting up Connection to Karapace Schema Registry

Karapace is an open-source schema registry that is API-compatible with the Confluent Schema Registry API. It is commonly used with self-managed Apache Kafka deployments and with Aiven for Apache Kafka.

Important: Karapace is currently supported via direct URL configuration only. Kafka Writer does not support a Connection Profile for Karapace; instead, configure the schemaregistryurl and, if authentication is required, schemaregistryConfiguration properties directly in the AvroFormatter.

Registry

Connection Method

Supported Authentication

Confluent Schema Registry

Connection Profile (recommended) or direct URL

Confluent Cloud API, Basic, Mutual TLS, None

Karapace

Direct URL only (no Connection Profile)

Basic, None

Example — Karapace with Basic authentication:

FORMAT USING Global.AvroFormatter (
  schemaregistryurl: 'https://karapace.example.com:8081',
  schemaregistryConfiguration: 'basic.auth.user.info=username:password,basic.auth.credentials.source=USER_INFO',
  formatAs: 'Native',
  SchemaRegistrySubjectName: 'UseTopicName' )

Example — Aiven for Apache Kafka (Karapace):

FORMAT USING Global.AvroFormatter (
  schemaregistryurl: 'https://kafka-xxxxx.aivencloud.com:28139',
  schemaregistryConfiguration: 'basic.auth.user.info=avnadmin:your-password,basic.auth.credentials.source=USER_INFO',
  formatAs: 'Native',
  SchemaRegistrySubjectName: 'UseTopicName' )

Setting up Connection to Kafka

Required ACLs

The following Kafka ACLs are required by the Striim Kafka Writer service account. If you are connecting to Amazon MSK, see the IAM-based Required ACLs under Writing to AWS MSK instead:

Required Condition

Topic ACLs

Cluster ACLs

Transactional ID ACLs

Additional Notes

Always

For Data Topics: WRITE, DESCRIBE (DESCRIBE is implicitly derived from WRITE)

DESCRIBE_CONFIGS

When AutoCreateTopic=true

DESCRIBE_CONFIGS

CREATE

When E1P=true

For Checkpoint Topic: READ, DESCRIBE, DESCRIBE_CONFIG, WRITE, DELETE

IDEMPOTENT_WRITE (only required for Kafka versions less than 2.8)

WRITE, DESCRIBE

Default Checkpoint Topic Format: <namespace>.TARGET.<componentName>_CHECKPOINT. Default Transactional ID Format: <namespace>.TARGET.<componentName>_<Current_Timestamp> (use a prefix-based pattern because the timestamp portion is dynamically generated).

Supported Authentication Mechanisms

  • AWS_MSK_IAM

  • GSSAPI

  • Mutual TLS

  • None

  • PLAIN

  • SCRAM_SHA_256

  • SCRAM_SHA_512

Using SASL Authentication

Kafka supports several SASL-based authentication mechanisms. All require specifying a JAAS configuration string in the Kafka Connection Profile.

SASL/PLAIN

SASL/PLAIN is a simple authentication mechanism that sends the username and password (base64-encoded). It is the simplest SASL method but requires SSL/TLS for security over the network.

Configure the Kafka Connection Profile with PLAIN authentication:

Property Name

Value

Authentication Type

PLAIN

Use SSL

True (recommended --- required when connecting to Confluent Cloud)

Use Certificate

True (recommended) or False

CA Certificate

Path to PEM file (if Use Certificate is true)

SSL Truststore Location

Path to truststore file (if Use Certificate is false)

SSL Truststore Password

Truststore password (if applicable)

JAAS Config

See format below

JAAS Config string format:

org.apache.kafka.common.security.plain.PlainLoginModule required
username="<username>"
password="<password>";

Replace <username> and <password> with valid credentials configured on the Kafka broker.

Note

Store the JAAS Config in the Striim Vault and reference the vault key in the JAAS Config property for security.

For Confluent Cloud Kafka, use the API Key as the username and API Secret as the password:

Property Name

Value

Broker Address

pkc-xxxxx.us-central1.gcp.confluent.cloud:9092

Authentication Type

PLAIN

Use SSL

True (always required for Confluent Cloud)

JAAS Config

org.apache.kafka.common.security.plain.PlainLoginModule required username="<<API_KEY>>" password="<<API_SECRET>>";

SASL/GSSAPI (Kerberos)

SASL/GSSAPI uses Kerberos for authentication --- an enterprise-grade, ticket-based authentication protocol. It provides strong security without sending passwords over the network.

JAAS Config string format:

com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
storeKey=true
keyTab="/etc/security/keytabs/kafka-client.keytab"
principal="kafka-client@EXAMPLE.COM";

Replace the keyTab and principal values with your actual client keytab path and Kerberos principal.

SASL/SCRAM-SHA-256

SASL/SCRAM-SHA-256 (Salted Challenge Response Authentication Mechanism) is a secure password-based authentication that does not send passwords over the network. It is more secure than SASL/PLAIN and simpler than Kerberos.

JAAS Config string format:

org.apache.kafka.common.security.scram.ScramLoginModule required
username="<username>"
password="<password>";

Replace <username> and <password> with valid credentials configured on the Kafka broker.

SASL/SCRAM-SHA-512

SASL/SCRAM-SHA-512 is identical to SCRAM-SHA-256 but uses the SHA-512 hashing algorithm, providing stronger cryptographic security with longer hash outputs.

JAAS Config string format:

org.apache.kafka.common.security.scram.ScramLoginModule required
username="<username>"
password="<password>";

Replace <username> and <password> with valid credentials configured on the Kafka broker.

Combining SASL with SSL Encryption

Kafka supports combining SASL-based authentication with SSL/TLS encryption to ensure both secure identity verification and encrypted communication. Enable the Use SSL toggle along with any SASL mechanism (PLAIN, SCRAM_SHA_256, SCRAM_SHA_512, or GSSAPI).

Property Name

Value

Authentication Type

PLAIN, SCRAM_SHA_256, SCRAM_SHA_512, or GSSAPI

Use SSL

True

Use Certificate

True (recommended) or False

CA Certificate

Path to PEM file (if Use Certificate is true)

SSL Truststore Location

Path to truststore file (if Use Certificate is false)

SSL Truststore Password

Truststore password (if applicable)

JAAS Config

Specify based on the SASL mechanism used

Note

Store the JAAS Config and CA Certificate in the Striim Vault and reference vault keys in the respective properties.

Using Mutual TLS

Striim supports seamless certificate rotation to maintain secure communication. New server and client certificate pairs can be generated and applied to a Kafka Connection Profile even while applications using the profile are running.

Configure Self-Managed Kafka with mTLS

Step 1: Create a Certificate Authority (CA)

# Generate CA private key
openssl genrsa -aes256 -out ca-key.pem 4096
# Create self-signed CA certificate
openssl req -x509 -new -key ca-key.pem -sha256 -days 1826 -out ca-cert.pem

Step 2: Create and sign a Server Certificate

openssl genpkey -algorithm RSA -out server.key -aes256
openssl req -new -key server.key -out server.csr -config server.conf
openssl x509 -req -in server.csr -CA ca-cert.pem -CAkey ca-key.pem -CAcreateserial \
-out server.crt -days 825 -sha256 -extfile server.ext

Step 3: Create Server Keystore and Truststore

# Keystore
openssl pkcs12 -export -in server.crt -inkey server.key -certfile ca-cert.pem \
-out server.keystore.p12 -name kafka-server
keytool -importkeystore -deststorepass <pass> -destkeypass <pass> \
-destkeystore server.keystore.jks -srckeystore server.keystore.p12 \
-srcstoretype PKCS12 -srcstorepass <p12-pass> -alias kafka-server
# Truststore
keytool -import -alias myCA -file ca-cert.pem -keystore server.truststore.jks

Step 4: Configure Kafka Broker for mTLS (server.properties):

listeners=SSL://localhost:9093
ssl.keystore.location=/path/to/kafka.server.keystore.jks
ssl.keystore.password=serverpass
ssl.key.password=serverkeypass
ssl.truststore.location=/path/to/kafka.server.truststore.jks
ssl.truststore.password=truststorepass
ssl.client.auth=required

Step 5: Create a Client Certificate for Striim and configure the Kafka Connection Profile:

openssl genpkey -algorithm RSA -out client.key -aes256
openssl req -new -key client.key -out client.csr
openssl x509 -req -in client.csr -CA ca-cert.pem -CAkey ca-key.pem \
-CAcreateserial -out client.crt -days 365 -sha256

Property Name

Value

Authentication Type

Mutual TLS

Use SSL

True

Use Certificate

True (recommended for PEM-based files) or False (for JKS keystore/truststore)

CA Certificate

Path to ca-cert.pem (if Use Certificate is true)

SSL Keystore Certificate Chain

Path to client.crt (if Use Certificate is true)

SSL Keystore Key

Path to client.key (if Use Certificate is true)

SSL Key Password

Private key password if encrypted

SSL Keystore Location

Path to client.keystore.jks (if Use Certificate is false)

SSL Keystore Password

Keystore password (if Use Certificate is false)

SSL Truststore Location

Path to client.truststore.jks (if Use Certificate is false)

SSL Truststore Password

Truststore password (if Use Certificate is false)

Note

For Striim SaaS deployments, generate the CA Certificate, SSL Keystore Certificate Chain, and SSL Keystore Key on an external machine, upload them to the Vault, and configure them in the Connection Profile properties.

Rotating Certificates

Rotated certificates are used by adapters when the adapter encounters an exception and retries, or on application restart. To rotate certificates:

  1. Navigate to Manage Striim → Connection Profiles.

  2. Locate the connection profile in use and click Edit.

  3. Upload or reference the new certificate and key files.

  4. Save the changes to apply the new certificates.

Configure Confluent Cloud Cluster with mTLS

Prerequisites:

  • A Confluent Cloud user with OrganizationAdmin role binding.

  • A Confluent Cloud cluster of type Dedicated.

Steps:

  1. Upload your CA certificate to Confluent Cloud: navigate to Account & access → Workload identities → Add provider → Certificate Authority. Upload your ca-cert.pem file.

  2. Create an Identity Pool within the Workload identities section.

  3. Define Certificate Mapping Rules using Confluent's CEL (Common Expression Language) syntax, for example: CN == "STRIIM"

  4. Generate the client certificate for Striim and configure the Connection Profile as described above (Use Certificate = True), uploading files to the Vault.

Writing to AWS MSK

Amazon MSK (Managed Streaming for Apache Kafka) is a fully managed service for Apache Kafka. Striim Kafka Writer supports connecting to MSK using three authentication types: None (plaintext), SCRAM-SHA-512, and AWS_MSK_IAM.

Setting up Connection Encryption

See Setting up Connection Encryption for the general self-managed Kafka walkthrough. AWS MSK recommends enabling TLS encryption for data in transit. Set Use SSL to True in the Kafka Connection Profile when connecting to MSK.

Note

SCRAM-SHA-512 and AWS_MSK_IAM authentication types require SSL to be enabled.

Using the Striim Vault

See Using the Striim Vault for general Striim Vault instructions. The same steps apply when storing MSK certificates.

Connecting to Schema Registry

Kafka Writer does not currently support the AWS Glue Schema Registry. When writing to Amazon MSK with the Avro Formatter, connect to a Confluent Schema Registry or a Karapace registry — the connection steps are the same regardless of whether the Kafka cluster is self-managed, Confluent, or Amazon MSK. See Connecting to Schema Registry above.

Setting up Connection to AWS MSK

Prerequisites:

  • MSK Cluster: Provisioned and running.

  • Bootstrap Server URL: Available in the AWS MSK Console under cluster details (navigate to Amazon MSK → Clusters → Choose the cluster → View Client Information).

  • Appropriate IAM permissions or SCRAM credentials configured.

Required ACLs

These are the AWS IAM-based equivalents of the Required ACLs for self-managed Kafka. The IAM policies required depend on whether E1P (exactly-once processing) or A1P (at-least-once processing) is used.

IAM Policy for KafkaWriter with E1P:

{
"Version": "<versionNo>",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"kafka:GetBootstrapBrokers",
"kafka:ListTopics",
"kafka:DescribeTopic",
"kafka:DescribeTopicPartitions"
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"kafka-cluster:DeleteGroup",
"kafka-cluster:WriteDataIdempotently",
"kafka-cluster:DescribeCluster",
"kafka-cluster:ReadData",
"kafka-cluster:DescribeTransactionalId",
"kafka-cluster:AlterTransactionalId",
"kafka-cluster:DescribeTopicDynamicConfiguration",
"kafka-cluster:AlterTopicDynamicConfiguration",
"kafka-cluster:AlterGroup",
"kafka-cluster:AlterClusterDynamicConfiguration",
"kafka-cluster:AlterTopic",
"kafka-cluster:CreateTopic",
"kafka-cluster:DescribeTopic",
"kafka-cluster:AlterCluster",
"kafka-cluster:DescribeGroup",
"kafka-cluster:DescribeClusterDynamicConfiguration",
"kafka-cluster:Connect",
"kafka-cluster:DeleteTopic",
"kafka-cluster:WriteData"
],
"Resource": [
"arn:aws:kafka:*:{AWS_ACCOUNT_ID}:transactional-id/*/*/*",
"arn:aws:kafka:*:{AWS_ACCOUNT_ID}:cluster/*/*",
"arn:aws:kafka:*:{AWS_ACCOUNT_ID}:topic/*/*/*",
"arn:aws:kafka:*:{AWS_ACCOUNT_ID}:group/*/*/*"
]
}
]
}

IAM Policy for KafkaWriter with A1P (at-least-once processing):

{
"Version": "<versionNo>",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"kafka:GetBootstrapBrokers",
"kafka:ListTopics",
"kafka:DescribeTopic",
"kafka:DescribeTopicPartitions"
],
"Resource": "*"
},
{
"Sid": "VisualEditor1",
"Effect": "Allow",
"Action": [
"kafka-cluster:DeleteGroup",
"kafka-cluster:DescribeCluster",
"kafka-cluster:ReadData",
"kafka-cluster:DescribeTopicDynamicConfiguration",
"kafka-cluster:AlterTopicDynamicConfiguration",
"kafka-cluster:AlterGroup",
"kafka-cluster:AlterClusterDynamicConfiguration",
"kafka-cluster:AlterTopic",
"kafka-cluster:CreateTopic",
"kafka-cluster:DescribeTopic",
"kafka-cluster:AlterCluster",
"kafka-cluster:DescribeGroup",
"kafka-cluster:DescribeClusterDynamicConfiguration",
"kafka-cluster:Connect",
"kafka-cluster:DeleteTopic",
"kafka-cluster:WriteData"
],
"Resource": [
"arn:aws:kafka:*:{AWS_ACCOUNT_ID}:cluster/*/*",
"arn:aws:kafka:*:{AWS_ACCOUNT_ID}:topic/*/*/*",
"arn:aws:kafka:*:{AWS_ACCOUNT_ID}:group/*/*/*"
]
}
]
}

Connecting with None Authentication Type (plaintext):

Property Name

Value

Broker Address

Use the non-TLS plaintext port. Example: b-1.msk-cluster-xxxx.c10.kafka.us-east-1.amazonaws.com:9092

Authentication Type

NONE

Use SSL

True (recommended --- AWS MSK recommends enabling TLS encryption for data in transit)

Connecting with SCRAM-SHA-512 Authentication:

Note

SCRAM-SHA-256 is not supported on AWS MSK; use SCRAM-SHA-512 instead.

Property Name

Value

Broker Address

Use the TLS-enabled port. Example: b-1.msk-cluster-xxxx.c10.kafka.us-east-1.amazonaws.com:9196

Authentication Type

SCRAM-SHA-512

Use SSL

True (required --- SASL/SCRAM authentication requires an encrypted connection)

JAAS Config

org.apache.kafka.common.security.scram.ScramLoginModule required username="<<MSK_USERNAME>>" password="<<MSK_PASSWORD>>"; Replace with credentials provisioned via AWS Secrets Manager.

Connecting with AWS_MSK_IAM Authentication:

Property Name

Value

Broker Address

Use the IAM-enabled port. Example: b-1.msk-cluster-xxxx.c10.kafka.us-east-1.amazonaws.com:9198

Authentication Type

AWS_MSK_IAM

Use SSL

True

JAAS Config

Default: software.amazon.msk.auth.iam.IAMLoginModule required; To use a specific AWS profile: software.amazon.msk.auth.iam.IAMLoginModule required awsProfileName="my-profile";