Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
WalkerWang731 opened this issue Jan 12, 2021 · 7 comments · Fixed by #2724
Closed

Comments

@WalkerWang731
Copy link
Contributor

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/[email protected]/command.go:762\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/[email protected]/command.go:852\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/[email protected]/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
@yurishkuro
Copy link
Member

Duplicate of #2046

@yurishkuro yurishkuro marked this as a duplicate of #2046 Jan 12, 2021
@WalkerWang731
Copy link
Contributor Author

Duplicate of #2046

but this PR did not merge to the current version.

@yurishkuro
Copy link
Member

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

@WalkerWang731
Copy link
Contributor Author

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
Copy link
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
Copy link
Member

closing as a duplicate

@Neustradamus
Copy link

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

Successfully merging a pull request may close this issue.

3 participants