From b5b6a17ca89a0b3ecaa3b52a0f1fe8215a769021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9mi=20V=C3=A1nyi?= Date: Fri, 3 Apr 2020 17:38:15 +0200 Subject: [PATCH] Enable GSSAPI authentication when Kerberos is configured (#17470) (#17472) (cherry picked from commit 5ca0e4cd0943b36c9d169a7e32bb08d0e27b7b43) --- 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 22f55ebc718..1290b8fa297 100644 --- a/libbeat/outputs/kafka/config.go +++ b/libbeat/outputs/kafka/config.go @@ -176,6 +176,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,