-
Notifications
You must be signed in to change notification settings - Fork 128
ZooKeeperNet: Implement optional SASL authentication on connect #38
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
Conversation
dac45f0 to
469fdda
Compare
|
Hi @ewhauser, I have just pushed a refreshed version of this patch which makes it possible to connect to a SASL-enabled ZooKeeper using either a fixed S22.Sasl ( What do you think? Is there any interest in these patches? More generally, it would be useful to have a clarification as of the status of this project: do you still use it? Do you know of any other active users? Would you accept patches adding support for ZK 3.5 features? @fantasy0v0: As the last active contributor, would you have any comments? |
|
I'm happy to merge this. Is it possible to add a test? |
|
Hi @ewhauser, Great to read that you are still interested! Re test: sure (hence the "WIP" in the current title). I'll re-spin ASAP, but don't hesitate to review/comment on the code in the meantime. Cheers, -D |
469fdda to
8c7e069
Compare
Well, easier said than done… I have been struggling with this a bit, as the simplest mechanism provided by ZooKeeper is I have a branch which includes such a test—but it requires adding my (patched!) fork of https://github.com/ztzg/ewhauser-zookeeper.net/tree/RT-46545-zookeeper-net-sasl-with-tests It doesn't change the What do you think? Ideas welcome! |
|
The existing tests just run against the Zookeeper server as an integration
test. Seems like a reasonable solution for a test.
|
Built from this commit of https://github.com/ztzg/S22.Sasl: commit b85c919b39ede184d36bc2e04f63b6e530ca3e10 Author: Damien Diederen <dd@crosstwine.com> Date: Sun Dec 15 14:59:53 2019 +0100 S22.Sasl.csproj: Retarget to .NET v4.0 https://github.com/ztzg/S22.Sasl/tree/RT-46545-zookeeper-net-sasl-binary
Note that for this test to pass, The following must be configured in zoo.conf:
authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider
The following in jaas.conf:
Server {
org.apache.zookeeper.server.auth.DigestLoginModule required
user_super="adminsecret"
user_bob="bobsecret";
};
And the server must be started with:
-Djava.security.auth.login.config=.../jaas.conf
See https://cwiki.apache.org/confluence/display/ZOOKEEPER/Client-Server+mutual+authentication#Client-Servermutualauthentication-ServerConfiguration
for additional details.
8c7e069 to
4810e41
Compare
|
Hi @ewhauser,
Right. But the server has to be configured for SASL authentication for the test to pass! I have added a note on how to do so at the top of Targeting a SASL-enabled server is only half the story, though. The patch enables SASL authentication via an Unlike Java, .NET does not carry one in the standard library, and the only one I could find was developed for IMAP and required patching to work with ZooKeeper. I have built a .NET v4.0 assembly and included it in Does that work for you? Cheers, -D |
|
Hi @ewhauser, Did you see my update above? If so, what do you think? |
|
Yes, I'm ok with that direction. |
|
Fantastic :) Thanks! |
Hi @ewhauser,
The attached patch allows a .NET application to automatically authenticate via SASL when (re)connecting to a ZooKeeper ensemble. The feature is enabled by passing an implementation of the
ISaslClientinterface.I am able to successfully perform
DIGEST-MD5authentication by implementing that interface using a slightly modified version ofS22.Sasl(see below).I am currently looking into adding
GSSAPIsupport, which would help validate the mechanism—but haven't found a "reasonable" way to access that API bound under .NET yet (ideas/suggestions welcome on that front!).Assuming I make some progress on the
GSSAPIfront, would you be interested in integrating a polished version of this patch?Best,
Damien Diederen