quickwit icon indicating copy to clipboard operation
quickwit copied to clipboard

Allow sasl authentication on kafka sources

Open GentleGhostCoder opened this issue 2 years ago • 2 comments

It is currently not possible to use a Sasl connection with a Kafka source. Currently you would get the following error message with a SASL configuration:

Command failed: Failed to create Kafka consumer.
Caused by:
    Client creation error: No provider for SASL mechanism SCRAM-SHA-256: recompile librdkafka with libsasl2 or openssl support. Current build options: PLAIN

Example config:

#
      # Kafka source config file.
      #
      source_id: kafka-source
      source_type: kafka
      parameters:
        topic: kafka-source
        client_params:
          bootstrap.servers: "localhost:9092"
          group.id: quickwit
          security.protocol=SASL_SSL
          sasl.mechanism=SCRAM-SHA-256
          sasl.username: test_user
          sasl.password: changeMe

To add the feature, you would have to add the "sasl" feature for the rdkafka dependency in the Cargo.toml file. File: https://github.com/quickwit-oss/quickwit/blob/main/quickwit/quickwit-indexing/Cargo.toml Line: [27] rdkafka = { workspace = true, optional = true } Change: rdkafka = { features = ["ssl", "sasl"], optional = true }

More info can be found here: https://docs.rs/rdkafka/0.6.0/rdkafka/index.html

GentleGhostCoder avatar Oct 05 '22 12:10 GentleGhostCoder

Hi @semmjon,

Thanks for opening this nicely-written issue. Do you want to open a PR and make your first contribution to Quickwit? :)

guilload avatar Oct 05 '22 13:10 guilload

I'll do it that gladly :-)

GentleGhostCoder avatar Oct 05 '22 13:10 GentleGhostCoder

@semmjon, gentle ping :)

guilload avatar Oct 16 '22 20:10 guilload