Return-Path: X-Original-To: apmail-hbase-user-archive@www.apache.org Delivered-To: apmail-hbase-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2DF7010E5C for ; Wed, 26 Feb 2014 22:48:44 +0000 (UTC) Received: (qmail 82644 invoked by uid 500); 26 Feb 2014 22:48:40 -0000 Delivered-To: apmail-hbase-user-archive@hbase.apache.org Received: (qmail 82506 invoked by uid 500); 26 Feb 2014 22:48:40 -0000 Mailing-List: contact user-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hbase.apache.org Delivered-To: mailing list user@hbase.apache.org Received: (qmail 82498 invoked by uid 99); 26 Feb 2014 22:48:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Feb 2014 22:48:40 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anastetsky@spryinc.com designates 209.85.128.177 as permitted sender) Received: from [209.85.128.177] (HELO mail-ve0-f177.google.com) (209.85.128.177) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Feb 2014 22:48:36 +0000 Received: by mail-ve0-f177.google.com with SMTP id db12so2933205veb.36 for ; Wed, 26 Feb 2014 14:48:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=0kL66JgNih+oriHtnak9GCWpjkNQOl3yvbkGrNd/RrU=; b=kp8DCGJsLNgJfrND6D0YEsjPQsQHkV/ANM63Zw9aZrnlhis1SgdFpahVKT877O87i7 A1X5ji98mRNggHc4xEdzEDzuiAfZk3Te1K6Sic5ZCk+RmjYtD6S+stpYFkuvys/XSfLS nYZlWoED/eE/6i+SE6ULHkWTbRZEhGe5BaTCKJC45MAs04n5ZEy1vnRlquycjs41sJHd FjVrpvqhjj4f5YuobhjHaSsIuWQf5B7Ne7hMebwT2VQ5I/aUjA4/g1PCQMtUhFONNlzK hJvLVEV9s09EPNU6mBtBxWqFuLBAPYgby8jsC0N2EVrgVmd7eG4xE2pXSR+OjyKdyaVy v63Q== X-Gm-Message-State: ALoCoQm2QEQM+zMpDKmODIgYSNCwtvZ1hTYxRuI4wJWS7ey1GXwNwBaOpPZrMzbR7G5mkvDrUYEz MIME-Version: 1.0 X-Received: by 10.52.164.137 with SMTP id yq9mr6440570vdb.33.1393454894820; Wed, 26 Feb 2014 14:48:14 -0800 (PST) Received: by 10.220.39.209 with HTTP; Wed, 26 Feb 2014 14:48:14 -0800 (PST) X-Originating-IP: [2601:a:1880:5b0:d189:1854:38cb:ae80] In-Reply-To: References: Date: Wed, 26 Feb 2014 17:48:14 -0500 Message-ID: Subject: Re: enable/disable table permission From: Alex Nastetsky To: user@hbase.apache.org Content-Type: multipart/alternative; boundary=001a11c2550c04766404f357000d X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2550c04766404f357000d Content-Type: text/plain; charset=ISO-8859-1 Thanks Ted. Can you use user X to grant hrt_1 permission to create tables just in the 'ted' namespace (but not in the global namespace)? I want a user to be able to create their own tables, but not drop the tables of other users. If I can't have that, then I would settle for not being able to drop the tables in other namespaces. On Wed, Feb 26, 2014 at 5:33 PM, Ted Yu wrote: > I created a table 'ted:t1' using user X in a secure cluster. > > I then logged in as user hrt_1 and did the following: > > hbase(main):007:0> user_permission 'ted:t1' > User > Table,Family,Qualifier:Permission > > ERROR: org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient > permissions (user=hrt_1@H.NET, scope=ted:t1, family=, action=ADMIN) > at > > org.apache.hadoop.hbase.security.access.AccessController.requirePermission(AccessController.java:387) > at > > org.apache.hadoop.hbase.security.access.AccessController.getUserPermissions(AccessController.java:1613) > > hbase(main):002:0> disable 'ted:t1' > > ERROR: org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient > permissions (user=hrt_1@HORTON.YGRIDCORE.NET, scope=ted:t1, family=, > action=CREATE) > > So your use case is covered. > > > On Wed, Feb 26, 2014 at 2:08 PM, Alex Nastetsky >wrote: > > > I haven't looked at the patch, just the ticket description. Here is an > > excerpt: > > > > Lets see an example on how privileges work with namespaces. > > > User "Mike" request for a namespace named "hbase_perf" with the hbase > > > admin. > > > whoami: hbase > > > hbase shell >> namespace_create 'hbase_perf' > > > hbase shell >> grant 'mike', 'W', '@hbase_perf' > > > Mike creates two tables "table20" and "table50" in the above workspace. > > > whoami: mike > > > hbase shell >> create 'hbase_perf.table20', 'family1' > > > hbase shell >> create 'hbase_perf.table50', 'family1' > > > > > > Are you saying the ability to grant users permission to create tables in > a > > namespace is not part of the patch? > > > > If it's not, then it does not cover my scenario, as you said. Which would > > mean that the hope is for it to be implemented in HBASE-9206, which > > apparently hasn't been touched in 5 months. > > > > I can't imagine the scenario for wanting to prevent other users from > > dropping your table is that uncommon. What's the point of controlling who > > can Write to your table if anyone can just drop it? > > > > On Wed, Feb 26, 2014 at 3:47 PM, Ted Yu wrote: > > > > > I went over the patch for HBASE-8409 one more time. > > > I don't see a test case covering your scenario. > > > > > > Cheers > > > > > > > > > On Wed, Feb 26, 2014 at 9:36 AM, Alex Nastetsky < > anastetsky@spryinc.com > > > >wrote: > > > > > > > Does that indicate to you an abandoned ticket? > > > > > > > > I think that HBASE-8409 alone would satisfy my needs because it > > prevents > > > > other tenants from dropping and altering my tables (the W > permission). > > I > > > > can live with users with dropping and altering tables of other users > in > > > the > > > > same namespace. > > > > > > > > Do you have another suggested approach? > > > > > > > > > > > > On Wed, Feb 26, 2014 at 12:00 PM, Ted Yu > wrote: > > > > > > > > > I was looking at HBASE-9206 : the last comment was 5 months ago. > > > > > > > > > > > > > > > On Wed, Feb 26, 2014 at 8:57 AM, Alex Nastetsky < > > > anastetsky@spryinc.com > > > > > >wrote: > > > > > > > > > > > Thanks for all that detail. Re: updating documentation, it looks > > like > > > > > there > > > > > > is a ticket for that: > > > https://issues.apache.org/jira/browse/HBASE-6192 > > > > > > > > > > > > My specific use case is to support secure multi-tenancy. It looks > > > like > > > > > > namespaces is the way to go, and security for them was added in > > > > > > https://issues.apache.org/jira/browse/HBASE-8409 with additional > > > > > security > > > > > > being added in https://issues.apache.org/jira/browse/HBASE-9206. > > > > > > > > > > > > > > > > > > On Tue, Feb 25, 2014 at 7:30 PM, Gary Helmling < > > ghelmling@gmail.com> > > > > > > wrote: > > > > > > > > > > > > > It looks like how the CREATE permission is applied changed with > > > > > > HBASE-6188, > > > > > > > which removed the concept of a table owner. Prior to > HBASE-6188, > > > the > > > > > > > disable/enable table permission checks required either: > > > > > > > > > > > > > > * ADMIN permission > > > > > > > or > > > > > > > * the user is the table owner AND has the CREATE permission > > > > > > > > > > > > > > I believe the original intent here was that if you created a > > table, > > > > you > > > > > > > should be able to disable and modify it. > > > > > > > > > > > > > > After HBASE-6188, the check in enable/disable table is simply > for > > > > > either > > > > > > > ADMIN or CREATE permission. This seems to be the best > compromise > > > on > > > > > > > attempting to maintain some of the previous semantics. > > > > > > > > > > > > > > Andrew Purtell commented to this in HBASE-6188: > > > > > > > > > > > > > > > > > > > > > > > > > > > > CREATE -(DDL) CreateTable, AddColumn, DeleteColumn, > DeleteTable, > > > > > > > ModifyColumn, ModifyTable, DisableTable, EnableTable > > > > > > > > > > > > > > ADMIN - All of the above plus Flush, Split, Compact > > > > > > > > > > > > > > It's not useful to give add/delete/modify schema privileges > > without > > > > > > > enable/disable to have them take effect. So either we do the > > above > > > or > > > > > we > > > > > > > get rid of CREATE. I think the above distinction is still > useful. > > > > > > > > > > > > > > Edit: I don't like that non-ADMIN can do enable/disable table, > > > > because > > > > > it > > > > > > > can really affect the cluster if the table is large. However I > > > think > > > > on > > > > > > > balance it would be more confusing than useful to remove > > > EnableTable > > > > > and > > > > > > > DisableTable from the set of operations CREATE permission > allows > > > > until > > > > > > > online schema update-in-place without disable is always > possible. > > > > > > > > > > > > > > > > > > > > > At this point, it may be useful to discuss if we're at the > point > > > yet > > > > > > where > > > > > > > online schema updates can be reliably done without a table > > disable. > > > > In > > > > > > > this case, it might make sense to drop disable/enable table > from > > > > CREATE > > > > > > > permission. Though we now have backwards compatibility to > > consider > > > > as > > > > > > > well. > > > > > > > > > > > > > > If this could be better reflected in the security > documentation, > > > > please > > > > > > do > > > > > > > open a JIRA describing how we can make it clearer. And if you > > feel > > > > up > > > > > to > > > > > > > it, a patch or updated text would be even better. > > > > > > > > > > > > > > > > > > > > > On Tue, Feb 25, 2014 at 12:30 PM, Alex Nastetsky < > > > > > anastetsky@spryinc.com > > > > > > > >wrote: > > > > > > > > > > > > > > > I don't really understand how HBase permission is expected to > > > work > > > > > > then. > > > > > > > A > > > > > > > > user needs the Create permission in order to be able to > create > > > > their > > > > > > own > > > > > > > > tables. But that permission also allows them to "drop" and > > > "alter" > > > > > the > > > > > > > > tables created by others. Even if those operations are set up > > to > > > > only > > > > > > > work > > > > > > > > when a table is disabled, the ability to disable a table is > > also > > > > > given > > > > > > by > > > > > > > > the Create permission. What am I missing? > > > > > > > > > > > > > > > > > > > > > > > > On Tue, Feb 25, 2014 at 3:25 PM, Alex Nastetsky < > > > > > > anastetsky@spryinc.com > > > > > > > > >wrote: > > > > > > > > > > > > > > > > > Sounds like either permission is sufficient. Either way, > the > > > > > > > > documentation > > > > > > > > > could be improved. > > > > > > > > > > > > > > > > > > Thanks. > > > > > > > > > > > > > > > > > > > > > > > > > > > On Tue, Feb 25, 2014 at 3:22 PM, Ted Yu < > yuzhihong@gmail.com > > > > > > > > wrote: > > > > > > > > > > > > > > > > > >> Here is related code from AccessController: > > > > > > > > >> {code} > > > > > > > > >> public void > > > > > > > > >> > > preDisableTable(ObserverContext > > > > > > > > >> c, byte[] tableName) > > > > > > > > >> ... > > > > > > > > >> requirePermission("disableTable", tableName, null, > null, > > > > > > > > Action.ADMIN, > > > > > > > > >> Action.CREATE); > > > > > > > > >> {code} > > > > > > > > >> requirePermission() iterates through the above permissions > > and > > > > > would > > > > > > > > >> return > > > > > > > > >> error for the second permission (CREATE) if validation > > fails. > > > > > > > > >> > > > > > > > > >> Cheers > > > > > > > > >> > > > > > > > > >> > > > > > > > > >> On Tue, Feb 25, 2014 at 12:12 PM, Alex Nastetsky < > > > > > > > > anastetsky@spryinc.com > > > > > > > > >> >wrote: > > > > > > > > >> > > > > > > > > >> > According to > > > > > > > > >> > > > > > > > > > >> > > > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > http://hbase.apache.org/book/hbase.accesscontrol.configuration.html#d2566e5780 > > > > > > > > >> > , > > > > > > > > >> > the Enable/Disable operation is controlled by the Admin > > > > > > permission. > > > > > > > > >> > However, it seems to be controlled instead by the Create > > > > > > permission. > > > > > > > > Is > > > > > > > > >> > this a bug or a typo in the documentation? > > > > > > > > >> > > > > > > > > > >> > hbase(main):002:0> disable 'foo' > > > > > > > > >> > > > > > > > > > >> > ERROR: > > > org.apache.hadoop.hbase.security.AccessDeniedException: > > > > > > > > >> Insufficient > > > > > > > > >> > permissions (user=anastetsky@SPRY.COM, scope=foo, > > family=, > > > > > > > > >> action=CREATE) > > > > > > > > >> > > > > > > > > > >> > Thanks in advance, > > > > > > > > >> > Alex. > > > > > > > > >> > > > > > > > > > >> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --001a11c2550c04766404f357000d--