Skip to content

Not support Kafka SASL/PLAIN authentication of SCRAM-SHA-256 or SCRAM-SHA-512 mechanism #2722

Closed
@WalkerWang731

Description

Describe the bug
In the current version, Kafka authentication only supports PLAIN mode, not support SCRAM-SHA-256 or SCRAM-SHA-512. For this issue. I have already added support and commit a new PR later.

To Reproduce
Steps to reproduce the behavior:

  1. Set Kafka configuration server.properties, like this:
listeners=SASL_PLAINTEXT://localhost:9092
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=SCRAM-SHA-512
sasl.enabled.mechanisms=SCRAM-SHA-512

For the details can refer: kafka-documentation

Currently, only support mechanisms, like this:

listeners=SASL_PLAINTEXT://localhost:9092
security.inter.broker.protocol=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAIN
sasl.enabled.mechanisms=PLAIN

Expected behavior
Expand to support mechanisms that SCRAM-SHA-256 or SCRAM-SHA-512
Add a new parameter for Kafka, like this:

--kafka.producer.plaintext.mechanism string      The plaintext Mechanism for SASL/PLAIN authentication, e.g. 'SCRAM-SHA-256' or 'SCRAM-SHA-512' or 'PLAIN' (default "PLAIN")

--kafka.consumer.plaintext.mechanism string      The plaintext Mechanism for SASL/PLAIN authentication, e.g. 'SCRAM-SHA-256' or 'SCRAM-SHA-512' or 'PLAIN' (default "PLAIN")

Screenshots
Currently, connection status that using SCRAM-SHA-256 or SCRAM-SHA-512 Kafka server

$ jaeger-collector --kafka.producer.brokers "127.0.0.1:9092" --kafka.producer.authentication "plaintext" --kafka.producer.topic jaeger-spans --kafka.producer.plaintext.username user --kafka.producer.plaintext.password password

{"level":"info","ts":1610422257.2999601,"caller":"flags/service.go:116","msg":"Mounting metrics handler on admin server","route":"/metrics"}
{"level":"info","ts":1610422257.3010602,"caller":"flags/admin.go:120","msg":"Mounting health check on admin server","route":"/"}
{"level":"info","ts":1610422257.301121,"caller":"flags/admin.go:126","msg":"Starting admin HTTP server","http-addr":":14269"}
{"level":"info","ts":1610422257.301137,"caller":"flags/admin.go:112","msg":"Admin server started","http.host-port":"[::]:14269","health-status":"unavailable"}
{"level":"info","ts":1610422257.304835,"caller":"kafka/factory.go:69","msg":"Kafka factory","producer builder":{"Brokers":["127.0.0.1:9092"],"RequiredAcks":1,"Compression":0,"CompressionLevel":0,"ProtocolVersion":"","BatchLinger":0,"BatchSize":0,"BatchMinMessages":0,"BatchMaxMessages":0,"Authentication":"plaintext","Kerberos":{"ServiceName":"kafka","Realm":"","UseKeyTab":false,"Username":"","ConfigPath":"/etc/krb5.conf","KeyTabPath":"/etc/security/kafka.keytab"},"TLS":{"Enabled":false,"CAPath":"","CertPath":"","KeyPath":"","ServerName":"","ClientCAPath":"","SkipHostVerify":false},"PlainText":{"UserName":"user"}},"topic":"jaeger-spans"}
{"level":"fatal","ts":1610422258.0719209,"caller":"command-line-arguments/main.go:70","msg":"Failed to init storage factory","error":"kafka: client has run out of available brokers to talk to (Is your cluster reachable?)","stacktrace":"main.main.func1\n\tcommand-line-arguments/main.go:70\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/cobra@v0.0.3/command.go:762\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/cobra@v0.0.3/command.go:852\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/cobra@v0.0.3/command.go:800\nmain.main\n\tcommand-line-arguments/main.go:129\nruntime.main\n\truntime/proc.go:204"}

Version (please complete the following information):

  • OS: All
  • Jaeger version: 1.21.0 (collector and ingester)
  • Deployment: All methods that use Kafka store

Activity

yurishkuro

yurishkuro commented on Jan 12, 2021

@yurishkuro
Member

Duplicate of #2046

WalkerWang731

WalkerWang731 commented on Jan 12, 2021

@WalkerWang731
ContributorAuthor

Duplicate of #2046

but this PR did not merge to the current version.

yurishkuro

yurishkuro commented on Jan 12, 2021

@yurishkuro
Member

Yes, the PR was not finished, but the issue is a duplicate.

WalkerWang731

WalkerWang731 commented on Jan 12, 2021

@WalkerWang731
ContributorAuthor

Yes, the PR was not finished, but the issue is a duplicate.

ok I see, I will create a new PR for this one and previous #2046

yurishkuro

yurishkuro commented on Jan 12, 2021

@yurishkuro
Member

There is already a PR #2110, but it's not finished (unit tests are failing). I recommend picking up from where it left off.

yurishkuro

yurishkuro commented on Jan 12, 2021

@yurishkuro
Member

closing as a duplicate

1 remaining item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Not support Kafka SASL/PLAIN authentication of SCRAM-SHA-256 or SCRAM-SHA-512 mechanism · Issue #2722 · jaegertracing/jaeger