Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

exporting ranger policies from source cluster to destination cluster

Highlighted

exporting ranger policies from source cluster to destination cluster

I want to export ranger polices from one cluster to another cluster' ranger .

I have downloaded entire policy at source with the help of below command http://<ranger_address>:6080/service/plugins/policies/download/<clustername>_hadoop

after executing above command i get complete details existing in the ranger at source cluster .

I am not aware of the rest api thorugh which this entire policy could be exported to the destination cluster' ranger .

if it gets exported and in the destination cluster already there are some policies for the user what would be impact when policies will be exported of source cluster's ranger to the destination cluster .

can we follow the below approach if yes what are the rest api available achieving the same :

instead of downloading ranger policy at its full , can we download a particular policy and then export it to the other cluster's ranger if yes could you please mention the rest api for the same downloading the policy and exporting it to destination cluster's ranger .

Thanks in Advance .

2 REPLIES 2

Re: exporting ranger policies from source cluster to destination cluster

there is export import feature in the ranger:

export rest call:

https://<ranger_host>:<ranger_port>/service/plugins/policies/exportJson

here you can specify the options to filter the policy too eg: policyNamePartial=test_policy so it will export all the policy having test_policy in itsname

import rest call:

https://<ranger_host>:<ranger_port>/service/plugins/policies/importPoliciesFromFile

other than this option is available on UI too for exporting from landing page and from report and for import from the landing page

Re: exporting ranger policies from source cluster to destination cluster

@Anurag Mishra

Starting HDP 2.6 you can export/import policies from Ranger Admin UI:

https://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.6.0/bk_security/content/import_export_resource_...

You can specify which repository polices you like to export and import.

HTH