SCRAM

Salted Challenge Response Authentication Mechanism (SCRAM)credentials(username/password) 기반 인증 매커니즘이다.

Kafka Authentication using SASL/PLAIN

  • Kafka supports SCRAM-SHA-256 and SCRAM-SHA-512 which can be used with TLS to perform secure authentication.
  • Configuring Kafka Brokers

Kafka Broker 간 SASL/PLAIN 통신을 하기 위한 구성은 아래와 같다.

  • JAAS 파일을 각 Kafka 의 브로커 config 디렉터리에 추가
KafkaServer {
    org.apache.kafka.common.security.scram.ScramLoginModule required
    username="admin"
    password="admin-secret";
};
  • JAAS 설정 파일을 JVM 매개변수로 각 Kafka 브로커에 전달
-Djava.security.auth.login.config=/etc/kafka/kafka_server_jaas.conf
  • server.properties 에서 SASL 포트 및 SASL 메커니즘을 구성
# SASL_PLAIN 으로 listener 를 추가하고 Broker 간의 내부 통신은 SASL/PLAIN 으로 한다는 의미이다.
listeners=SASL_SSL://host.name:port
security.inter.broker.protocol=SASL_SSL
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-256 (or SCRAM-SHA-512)
sasl.enabled.mechanisms=SCRAM-SHA-256 (or SCRAM-SHA-512)

Simple Authentication and Security Layer

SASL/PLAIN 인증 방식은 username/password 를 통한 인증 방식이다. credentials 로 인증을 할 때에는 SSL 통신을 해야 plain text 가 노출되지 않는다.

Java Authentication and Authorization Service