Return-Path: X-Original-To: apmail-accumulo-dev-archive@www.apache.org Delivered-To: apmail-accumulo-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CC412102DB for ; Wed, 31 Jul 2013 15:54:07 +0000 (UTC) Received: (qmail 69085 invoked by uid 500); 31 Jul 2013 15:54:07 -0000 Delivered-To: apmail-accumulo-dev-archive@accumulo.apache.org Received: (qmail 68859 invoked by uid 500); 31 Jul 2013 15:54:02 -0000 Mailing-List: contact dev-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list dev@accumulo.apache.org Received: (qmail 68824 invoked by uid 99); 31 Jul 2013 15:53:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 15:53:59 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: error (athena.apache.org: encountered temporary error during SPF processing of domain of mberman@sqrrl.com) Received: from [209.85.219.54] (HELO mail-oa0-f54.google.com) (209.85.219.54) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Jul 2013 15:53:55 +0000 Received: by mail-oa0-f54.google.com with SMTP id o6so1891232oag.13 for ; Wed, 31 Jul 2013 08:53:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=9qNyr8ibC8JcXpuSNG67yZ9YpHRubEtaa5+1/yZKKiA=; b=cvaKwoGKrD+AL+fTvRhC2PoRRgYw0Vk0JonWOb/8LEzp4y+I95bQWGDJKa2BRoRHqU vrAjqEkkJJhpTf9n/+ArwLUWaCGA2vNA9IAT+cGwLYJ0w9/wz3FVNwJ11o/7P3WuTlUb Agcm+Jhyacp7cTFoiHGlIxP2qsItNyRk13FsN/U0WRvqN3hpQcbB/2QtkpLdasjtw/x6 2OyWHJe/5Da2W7oC9Sxep1kfYYIUMOow+g2JalS3tadozgc5NpOG+NQ/hf83yig0UuIG t4jhdoM3IWzFHkKhlhtOxDAq3A7Buo9r55RD8I9Tqv8peDRyBe8FVIvRFPaX5tGoEpmw oa8Q== X-Received: by 10.60.145.241 with SMTP id sx17mr983984oeb.57.1375285993683; Wed, 31 Jul 2013 08:53:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.23.71 with HTTP; Wed, 31 Jul 2013 08:52:53 -0700 (PDT) In-Reply-To: References: From: Michael Berman Date: Wed, 31 Jul 2013 11:52:53 -0400 Message-ID: Subject: Re: Config in ZooKeeperInstance To: dev Content-Type: multipart/alternative; boundary=047d7b5d474a1e4d6f04e2d0b925 X-Gm-Message-State: ALoCoQmi2DXFXlpICuLYU7C2Bqy7jrgbfXJ2OfTjQlp37T5zmZtJ2UHfNJO80I60bHwz67RGz5xL X-Virus-Checked: Checked by ClamAV on apache.org --047d7b5d474a1e4d6f04e2d0b925 Content-Type: text/plain; charset=ISO-8859-1 Oh, I absolutely agree we can't trust remote config to tell us where to find the trusted root...that needs to be consciously configured for every client. I was thinking more along the lines of your "http can automatically redirect to https" example. If I have an accumulo cluster up and running, and I want to switch to SSL, it would be nice to be able to flip the switch on the server, distribute my root cert, and then have all the existing client apps able to figure out that they should make SSL connections to accumulo automatically based on some cue from ZK. If it's really entirely up to the client to decide, probably that switch would require a recompile of my client apps to add the "use SSL" flag. I wouldn't want that flag to be in a conf file (although I think that's a great place for the path to the root cert), because on any given machine I may want to connect to both SSL and non-SSL accumulos...it seems like a connection-specific setting, not a global machine setting. I do definitely think there's a place in the client interface for "require SSL"...as in, I'm only interested in connecting to accumulo if I can get an SSL connection. But I think if that's not set, it would be nice for the behavior to be "I don't care" rather than "require non-SSL", in which case we do need some hint from ZK. You have convinced me that we don't want the whole config in there, so maybe it should just be a component of the connection string, or a standalone flag. I suppose another option is to always try SSL first, and if that fails, fall back to non-SSL, but that seems like a lot of overhead every time we try to make a connection, especially if the common case is not SSL. On Tue, Jul 23, 2013 at 5:02 PM, Christopher wrote: > It should really be a conscious decision whether to create a client > that expects SSL enabled or not. It shouldn't just happen > automatically. > > For comparison, imagine if HTTP/SSL worked this way... when I type > https://.... I expect it to be serving over SSL... not just > auto-negotiate to secure or non-secure mode. If it's not in secure > mode when I navigate to https://... , I simply don't want to go there. > Now, browsers do auto-negotiate in the other direction, to secure mode > (via HTTP redirects to HTTPS addresses), but that only works because > your browser has a set of built-in certificate authorities that it > trusts. If it doesn't, your browser gives you an error (if it's a good > browser) or a warning (if it's a weak one). So, even auto-negotiating > to secure mode is problematic if you can't control from the client, > which certificates the client is willing to trust in that secure > communication. We have no sensible way to distribute certificates that > clients should trust. Sysadmins should generate their own certificates > and configure clients appropriately. > > So, I don't see a way around it, you're going to have to make the > client code aware that SSL is the desired mode of communication... > either through a constructor parameter to ZooKeeperInstance, or > through another Instance sub-class... perhaps one that reads a > configuration file from the user's home directory with standard JSSE > properties ( > http://docs.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html > ). > You should not just automatically retrieve this from the server's > configuration in ZooKeeper, because that assumes you already trust the > server, and that undermines the whole point of the authentication > component of SSL. > > There's also the question of enabling SSL on ZK itself. I think you'd > probably want to do that, too. You're still going to need to seed the > SSL attributes in the client configuration, though, before you talk to > any other server. I suppose you could trust ZK, and manage keys there > (still seeding the client, but only with the certs / ssl mode needed > to talk directly to ZK)... but I think that might be overkill for a > first pass (especially since you can probably re-use the same server > cert for ZK as you can for the other servers... since they are > operating as a system). I think a simpler and more reliable solution > is to enable the easy configuration of standard JSSE properties in > both the client and the server. > > Now, what we could do is leave the configuration getter/setter on the > instance, and require setting JSSE options for SSL in that, via > setConfiguration(), though I'm personally a fan of getting them > automatically from a properties file instead (like the > $HOME/.accumulorc or $HOME/.accumulo/config suggestion made on > ACCUMULO-1045, or maybe even /etc/accumulo/clients.conf or similar). > > -- > Christopher L Tubbs II > http://gravatar.com/ctubbsii > > > On Tue, Jul 23, 2013 at 1:38 PM, Michael Berman wrote: > > The reason I'm interested in the config from a ZooKeeperInstance is > because > > a ZKInstance needs to know whether or not to use SSL to try to connect > to a > > given cluster. I think it would be annoying to require a ZKInstance > client > > to explicitly specify "useSsl" any time they want to connect to an SSL > > tserver (although I do see value in having a "requireSsl" optional flag). > > If configuration isn't the right way to communicate this, do people have > > other suggestions? I suppose I could just throw an ssl:// on the front > of > > the connection string or something, but it seems kludgy to do that any > time > > there's a configuration option that we want clients to know about. > > > > As far as removing Instance.getConfiguration() entirely, there are about > 30 > > references throughout the codebase to getConfiguration() on a bare > > Instance. Finding some other way to plumb whatever options those > consumers > > care about through the stack sounds like a substantial project. > > > > In my use case, I am only interested in the configuration that's stored > in > > ZK, and I already have enough information to connect to ZK, so it doesn't > > seem difficult technically, just a question of desired behavior. > > > > > > On Tue, Jul 23, 2013 at 1:11 PM, Eric Newton > wrote: > > > >> +1 for removing it from Instance > >> > >> > >> On Tue, Jul 23, 2013 at 12:14 PM, Christopher > wrote: > >> > >> > It only returns the default config if you don't call > >> > setConfiguration(), which appears to be almost always (except > >> > TestIngest). > >> > > >> > I don't know that this API is clearly spelled out, as to its intended > >> > purpose. Which configuration is it supposed to be getting, and how > >> > does that relate to the ZooKeeperInstance? The only configuration a > >> > ZooKeeperInstance has is the minimum needed to connect to other > >> > servers. It still has to authenticate to read any other server > >> > configuration. > >> > > >> > Personally, I'd be in favor of removing it from Instance interface, > >> > unless we actually document what it is supposed to be for to justify > >> > its utility in, and relationship to, the Instance interface. > >> > > >> > -- > >> > Christopher L Tubbs II > >> > http://gravatar.com/ctubbsii > >> > > >> > > >> > On Tue, Jul 23, 2013 at 10:44 AM, Michael Berman > >> > wrote: > >> > > I was surprised to find that ZooKeeperInstance.getConfiguration() > seems > >> > to > >> > > return only the default configuration rather than the configuration > >> > stored > >> > > in ZK. Is this the expected behavior? I came across this in a > >> MacTest, > >> > so > >> > > if other people are also surprised, it may be a MAC or > MacTest-specific > >> > > issue, in which case I'm happy to track it down. > >> > > > >> > > If this is currently the expected behavior, how would people feel > about > >> > > changing it? It seems like it would be useful to have a config > channel > >> > to > >> > > ZooKeeperInstance clients (in my case, what I'm specifically > interested > >> > in > >> > > is whether or not SSL is enabled). There may be a potential for > >> > privileged > >> > > information to escape...table settings, for example, may be > >> sensitive... > >> > > But all the really secret stuff should be in the site.xml which > >> wouldn't > >> > > get exposed. > >> > > > >> > > For reference, ZooKeeperInstance's getConfiguration() is implemented > >> as: > >> > > AccumuloConfiguration.getDefaultConfiguration() > >> > > > >> > > whereas HdfsZooInstance's getConfiguration() is: > >> > > ZooConfiguration.getInstance(this, getSiteConfiguration()) > >> > > > >> > > My proposal would be to change ZooKeeperInstance's to something > like: > >> > > ZooConfiguration.getInstance(this, > >> > > AccumuloConfiguration.getDefaultConfiguration()) > >> > > > >> > > Michael > >> > > >> > --047d7b5d474a1e4d6f04e2d0b925--