Creating a resource policy for a bucket using UI

Learn how to create a resource policy in Ranger to grant the permissions for a bucket using UI.

  1. Sign in to Cloudera Manager.
  2. In the left navigation, click Clusters.
  3. Select the relevant Ranger cluster.
  4. Click the Web UI dropdown menu and click one of the Ranger Admin Web UI. The Ranger log in page displays.
  5. Sign in to Ranger. The Ranger home page displays.
  6. In the left navigation pane, select Resource Policies, and then select cm_ozone.
  7. Click Add New Policy button. The Create Policy page displays.
    Figure 1. Create new policy in Ranger
  8. In the Policy Name box, enter a descriptive name for the policy. For example, iceberg bucket access.
  9. In the Resources section, perform the following steps:
    1. Make sure that the Ozone Volume drop-down menu value is set to Ozone Volume.
    2. In the Add policy Resources text box, enter the volume name (for example, s3v).
    3. Wait for few seconds and then select create [***VOLUME_NAME***] (for example, create s3v).
    4. Make sure that the Ozone Bucket drop-down menu value is set to Ozone Bucket.
    5. In the Add policy Resources text box, enter the bucket name (for example, iceberg).
    6. Wait for few seconds and then select create [***BUCKET_NAME***] (for example, create iceberg).
    7. Click the Ozone Key drop-down menu and select None. The Add policy Resources text box disables.
  10. In the Allow Rules section, perform the following actions:
    1. Under Select Roles, click the Select Roles dropdown menu,
    2. Select your target access role (for example, iceberg-data-all-access).
    3. Under Permissions, click the plus sign (+).
    4. Select the check box next to All, and then select the check mark at the bottom of the dialog box.
    5. Locate the row assigned to your target user or role (for example, iceberg-data-all-access).
    6. Under Rule Conditions, click the plus (+) button to add a new condition.
    7. Under Actions, select GetObject and PutObject.
    8. Click Save in the dialog box.
  11. Click Save.