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