Adding a policy label to a resource-based policy

You can add a label to a resource-based policy, using Ranger Admin Web UI when creating a new, or editing an existing policy.

Ranger Admin Web UI supports adding one or more labels to a new or existing resource-based policy for CDP services. The Policy Label field displays all current labels created for a policy. Policy lables:
  • Allow users to group sets of policies, using one or more lables.
  • Enables users to search (filter) all policies using policy labels from both the Service Manager > Policy Details or Service Manager > Reports pages.
  • Enables users to filter and export the filtered list of policies based on the policy label.

How to create a label for a policy

  1. In Service Manager > Resource Policies > cm_hdfs_policies (for example), choose one of the following:
    Add New Policy
    to add a new, tag-based policy.
    Policy ID
    click a policy ID to edit an existing policy.
  2. In either Create Policy or Edit Policy > Policy Conditions > Policy Label, type or select a policy lable string.
  3. Click Save.
To filter existing policies by label from Resource Policies > Search, select Policy Label, then type a lable name, as shown in the following example:
Figure 1. Filtering Resource-based policies for HDFS service by label
Filtering Resource-based policies for HDFS service by label
To export a set of policies having the same label, filter as shown, using Service Manager > Reports > Policy Label (select) > Search in the following example. Then, choose Export.
Figure 2. Exporting a list of policies filtered by label
Exporting a list of HDFS policies filtered by label