<?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 Ranger HDFS policy not taking effect even after restart in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141756#M27941</link>
    <description>&lt;P&gt;&lt;EM&gt;Steps done:&lt;/EM&gt;&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;Disabled “HDFS Global Allow”.&lt;/LI&gt;&lt;LI&gt;Created new policy for Marketing group (Read/Execute enabled) "/apps/hive/warehouse/xademo.db/customer_details&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;PS- Policy sync successful as checked in Ranger-&amp;gt;Audit-&amp;gt;Plugins&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;Problem&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;User from a different group (e.g. user it1 user from IT group) was freely able to drop the Hive table "customer_details"&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Troubleshooting done so far:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;hadoop fs -ls /apps/hive/warehouse/xademo.db&lt;/P&gt;&lt;P&gt;drwxrwxrwx   - hive hdfs          0 2016-03-14 14:52 /apps/hive/warehouse/xademo.db/customer_details&lt;/P&gt;&lt;P&gt;It seems HDFS permissions is taking precedence over Ranger policies?&lt;/P&gt;</description>
    <pubDate>Wed, 11 May 2016 19:06:08 GMT</pubDate>
    <dc:creator>amittewari_5</dc:creator>
    <dc:date>2016-05-11T19:06:08Z</dc:date>
    <item>
      <title>Ranger HDFS policy not taking effect even after restart</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141756#M27941</link>
      <description>&lt;P&gt;&lt;EM&gt;Steps done:&lt;/EM&gt;&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;Disabled “HDFS Global Allow”.&lt;/LI&gt;&lt;LI&gt;Created new policy for Marketing group (Read/Execute enabled) "/apps/hive/warehouse/xademo.db/customer_details&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;PS- Policy sync successful as checked in Ranger-&amp;gt;Audit-&amp;gt;Plugins&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;STRONG&gt;&lt;EM&gt;Problem&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;User from a different group (e.g. user it1 user from IT group) was freely able to drop the Hive table "customer_details"&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Troubleshooting done so far:&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;hadoop fs -ls /apps/hive/warehouse/xademo.db&lt;/P&gt;&lt;P&gt;drwxrwxrwx   - hive hdfs          0 2016-03-14 14:52 /apps/hive/warehouse/xademo.db/customer_details&lt;/P&gt;&lt;P&gt;It seems HDFS permissions is taking precedence over Ranger policies?&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 19:06:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141756#M27941</guid>
      <dc:creator>amittewari_5</dc:creator>
      <dc:date>2016-05-11T19:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger HDFS policy not taking effect even after restart</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141757#M27942</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/3441/amittewari5.html" nodeid="3441"&gt;@AT&lt;/A&gt;&lt;P&gt;ranger policies always takes precedence and then HDFS permissions.&lt;/P&gt;&lt;P&gt;You can disable fallback method. pls check this - &lt;A href="http://hortonworks.com/blog/best-practices-in-hdfs-authorization-with-apache-ranger/" target="_blank"&gt;http://hortonworks.com/blog/best-practices-in-hdfs-authorization-with-apache-ranger/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 19:19:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141757#M27942</guid>
      <dc:creator>sshimpi</dc:creator>
      <dc:date>2016-05-11T19:19:55Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger HDFS policy not taking effect even after restart</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141758#M27943</link>
      <description>&lt;P&gt;HDFS permission have always precedence on Ranger permission.&lt;/P&gt;&lt;P&gt;Good start is deny on hdfs and enable on ranger.
&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 19:29:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141758#M27943</guid>
      <dc:creator>aubaldi</dc:creator>
      <dc:date>2016-05-11T19:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger HDFS policy not taking effect even after restart</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141759#M27944</link>
      <description>&lt;P&gt;This is a common point of confusion, so I did some tests which I hope will clarify.&lt;/P&gt;&lt;P&gt;&lt;U&gt;TEST 1: &lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;/U&gt;
Setup: &lt;/P&gt;&lt;P&gt;
1. Create a user directory /user/myuser with 777 permissions in HDFS &lt;/P&gt;&lt;P&gt;
2. Make a policy in ranger that allows user mktg1 only read access to /user/myuser &lt;/P&gt;&lt;P&gt;Result: 
1. It always allows mktg1 to write &lt;/P&gt;&lt;P&gt;2. Ranger Audit says "Access Enforcer" is &lt;STRONG&gt;hadoop-acl &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;
&lt;STRONG&gt;This is expected behaviour&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;EXPLANATION: 
The way a Ranger policy normally works is it searches until it either runs out of options, or it allows access. So, in this case, it first checks the Ranger policy, sees it can't write, then checks HDFS permissions, sees it CAN write and then allows the write. &lt;/P&gt;&lt;P&gt;
In order to avoid this situation, you must &lt;STRONG&gt;totally lock down filesystem permissions&lt;/STRONG&gt;. That is something like chmod 700. Then you can administer access via Ranger policies. &lt;/P&gt;&lt;P&gt;
&lt;STRONG&gt;Ranger policies can only allow access&lt;/STRONG&gt;; if nothing allows access (including by default HDFS permissions) then it will deny. &lt;/P&gt;&lt;P&gt;&lt;U&gt;TEST 2: &lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;/U&gt;
Setup: &lt;/P&gt;&lt;P&gt;
1. Create a user directory /user/myuser with 000 permissions in HDFS &lt;/P&gt;&lt;P&gt;
2. Make a policy in ranger that allows user mktg1 read+execute access to /user/myuser &lt;/P&gt;&lt;P&gt;
Result: &lt;/P&gt;&lt;P&gt;
1. As the user it1: &lt;/P&gt;&lt;PRE&gt;[it1@sandbox conf]$ hadoop fs -ls /user/myuser 
ls: Permission denied: user=it1, access=READ_EXECUTE, inode="/user/myuser":hdfs:hdfs:d--------- &lt;/PRE&gt;&lt;P&gt;2. As the user mktg1:&lt;/P&gt;&lt;PRE&gt;[mktg1@sandbox conf]$ hadoop fs -ls /user/myuser 
Found 10 items 
-rw-r--r-- 1 root hdfs 529 2015-06-24 12:30 /user/myuser/test.csv &lt;/PRE&gt;&lt;P&gt;
“Access Enforcer” is &lt;STRONG&gt;xasecure-acl&lt;/STRONG&gt; in the Ranger Audit UI&lt;/P&gt;&lt;P&gt;
3. As the user mktg1: &lt;/P&gt;&lt;PRE&gt;[mktg1@sandbox ~]$ hdfs dfs -put test.txt /user/myuser 
put: Permission denied: user=mktg1, access=WRITE, inode="/user/myuser":hdfs:hdfs:d--------- &lt;/PRE&gt;&lt;P&gt;
File system permissions mean that no one is allowed to access the directory, but the Ranger policy allows mktg1 to read it, but not write.&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 20:05:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141759#M27944</guid>
      <dc:creator>agillan</dc:creator>
      <dc:date>2016-05-11T20:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger HDFS policy not taking effect even after restart</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141760#M27945</link>
      <description>&lt;P&gt;Simple example for better understand. Nice &lt;A rel="user" href="https://community.cloudera.com/users/214/agillan.html" nodeid="214"&gt;@Ana Gillan&lt;/A&gt; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 May 2016 20:47:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141760#M27945</guid>
      <dc:creator>aubaldi</dc:creator>
      <dc:date>2016-05-11T20:47:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger HDFS policy not taking effect even after restart</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141761#M27946</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/214/agillan.html" nodeid="214"&gt;@Ana Gillan&lt;/A&gt; &lt;A rel="user" href="https://community.cloudera.com/users/2648/sshimpi.html" nodeid="2648"&gt;@Sagar Shimpi&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks, got partial resolution. Ranger Hive plugin applies only to Hiveserver2 and not to CLI.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But &lt;/STRONG&gt;in below mentioned hive table file, how user mktg1 is able to query it using HIVE CLI?&lt;/P&gt;&lt;P&gt;[hive@sandbox ~]$  hadoop fs -ls /apps/hive/warehouse/xademo.db/customer_details/acct.txt &lt;/P&gt;&lt;P&gt;----------   3 hive hdfs       1532 2016-03-14 14:52 /apps/hive/warehouse/xademo.db/customer_details/acct.txt&lt;/P&gt;&lt;P&gt;[mktg1@sandbox ~]$ hive &lt;/P&gt;&lt;P&gt;hive&amp;gt; use xademo;
OK
Time taken: 1.737 seconds &lt;/P&gt;&lt;P&gt;hive&amp;gt;  select * from customer_details limit 10; &lt;/P&gt;&lt;P&gt;OK &lt;/P&gt;&lt;P&gt;PHONE_NUM       PLAN    REC_DATE        STAUS   BALANCE IMEI    REGION
5553947406      6290    20130328        31      0       012565003040464 R06
7622112093      2316    20120625        21      28      359896046017644 R02
5092111043      6389    20120610        21      293     012974008373781 R06
9392254909      4002    20110611        21      178     357004045763373 R04
7783343634      2276    20121214        31      0       354643051707734 R02
5534292073      6389    20120223        31      83      359896040168211 R06
9227087403      4096    20081010        31      35      356927012514661 R04
9226203167      4060    20060527        21      450     010589003666377 R04
9221154050      4107    20100811        31      3       358665019197977 R04
Time taken: 6.467 seconds, Fetched: 10 row(s)&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2016 19:33:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ranger-HDFS-policy-not-taking-effect-even-after-restart/m-p/141761#M27946</guid>
      <dc:creator>amittewari_5</dc:creator>
      <dc:date>2016-05-12T19:33:34Z</dc:date>
    </item>
  </channel>
</rss>

