<?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: Ranger policy not working in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176937#M139187</link>
    <description>&lt;P&gt;What do you exactly mean by "if an user arun is trying to access hdfs"? Are you trying to access a file/folder with the "hadoop fs" command while you are logged into linux as user "arun"?&lt;/P&gt;</description>
    <pubDate>Tue, 28 Mar 2017 18:53:07 GMT</pubDate>
    <dc:creator>bpgergo</dc:creator>
    <dc:date>2017-03-28T18:53:07Z</dc:date>
    <item>
      <title>Ranger policy not working</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176936#M139186</link>
      <description>&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/14131-ranger-screenshot.png"&gt;ranger-screenshot.png&lt;/A&gt;I am using the default policy for HDFS provided after ranger installation. IT is not working as expected. &lt;/P&gt;&lt;P&gt;this is my hdfs permission . Attached is the screeshot of ranger policy. now if an user arun is trying to access hdfs, he shouldnt be as only hadoop,rangerlookupuser and ambari-qa have the permissions as per the policy. Am i doing anything wrong. Or how do i restrict an user named arun using ranger. any thoughts would be grear&lt;/P&gt;&lt;PRE&gt; hadoop fs -ls /
Found 9 items
drwxrwxrwx   - yarn   hadoop          0 2017-03-14 05:48 /app-logs
drwxr-xr-x   - hdfs   hdfs            0 2017-03-14 05:45 /apps
drwxr-xr-x   - yarn   hadoop          0 2017-03-14 05:45 /ats
drwxr-xr-x   - hdfs   hdfs            0 2017-03-14 05:46 /hdp
drwxr-xr-x   - mapred hdfs            0 2017-03-14 05:46 /mapred
drwxrwxrwx   - mapred hadoop          0 2017-03-14 05:46 /mr-history
drwxr-xr-x   - hdfs   hdfs            0 2017-03-28 07:39 /ranger
drwxrwxrwx   - hdfs   hdfs            0 2017-03-28 04:54 /tmp
drwxr-xr-x   - hdfs   hdfs            0 2017-03-28 09:54 /user




&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Mar 2017 17:17:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176936#M139186</guid>
      <dc:creator>arunpoy</dc:creator>
      <dc:date>2017-03-28T17:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger policy not working</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176937#M139187</link>
      <description>&lt;P&gt;What do you exactly mean by "if an user arun is trying to access hdfs"? Are you trying to access a file/folder with the "hadoop fs" command while you are logged into linux as user "arun"?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 18:53:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176937#M139187</guid>
      <dc:creator>bpgergo</dc:creator>
      <dc:date>2017-03-28T18:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger policy not working</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176938#M139188</link>
      <description>&lt;P&gt;Yes, the user arun issues a command&lt;/P&gt;&lt;P&gt;hadoop fs -ls /&lt;/P&gt;&lt;P&gt;Since ranger allows only 3 users as mentioned in the screenshot. arun should not be able to access / (in hdfs). but it is not the case&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 19:08:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176938#M139188</guid>
      <dc:creator>arunpoy</dc:creator>
      <dc:date>2017-03-28T19:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger policy not working</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176939#M139189</link>
      <description>&lt;P&gt;@ARUN&lt;/P&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;HDFS permissions is managed by a combination of ranger + native HDFS permissions (POSIX). Just because you've set ranger policies for those 3 users, doesnt mean they are the only users who are allowed to access HDFS. In your case, arun is still able to access hdfs because all folders in HDFS have 'r' access for others (eg. /tmp - drwxrwxrwx) &lt;/P&gt;&lt;P&gt;The link below has best practicess in managing HDFS permissions with ranger and native hadoop permissions:&lt;/P&gt;&lt;P&gt;&lt;A href="https://hortonworks.com/blog/best-practices-in-hdfs-authorization-with-apache-ranger/" target="_blank"&gt;https://hortonworks.com/blog/best-practices-in-hdfs-authorization-with-apache-ranger/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;One of the important steps is to change HDFS umask to 077 from 022. This will prevent any new files or folders to be accessed by anyone other than the owner. &lt;/P&gt;&lt;P&gt;As an example you can do the below:&lt;/P&gt;&lt;P&gt;As hdfs user:&lt;/P&gt;&lt;P&gt;1. hdfs dfs -mkdir /tmp/ranger_test&lt;/P&gt;&lt;P&gt;2 hdfs dfs -chmod 700 /tmp/ranger_test (folder permission becomes "drwx------" - changing umask to 077 will do this for future files) &lt;/P&gt;&lt;P&gt;3. switch to ARUN user&lt;/P&gt;&lt;P&gt;4. hdfs dfs -ls /tmp/ranger_test (you should get an error along the lines of: "&lt;/P&gt;&lt;P&gt;ls: Permission denied: user=arun, access=READ_EXECUTE, inode="/tmp/ranger_test":hdfs:hdfs:drwx------"&lt;/P&gt;&lt;P&gt;5. Add a policy in ranger to allow arun access to /tmp/ranger_test&lt;/P&gt;&lt;P&gt;6. try to access the /tmp/ranger_test folder with arun &lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2017 20:56:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176939#M139189</guid>
      <dc:creator>mliem</dc:creator>
      <dc:date>2017-03-28T20:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Ranger policy not working</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176940#M139190</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2302/arunpoy.html" nodeid="2302"&gt;@ARUN&lt;/A&gt; HDFS acls are used as fallback when no ranger policy exist for any given HDFS resource. You may turn off xasecure.add-hadoop-authorization flag under HDFS configs to have only ranger acls.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2017 01:59:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Ranger-policy-not-working/m-p/176940#M139190</guid>
      <dc:creator>ssanthosh</dc:creator>
      <dc:date>2017-03-29T01:59:34Z</dc:date>
    </item>
  </channel>
</rss>

