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

I added sasl.mechanism, and sasl.jaas.config for each cluster. and fix some bugs [#528, #513,#502,#479,#477,#471] #532

Merged
merged 5 commits into from
Jul 28, 2018

Conversation

kingmorning
Copy link

Hi
I added sasl.mechanism, and sasl.jaas.config for each cluster. and fix some bugs [#528, #513,#502,#479,#477,#471]
I tested this new functions, mechanism includes PLAIN,GSSAPI,SCRAM-SHA-256,SCRAM-SHA-512.
and sasl.jaas.config is a optional string, such as: "org.apache.kafka.common.security.plain.PlainLoginModule required username=kafka password=kakafkaa;"

@yahoocla
Copy link

Thank you for submitting this pull request, however I do not see a valid CLA on file for you. Before we can merge this request please visit https://yahoocla.herokuapp.com/ and agree to the terms. Thanks! 😄

@kingmorning
Copy link
Author

Done

@JasonFJ40
Copy link

Thank you @kingmorning! My SSL issues have been solved!

@@ -114,6 +122,8 @@ class Cluster (val messagesApi: MessagesApi, val kafkaManagerContext: KafkaManag
)(ClusterTuning.apply)(ClusterTuning.unapply)
)
, "securityProtocol" -> nonEmptyText.verifying(validateSecurityProtocol)
, "saslMechanism" -> nonEmptyText.verifying(validateSASLmechanism)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this field required? If I am not using SASL, then why would we want the user to fill this in.

@@ -100,7 +101,11 @@ case class KafkaAdminClientActor(config: KafkaAdminClientActorConfig) extends Ba
}
props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, config.clusterContext.config.securityProtocol.stringId)
props.put(CommonClientConfigs.BOOTSTRAP_SERVERS_CONFIG, brokerListStr)
log.info(s"Creating admin client with security protocol=${config.clusterContext.config.securityProtocol.stringId} , broker list : $brokerListStr")
props.put(SaslConfigs.SASL_MECHANISM, config.clusterContext.config.saslMechanism.stringId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only put sasl properties if cluster is configured for it.

@@ -298,6 +302,8 @@ class KafkaManager(akkaConfig: Config) extends Logging {
filterConsumers: Boolean,
tuning: Option[ClusterTuning],
securityProtocol: String,
saslMechanism: String,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be optional. e.g. Option[String]

@@ -257,6 +262,10 @@ case class KafkaManagedOffsetCache(clusterContext: ClusterContext
cp => props.putAll(cp)
}
props.put(CommonClientConfigs.SECURITY_PROTOCOL_CONFIG, clusterContext.config.securityProtocol.stringId)
props.put(SaslConfigs.SASL_MECHANISM, clusterContext.config.saslMechanism.stringId)
if (!clusterContext.config.jaasConfig.isEmpty) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only put sasl properties if cluster is configured for it.

@@ -1460,6 +1469,10 @@ class KafkaStateActor(config: KafkaStateActorConfig) extends BaseClusterQueryCom
val port: Int = broker.endpoints(securityProtocol)
consumerProperties.put(BOOTSTRAP_SERVERS_CONFIG, s"${broker.host}:$port")
consumerProperties.put(SECURITY_PROTOCOL_CONFIG, securityProtocol.stringId)
consumerProperties.put(SaslConfigs.SASL_MECHANISM, kaConfig.clusterContext.config.saslMechanism.stringId)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should only put sasl properties if cluster is configured for it.

@patelh
Copy link
Collaborator

patelh commented Jul 17, 2018

Thanks for your contribution @kingmorning , let's make this change so SASL is optional and not required.

@patelh
Copy link
Collaborator

patelh commented Jul 23, 2018

If you need help making the changes, please add me as a collaborator to your forked repo and I can make the changes.

@kingmorning
Copy link
Author

ok,I added you as a collaborator to my forked repo, thank you for this help.
I tried to make the changes, but failed.
I'm not familiar with scala, especially the play framework.

@patelh patelh merged commit e27328c into yahoo:master Jul 28, 2018
@patelh
Copy link
Collaborator

patelh commented Jul 28, 2018

@kingmorning Version 1.3.3.21 has these changes, can you test it out on your cluster and then we can do a release.

@gena01
Copy link

gena01 commented Aug 6, 2018

@patelh @kingmorning are we still waiting for confirmation to cut a release?

@patelh
Copy link
Collaborator

patelh commented Aug 6, 2018

Yes

@TheMonolithX64
Copy link

I can confirm that build 1.3.3.21+ I can now see Kafka consumers listed in the UI using SSL-only enabled clusters. Tested on multiple secured clusters, two+ nodes w/ SSL client auth required.

@carlcauchigig
Copy link

Hi, can you take a look at this issue: #664 as it might be similar

@Neustradamus
Copy link

Linked to:

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

Successfully merging this pull request may close these issues.

8 participants