<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to create Ranger Policy to automatically grant access to Hive table owner? HDP-2.5.6, Hive &amp; Ranger in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213059#M174989</link>
    <description>&lt;P&gt;Hi &lt;A href="https://community.hortonworks.com/questions/195985/how-to-create-ranger-policy-to-automatically-grant.html#"&gt;@Felix Albani&lt;/A&gt;, is it possible to user {USER} even when the naming conventions of username is firstname.lastname? &lt;/P&gt;&lt;P&gt;Would really appreciate your response.&lt;/P&gt;</description>
    <pubDate>Tue, 23 Oct 2018 16:29:23 GMT</pubDate>
    <dc:creator>ivonnycapilitan</dc:creator>
    <dc:date>2018-10-23T16:29:23Z</dc:date>
    <item>
      <title>How to create Ranger Policy to automatically grant access to Hive table owner? HDP-2.5.6, Hive &amp; Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213055#M174985</link>
      <description>&lt;P&gt;I have a database where all members of a group are allowed to create tables. When a user creates a table, only the creator should be allowed access to that table. I will create a new policy to allow other members of the group access to the new table after an approval business process.&lt;/P&gt;&lt;P&gt;HDP 2.6.5, Hive and Ranger (I cannot use Atlas and tag based policies at this time)&lt;/P&gt;&lt;P&gt;This policy allows members of the group to create tables, but the owner has no access after creating.&lt;/P&gt;&lt;PRE&gt;resources(database:testdb, table:*, column:*)
policyItems (accesses:create,groups:testgroup)&lt;/PRE&gt;&lt;P&gt;beeline as user1, a member of testgroup&lt;/P&gt;&lt;PRE&gt;0: jdbc:hive2://localhost:10000&amp;gt; use testdb;
No rows affected (2.509 seconds)

0: jdbc:hive2://localhost:10000&amp;gt; CREATE TABLE testtable (id STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' LOCATION '/hive/data/testtable';
No rows affected (0.669 seconds)

0: jdbc:hive2://localhost:10000&amp;gt; show tables;
+------------+--+
|  tab_name  |
+------------+--+
| testtable  |
+------------+--+
1 row selected (1.029 seconds)

0: jdbc:hive2://localhost:10000&amp;gt; describe testtable;
Error: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [user1] does not have [SELECT] privilege on[testdb/testtable/*] (state=42000,code=40000)&lt;/PRE&gt;&lt;P&gt;I tried adding a policy item using the {OWNER} variable but had the same result.&lt;/P&gt;&lt;PRE&gt;resources(database:testdb, table:*, column:*)
policyItems [(accesses:[select,update,drop,alter,index,lock,read,write] users:{OWNER}), (accesses:create, groups:testgroup)]&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 May 2018 03:40:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213055#M174985</guid>
      <dc:creator>eric_b_richards</dc:creator>
      <dc:date>2018-05-31T03:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Ranger Policy to automatically grant access to Hive table owner? HDP-2.5.6, Hive &amp; Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213056#M174986</link>
      <description>&lt;P&gt; &lt;A rel="user" href="https://community.cloudera.com/users/83183/ericbrichardson.html" nodeid="83183" target="_blank"&gt;@Eric Richardson&lt;/A&gt; By using {USER} instead of {OWNER} you could come up with the following solution:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="76504-screen-shot-2018-05-30-at-93605-pm.png" style="width: 1976px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/16517i7F8D5062531062E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="76504-screen-shot-2018-05-30-at-93605-pm.png" alt="76504-screen-shot-2018-05-30-at-93605-pm.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;With the above policy users will be able to:&lt;/P&gt;&lt;P&gt;1. Use database testdb;&lt;/P&gt;&lt;P&gt;2. Users will be able to create tables. With the condition that table names must end in underscore username &lt;STRONG&gt;_{USER}&lt;/STRONG&gt;. &lt;/P&gt;&lt;P&gt;2. Show tables that finish with their username only. For example:&lt;/P&gt;&lt;PRE&gt;show tables;
+---------------+--+
|   tab_name    |
+---------------+--+
| t2_falbani    |
| test_falbani  |
+---------------+--+
## Users wont see any other tables unless another policy grants them permissions&lt;/PRE&gt;&lt;P&gt;3.  Users will have full control over the tables ending in underscore username &lt;STRONG&gt;_{USER} &lt;/STRONG&gt;- And won't be able to perform any operations in any other tables unless there is another policy that grants them permissions.&lt;/P&gt;&lt;P&gt;Hopefully this will help you address your requirement. Please let me know if this helps. Also if you found this answer addressed your question, please take a moment to login and click the "accept" link on the answer.&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 03:41:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213056#M174986</guid>
      <dc:creator>falbani</dc:creator>
      <dc:date>2019-08-18T03:41:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Ranger Policy to automatically grant access to Hive table owner? HDP-2.5.6, Hive &amp; Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213057#M174987</link>
      <description>&lt;P&gt;I think this solution would work from a technical perspective. However, I am not sure my users will accept the naming pattern limitation. &lt;/P&gt;&lt;P&gt;I have been unable to find a example of anyone using the {OWNER} variable.&lt;/P&gt;&lt;P&gt;@svenkat said how useful it was here &lt;A href="https://community.hortonworks.com/questions/118123/hdp-26-allows-user-variable-in-ranger-policies-are.html"&gt;https://community.hortonworks.com/questions/118123/hdp-26-allows-user-variable-in-ranger-policies-are.html&lt;/A&gt; but didn't provide an example of actually using it.&lt;/P&gt;&lt;P&gt;Does it work?&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 21:19:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213057#M174987</guid>
      <dc:creator>eric_b_richards</dc:creator>
      <dc:date>2018-05-31T21:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Ranger Policy to automatically grant access to Hive table owner? HDP-2.5.6, Hive &amp; Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213058#M174988</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/83183/ericbrichardson.html" nodeid="83183"&gt;@Eric Richardson&lt;/A&gt; {OWNER} is not supported by Hive yet. Please mark the answer if you feel the information provided has helped address your question. &lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 23:47:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213058#M174988</guid>
      <dc:creator>falbani</dc:creator>
      <dc:date>2018-05-31T23:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create Ranger Policy to automatically grant access to Hive table owner? HDP-2.5.6, Hive &amp; Ranger</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213059#M174989</link>
      <description>&lt;P&gt;Hi &lt;A href="https://community.hortonworks.com/questions/195985/how-to-create-ranger-policy-to-automatically-grant.html#"&gt;@Felix Albani&lt;/A&gt;, is it possible to user {USER} even when the naming conventions of username is firstname.lastname? &lt;/P&gt;&lt;P&gt;Would really appreciate your response.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Oct 2018 16:29:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-Ranger-Policy-to-automatically-grant-access-to/m-p/213059#M174989</guid>
      <dc:creator>ivonnycapilitan</dc:creator>
      <dc:date>2018-10-23T16:29:23Z</dc:date>
    </item>
  </channel>
</rss>

