From 5ca0e4cd0943b36c9d169a7e32bb08d0e27b7b43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Fri, 3 Apr 2020 16:22:47 +0200 Subject: [PATCH] Enable GSSAPI authentication when Kerberos is configured (#17470) --- filebeat/input/kafka/config.go | 3 +++ libbeat/outputs/kafka/config.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/filebeat/input/kafka/config.go b/filebeat/input/kafka/config.go index 2637db1a1ea..b132a843055 100644 --- a/filebeat/input/kafka/config.go +++ b/filebeat/input/kafka/config.go @@ -182,6 +182,9 @@ func newSaramaConfig(config kafkaInputConfig) (*sarama.Config, error) { if config.Kerberos != nil { cfgwarn.Beta("Kerberos authentication for Kafka is beta.") + + k.Net.SASL.Enable = true + k.Net.SASL.Mechanism = sarama.SASLTypeGSSAPI k.Net.SASL.GSSAPI = sarama.GSSAPIConfig{ AuthType: int(config.Kerberos.AuthType), KeyTabPath: config.Kerberos.KeyTabPath, diff --git a/libbeat/outputs/kafka/config.go b/libbeat/outputs/kafka/config.go index 6e25a7afd85..d2b645f075d 100644 --- a/libbeat/outputs/kafka/config.go +++ b/libbeat/outputs/kafka/config.go @@ -218,6 +218,9 @@ func newSaramaConfig(log *logp.Logger, config *kafkaConfig) (*sarama.Config, err if config.Kerberos != nil { cfgwarn.Beta("Kerberos authentication for Kafka is beta.") + + k.Net.SASL.Enable = true + k.Net.SASL.Mechanism = sarama.SASLTypeGSSAPI k.Net.SASL.GSSAPI = sarama.GSSAPIConfig{ AuthType: int(config.Kerberos.AuthType), KeyTabPath: config.Kerberos.KeyTabPath,