<?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 many ranger policies and add users to them ? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197659#M159710</link>
    <description>&lt;P&gt;The Ranger REST API is best to programmatically create users and policies.&lt;/P&gt;&lt;P&gt;Here's how to create users, from an article on this site:&lt;BR /&gt;&lt;A href="https://community.hortonworks.com/content/supportkb/49439/how-to-use-api-curl-commands-to-create-internal-ra.html" target="_blank"&gt;https://community.hortonworks.com/content/supportkb/49439/how-to-use-api-curl-commands-to-create-internal-ra.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here's how to use the Ranger  REST API to create policies:&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management" target="_blank"&gt;https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please note the sections on Creating, Updating, Deleting policies.&lt;/P&gt;&lt;P&gt;To create for example, send a POST request to the following endpoint with the following body. This example is pulled from the link above.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;POST /service/public/api/policy&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "policyName": "HomePolicy",
  "resourceName": "\/home,\/apps",
  "description": "Home",
  "repositoryName": "hadoopdev",
  "repositoryType": "hdfs",
  "isEnabled": "true",
  "isRecursive": false,
  "isAuditEnabled": true,
  "permMapList": [
    {
      "userList": [
        "john",
        "andrew"
      ],
      "permList": [
        "SELECT",
        "UPDATE"
      ]
    },
    {
      "userList": [
        "hr"
      ],
      "groupList": [
        "admin"
      ],
      "permList": [
        "DROP",
        "ALTER",
        "ADMIN"
      ]
    }
  ]
}&lt;/PRE&gt;</description>
    <pubDate>Tue, 19 Sep 2017 20:31:35 GMT</pubDate>
    <dc:creator>anarasimham</dc:creator>
    <dc:date>2017-09-19T20:31:35Z</dc:date>
    <item>
      <title>How to create many ranger policies and add users to them ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197658#M159709</link>
      <description>&lt;P&gt;We have requirement where we have to create more that 1000+ policies, so what is the easiest way to create these?&lt;/P&gt;&lt;P&gt;Also how to add users to each policies ?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 19:58:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197658#M159709</guid>
      <dc:creator>SK1</dc:creator>
      <dc:date>2017-09-19T19:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to create many ranger policies and add users to them ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197659#M159710</link>
      <description>&lt;P&gt;The Ranger REST API is best to programmatically create users and policies.&lt;/P&gt;&lt;P&gt;Here's how to create users, from an article on this site:&lt;BR /&gt;&lt;A href="https://community.hortonworks.com/content/supportkb/49439/how-to-use-api-curl-commands-to-create-internal-ra.html" target="_blank"&gt;https://community.hortonworks.com/content/supportkb/49439/how-to-use-api-curl-commands-to-create-internal-ra.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Here's how to use the Ranger  REST API to create policies:&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management" target="_blank"&gt;https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Please note the sections on Creating, Updating, Deleting policies.&lt;/P&gt;&lt;P&gt;To create for example, send a POST request to the following endpoint with the following body. This example is pulled from the link above.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;POST /service/public/api/policy&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{
  "policyName": "HomePolicy",
  "resourceName": "\/home,\/apps",
  "description": "Home",
  "repositoryName": "hadoopdev",
  "repositoryType": "hdfs",
  "isEnabled": "true",
  "isRecursive": false,
  "isAuditEnabled": true,
  "permMapList": [
    {
      "userList": [
        "john",
        "andrew"
      ],
      "permList": [
        "SELECT",
        "UPDATE"
      ]
    },
    {
      "userList": [
        "hr"
      ],
      "groupList": [
        "admin"
      ],
      "permList": [
        "DROP",
        "ALTER",
        "ADMIN"
      ]
    }
  ]
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Sep 2017 20:31:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197659#M159710</guid>
      <dc:creator>anarasimham</dc:creator>
      <dc:date>2017-09-19T20:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to create many ranger policies and add users to them ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197660#M159711</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/23236/anarasimham.html" nodeid="23236"&gt;@anarasimham&lt;/A&gt;: Thanks for your quick response. can you help me to get how to add many users to a specific policy or one user to many policy ?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Sep 2017 20:42:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197660#M159711</guid>
      <dc:creator>SK1</dc:creator>
      <dc:date>2017-09-19T20:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to create many ranger policies and add users to them ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197661#M159712</link>
      <description>&lt;P&gt;Yes, you can add users to policies either through a CREATE or UPDATE as the second article above outlines. There is a parameter called 'userList' and you will be able to specify any number of users you'd like. To add one user to many policies, you will have to go one by one and add the user to each of the target policies.&lt;/P&gt;&lt;P&gt;Please refer to this link from above:&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management" target="_blank"&gt;https://cwiki.apache.org/confluence/display/RANGER/REST+APIs+for+Policy+Management&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 01:44:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197661#M159712</guid>
      <dc:creator>anarasimham</dc:creator>
      <dc:date>2017-09-20T01:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create many ranger policies and add users to them ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197662#M159713</link>
      <description>&lt;P&gt;Please use the following doc link. It documents the latest set of REST APIs supported by Ranger for policy management. &lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/RANGER/Apache+Ranger+0.6+-+REST+APIs+for+Service+Definition%2C+Service+and+Policy+Management" target="_blank"&gt;https://cwiki.apache.org/confluence/display/RANGER/Apache+Ranger+0.6+-+REST+APIs+for+Service+Definition%2C+Service+and+Policy+Management&lt;/A&gt;&lt;/P&gt;,</description>
      <pubDate>Thu, 21 Sep 2017 01:18:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197662#M159713</guid>
      <dc:creator>akulkarni1</dc:creator>
      <dc:date>2017-09-21T01:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to create many ranger policies and add users to them ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197663#M159714</link>
      <description>&lt;P&gt;thanks &lt;A rel="user" href="https://community.cloudera.com/users/23236/anarasimham.html" nodeid="23236"&gt;@anarasimham&lt;/A&gt;. &lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 19:55:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197663#M159714</guid>
      <dc:creator>SK1</dc:creator>
      <dc:date>2017-09-22T19:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to create many ranger policies and add users to them ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197664#M159715</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2273/saurabhmcakiet.html" nodeid="2273"&gt;@Saurabh&lt;/A&gt;: Why you want to create 1000+ policies? Can you try grouping the requirements and reduce the policies? Eg: achieve them via making user groups or DB level policies with different user permission set. Ranger API is def a solution for this but I would suggest to revisit the requirement and rule out as many duplicates as you can. &lt;/P&gt;&lt;P&gt;Just a suggestion, not saying your requirement is invalid!!!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2017 01:31:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/197664#M159715</guid>
      <dc:creator>shashant_panwar</dc:creator>
      <dc:date>2017-09-26T01:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create many ranger policies and add users to them ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/319859#M227996</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have a requirement like, i need to create hive policy with two groups .one group with "ALL" permissions to some "x" user and 2nd group with "select" permission to "y" user.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have created policy through REST APi with one group but with "all" permissions but how to mention 2nd group with "select" permission in same create policy command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Srini Podili&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 11:58:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-create-many-ranger-policies-and-add-users-to-them/m-p/319859#M227996</guid>
      <dc:creator>srinivasp</dc:creator>
      <dc:date>2021-07-05T11:58:32Z</dc:date>
    </item>
  </channel>
</rss>

