Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-13055

Security without JAAS configuration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Workaround
    • 2.8.0
    • None
    • security
    • None

    Description

      I think that this isn't a bug, but I don't know what type to choose for this issue.

      I'm setting up kafka security with multiple listeners. Listener for broker works as plaintext and I don't want to use authentication for them. My cluster has configuration: 

      listeners=BROKERS://:9091,CLIENTS://:9092,CLIENTS-NOSSL://:9093
      inter.broker.listener.name=BROKERS
      sasl.enabled.mechanisms=SCRAM-SHA-256
      listener.security.protocol.map=BROKERS:PLAINTEXT,CLIENTS:SASL_SSL,CLIENTS-NOSSL:SASL_PLAINTEXT
      

      For clients, I want use SCRAM and only for them (not for brokers). But when I start broker, I see following message in log:

      ERROR [KafkaServer id=0] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
      java.lang.IllegalArgumentException: Could not find a 'KafkaServer' or 'clients.KafkaServer' entry in the JAAS configuration. System property 'java.security.auth.login.config' is not set
      

      Why is this configuration so necessary, if I don't use authentication for brokers and SCRAM mechanism stores credentials in zookeeper? Which user do I need to add to sasl.jaas.config? I have created users who perform operations as consumers and producers. I didn't create any admin users because I don't need it. I didn't find any more detailed information in docs about why this is so necessary.

      For experiment:

      listener.name.clients.scram-sha-256.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required \
          username="alice" \
          password="alice-secret";
      --
      listener.name.clients-nossl.scram-sha-256.sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required \
          username="alice" \
          password="alice-secret";
      

      I specified user alice in sasl.jaas.config, but I didn't create this user and Kafka starts correctly. What is the logic of this?

      Attachments

        Activity

          People

            Unassigned Unassigned
            alexey.kashavkin Alexey Kashavkin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: