Skip to main content
Gateway to Kafka security Gateway depends on a ‘backing’ Kafka cluster for its operation. Configuring the Gateway connection to the backing Kafka cluster closely resembles configuring a standard Kafka client’s connection to a cluster. Set the client to Gateway configuration variables first. Gateway has to know which security mode you run, because that determines whether it reuses each client’s credentials to reach Kafka or connects with its own service account. The configuration is done via environment variables, as it is for the other aspects of a Gateway configuration. All environment variables that start with KAFKA_ are mapped to configuration properties for connecting Gateway to the Kafka cluster. As Gateway is based on the Java-based Kafka-clients, it supports all configuration properties that Java-clients do. Kafka configuration properties are mapped to Gateway environment variables as follows:
  • Add a KAFKA_ prefix
  • Replace each dot, . , with an underscore, _
  • Convert to uppercase
For example, bootstrap.servers is set by the KAFKA_BOOTSTRAP_SERVERS environment variable.

Supported protocols

You can use all the Kafka security protocols to authenticate Gateway to the Kafka cluster; PLAINTEXT, SASL_PLAINTEXT, SASL_SSL and SSL. These can be used with all SASL mechanisms supported by Apache Kafka: PLAIN, SCRAM-SHA, OAuthBearer, Kerberos etc. In addition, we support IAM authentication for AWS MSK clusters. In the following examples, we provide blocks of environment variables which can be provided to Gateway, e.g. in a docker-compose file, or a helm deployment. Information which should be customized is enclosed by < and >.

PLAINTEXT

Kafka cluster without authentication or encryption in transit, PLAINTEXT. In this case you just need the bootstrap servers:

SSL

mTLS

Kafka cluster with mTLS client authentication.

SASL_PLAINTEXT

Kafka cluster with SASL_PLAINTEXT security protocol but no encryption in transit, supporting the following SASL_MECHANISMs.

SASL PLAIN

SASL SCRAM

OAuthBearer (client secret)

SASL_SSL

Kafka cluster that uses SASL for authentication and TLS (formerly SSL) for encryption in transit.

PLAIN

Kafka cluster with SASL_SSL and PLAIN SASL mechanism.

Confluent Cloud with API key/secret

This example can be seen as a special case of the above.
As Confluent Cloud uses certificates signed by a well-known CA, you normally do not need to specify a trust-store.

SASL SCRAM

SASL GSSAPI (Kerberos)

OAuthBearer (client secret)

OAuthBearer (client assertion)

Rather than a shared client secret, the Gateway can authenticate to the Kafka cluster with a signed JWT assertion (KIP-1258).
The private key file has to be added to the allowed.files list via JAVA_OPTS:

AWS MSK cluster with IAM

Service account and ACL requirements

Gateway connects to the backing Kafka with its own service account. What else that account needs depends on the security mode you run:
  • In Kafka-managed mode, clients present their own credentials and Gateway reuses them to reach Kafka, so each client inherits the ACLs of its own service account on the backing cluster
  • In Gateway-managed mode, Gateway reaches Kafka with its own service account for every client, so that account also needs every permission your Gateway users rely on
In both modes, Gateway’s own service account needs these ACLs to operate correctly:
  • Read, Write and DescribeConfigs on Gateway’s internal topics, which default to the _conduktor_${GATEWAY_CLUSTER_ID}_ prefix
  • Create on those topics, or on the cluster, unless you pre-create them all with cleanup.policy=compact on the state topics
  • Read on the conduktor_${GATEWAY_CLUSTER_ID} consumer group, or on the group set in GATEWAY_GROUP_ID
  • Describe on the physical topics behind alias topics and topic views
  • Write and Create on the topics Gateway writes its own records to: the audit log, the observability Interceptor (chargeback) topic, and the violation and dead letter topics of your data validation policies
With topic concentration, it also needs:
  • Describe and DescribeConfigs on the physical topics, plus Create and AlterConfigs for auto-managed rules
  • DescribeConfigs on the cluster, if clients create concentrated topics without a partition count
  • Read on the physical topics behind rules that still set the deprecated offsetCorrectness, and a prefixed Read ACL on consumer group conduktor_${GATEWAY_CLUSTER_ID}-logical-offsets-, or ${GATEWAY_GROUP_ID}-logical-offsets- when you set that variable