<?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: HDFS Policy 'resource path' with placeholder - is there some way ? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160865#M123250</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/5134/kaliyugantagonist.html" nodeid="5134"&gt;@Kaliyug Antagonist&lt;/A&gt;&lt;/P&gt;&lt;P&gt;HDFS has the ability to use ACLs (&lt;A href="http://hortonworks.com/blog/hdfs-acls-fine-grained-permissions-hdfs-files-hadoop/"&gt;here's a link&lt;/A&gt;). If you don't have Ranger, then you can use ACLs to provide finer grained authorization than you can with POSIX permissions. However, if using Ranger, there is more flexibility and you have a single place to manage authorization for all of the components (not just HDFS). So, if you're using Ranger, you don't really need you use HDFS ACLs.&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jun 2016 00:18:18 GMT</pubDate>
    <dc:creator>emaxwell</dc:creator>
    <dc:date>2016-06-29T00:18:18Z</dc:date>
    <item>
      <title>HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160857#M123242</link>
      <description>&lt;P&gt;I am trying to understand and practice Ranger configurations on the local HDP 2.4 sandbox.&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;&lt;U&gt;objective &lt;/U&gt;&lt;/STRONG&gt;is that when the users(existing in some LDAP group) log-in and try to access HDFS, they should be able to access only their 'home directory' and others like tmp.I did the following :&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a 'home directory' and for the users as well, note, the owner is still hdfs !. Suggestions welcome here e.g: Is this new /userhome dir. desirable or shall I use the existing /user directory ?&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;[hdfs@sandbox root]$ hdfs dfs -ls /userhome
Found 2 items
drwxr-xr-x   - hdfs hdfs          0 2016-06-27 14:24 /userhome/HBRDMV
drwxr-xr-x   - hdfs hdfs          0 2016-06-27 14:55 /userhome/ojoqcu&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;Disabled the default HDFS policy and created two new. The 'HadoopEcosystem' to ensure that the Hadoop users can execute their operations smoothly e.g the Hive CLI can be started by Hive user and used without access issues&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="5301-hdfs-policies.png" style="width: 1878px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/20705iA211BB7C90DEC412/image-size/medium?v=v2&amp;amp;px=400" role="button" title="5301-hdfs-policies.png" alt="5301-hdfs-policies.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In the 'RestrictiveHDFS' policy, I intend to achieve the &lt;STRONG&gt;&lt;U&gt;objective&lt;/U&gt;&lt;/STRONG&gt;. I have provided the 'Resource Path' accordingly&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="5302-restrictive-hdfs-policy-single-user.png" style="width: 1881px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/20706i8B2A2728723590E0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="5302-restrictive-hdfs-policy-single-user.png" alt="5302-restrictive-hdfs-policy-single-user.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I think it works, can anyone point out what I have missed to verify ?&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;[ojoqcu@sandbox ~]$ hdfs dfs -ls /userhome/HBRDMV
ls: Permission denied: user=ojoqcu, access=EXECUTE, inode="/userhome/HBRDMV":hdfs:hdfs:drwxr-x---


[ojoqcu@sandbox ~]$ hdfs dfs -mkdir /userhome/ojoqcu/code


[ojoqcu@sandbox ~]$[ojoqcu@sandbox ~]$ hdfs dfs -ls /userhome/ojoqcu
Found 1 item drwxr-xr-x   - ojoqcu hdfs          0 2016-06-28 11:33 /userhome/ojoqcu/code


[ojoqcu@sandbox ~]$ hdfs dfs -ls /userhome/
ls: Permission denied: user=ojoqcu, access=EXECUTE, inode="/userhome":hdfs:hdfs:drwxr-x---&lt;/PRE&gt;&lt;P&gt;Now, there may be aplenty users who will have their own directories under /userhome but only the single policy 'RestrictiveHDFS' would suffice, however, the 'Resource Path' doesn't provide a way to specify something like /userhome/{user} where {user} can be any of the from the 'Select User' list under 'User and Group Permissions'. How can I achieve this ?&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 11:57:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160857#M123242</guid>
      <dc:creator>kaliyugantagoni</dc:creator>
      <dc:date>2019-08-18T11:57:37Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160858#M123243</link>
      <description>&lt;P&gt;@Kaliyug wildcards are allowed in hdfs policy , so you can use as i mentioned in the following screenshot:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/5287-screen-shot-2016-06-28-at-53952-pm.png"&gt;screen-shot-2016-06-28-at-53952-pm.png&lt;/A&gt;&lt;/P&gt;&lt;P&gt;but here i will suggest you to do following steps:&lt;/P&gt;&lt;P&gt;1. do this for all the users:&lt;/P&gt;&lt;P&gt;use user home in hdfs  /user/&amp;lt;username&amp;gt; , and change owner to actual user : for ex: &lt;/P&gt;&lt;P&gt;chown HBRDMV:HBRDMV   /user/HBRDMV&lt;/P&gt;&lt;P&gt;chmod 700 -R /user/HBRDMV&lt;/P&gt;&lt;P&gt;2. and for tmp you can create a policy with recursive yes , and add all the users there &lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 19:20:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160858#M123243</guid>
      <dc:creator>dsharma</dc:creator>
      <dc:date>2016-06-28T19:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160859#M123244</link>
      <description>&lt;P&gt;But my main question is how can I grant access to all the users to only their own /user/{directory} ? Wildcards certainly won't help here, how do I proceed ?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 19:29:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160859#M123244</guid>
      <dc:creator>kaliyugantagoni</dc:creator>
      <dc:date>2016-06-28T19:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160860#M123245</link>
      <description>&lt;P&gt;you will have to create sep. policy for each resource /user/{directory}  , for ex. /user/HBRDMV will have sep. policy for user HBRDMV .&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 19:40:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160860#M123245</guid>
      <dc:creator>dsharma</dc:creator>
      <dc:date>2016-06-28T19:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160861#M123246</link>
      <description>&lt;P&gt;That's awful - if there are 100 users per service, those many policies per service need to be created. Is there something being missed or some better ways to do it ?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 20:25:28 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160861#M123246</guid>
      <dc:creator>kaliyugantagoni</dc:creator>
      <dc:date>2016-06-28T20:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160862#M123247</link>
      <description>&lt;P&gt;so in this case better approach will be make owner of that user home directory to the user , generally same user is the owner of the user home dir. &lt;/P&gt;&lt;P&gt;for ex: chown HBRDMV:HBRDMV /user/HBRDMV&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 20:43:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160862#M123247</guid>
      <dc:creator>dsharma</dc:creator>
      <dc:date>2016-06-28T20:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160863#M123248</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/5134/kaliyugantagonist.html" nodeid="5134"&gt;@Kaliyug Antagonist&lt;/A&gt;&lt;/P&gt;&lt;P&gt;HDFS security is multi-tiered:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Ranger authorization policies are checked first&lt;/LI&gt;&lt;LI&gt;HDFS ACLs implemented outside of Ranger&lt;/LI&gt;&lt;LI&gt;HDFS POSIX permissions (e.g. rwxr-xr-x)&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;So, what you can do for user home directories is to set the POSIX permissions to 700 and make sure the ownership is &amp;lt;username&amp;gt;:hdfs. This will ensure that only the user has access to his/her home directory. You don't need to create a Ranger policy to allow the access for this. You can do the same for the /tmp directory (set permissions to 777).&lt;/P&gt;&lt;P&gt;There are some &lt;A href="http://hortonworks.com/blog/best-practices-in-hdfs-authorization-with-apache-ranger/"&gt;best practices for securing HDFS with Ranger&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 21:49:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160863#M123248</guid>
      <dc:creator>emaxwell</dc:creator>
      <dc:date>2016-06-28T21:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160864#M123249</link>
      <description>&lt;P&gt;I got the point of HDFS POSIX permissions, however, I couldn't understand 'HDFS ACLs implemented outside of Ranger' - does this mean one that ACL and Ranger are 'mutually exclusive' ? If yes, what is that ACL is doing which Ranger cannot ? Can you check &lt;A target="_blank" href="https://community.hortonworks.com/comments/41453/view.html"&gt;this community thread&lt;/A&gt; which suggests that &lt;STRONG&gt;if you use Ranger, you need not work with ACL&lt;/STRONG&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 22:06:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160864#M123249</guid>
      <dc:creator>kaliyugantagoni</dc:creator>
      <dc:date>2016-06-28T22:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160865#M123250</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/5134/kaliyugantagonist.html" nodeid="5134"&gt;@Kaliyug Antagonist&lt;/A&gt;&lt;/P&gt;&lt;P&gt;HDFS has the ability to use ACLs (&lt;A href="http://hortonworks.com/blog/hdfs-acls-fine-grained-permissions-hdfs-files-hadoop/"&gt;here's a link&lt;/A&gt;). If you don't have Ranger, then you can use ACLs to provide finer grained authorization than you can with POSIX permissions. However, if using Ranger, there is more flexibility and you have a single place to manage authorization for all of the components (not just HDFS). So, if you're using Ranger, you don't really need you use HDFS ACLs.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2016 00:18:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160865#M123250</guid>
      <dc:creator>emaxwell</dc:creator>
      <dc:date>2016-06-29T00:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: HDFS Policy 'resource path' with placeholder - is there some way ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160866#M123251</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/users/5134/kaliyugantagonist.html"&gt;&lt;/A&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/6068-ranger-home-directory-policy.png"&gt;ranger-home-directory-policy.png&lt;/A&gt;@Kaliyug Antagonist We've found another neat solution to this, using a resource path of the form: "/user/${id}"&lt;/P&gt;&lt;P&gt;Credit to Naveed Hussain, who found it after we moaned a lot about the alternatives.&lt;/P&gt;&lt;P&gt;Screenshot attached.&lt;/P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;</description>
      <pubDate>Tue, 26 Jul 2016 15:01:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/HDFS-Policy-resource-path-with-placeholder-is-there-some-way/m-p/160866#M123251</guid>
      <dc:creator>robert_jones</dc:creator>
      <dc:date>2016-07-26T15:01:13Z</dc:date>
    </item>
  </channel>
</rss>

