Granting Specified Operation Permissions on Specified OBS Resources to IAM User Groups

Scenario

This case describes how to grant specified operation permissions on specified OBS resources to multiple IAM users or user groups under a HUAWEI CLOUD account. The specified resource can be a bucket or object.

Recommended Configuration

IAM custom policies

Configuration Precautions

After the configuration is complete, you can perform operations allowed by the permission using API or SDK. However, if you log in to the system using the console or OBS Browser+, a message is displayed indicating that you do not have the permission.

However, when you log in to OBS Console or OBS Browser+, more APIs (such as ListAllMyBuckets and ListBucket) are called to load the bucket list and object list. If your permissions do not cover the APIs for accessing OBS Console or OBS Browser+, obs:bucket:ListAllMyBuckets, and obs:bucket:ListBucket, your access is denied, or you are prompted that the operation is not allowed.

To allow IAM users to operate buckets and objects on OBS Console or OBS Browser+, add at least the obs:bucket:ListAllMyBuckets and obs:bucket:ListBucket permissions to the custom policy.

obs:bucket:ListAllMyBuckets applies to all resources. You need to select all resources.

obs:bucket:ListBucket applies only to the authorized bucket. You can select all resources or a specified bucket as needed.

Procedure

  1. Log in to HUAWEI CLOUD and click Console in the upper right corner.
  2. On the console, hover your cursor over the username in the upper right corner, and choose Identity and Access Management from the drop-down list.
  3. In the navigation pane, choose Permissions > Policies/Roles > Create Custom Policy.
  4. Configure parameters for a custom policy.

    Figure 1 Configuring a custom policy
    Table 1 Parameters for configuring a custom policy

    Parameter

    Description

    Policy Name

    Name of the custom policy

    Policy View

    Set this parameter based on your own habits. Example: Visual editor.

    Policy Content

    [Permission 1] This permission is mandatory when the authorized user needs to perform operations on OBS Console or OBS Browser+.

    • Select Allow.
    • Select Object Storage Service (OBS).
    • Select obs:bucket:ListAllMyBuckets from the actions.
    • Select All for resources.

    [Permission 2]

    • Select Allow.
    • Select Object Storage Service (OBS).
    • Select the actions to be authorized.

      For details about operations and permissions supported by OBS, see Bucket-Related Actions and Object-Related Actions.

    • Choose Specific resources > Bucket to specify bucket resources.

      [Format]

      obs:*:*:bucket:bucket name

      [Note]

      For bucket resources, IAM automatically generates the prefix of the resource path: obs:*:*:bucket:.

      For the path of a specific bucket, add the bucket name to the end. You can also add a wildcard character (*) to indicate any bucket. Example:

      obs:*:*:bucket:*, indicating any OBS bucket.

      To perform operations on OBS Console or OBS Browser+, grant the obs:bucket:ListBucket permission to a specified bucket.

    • Choose Specific resources > Object to specify an object resource.

      [Format]

      obs:*:*:object:bucket name/object name

      [Note]

      For object resources, IAM automatically generates the prefix of the resource path: obs:*:*:object:

      For the path of a specific object, add the bucket name/object name to the end. You can also add a wildcard character (*) to indicate any object in a bucket. Example:

      obs:*:*:object:my-bucket/my-object/*: any object in the my-object directory of the my-bucket bucket.

    Scope

    The default value is Global services.

  5. Click OK. The custom policy is created.
  6. Create a user group and assign permissions.

    Add the created custom policy to the user group by following the instructions in the IAM document.

  7. Add the IAM user to be authorized to the user group created by referring to Adding Users to or Removing Users from a User Group. The authorization is complete.

    Due to data caching, it takes about 10 to 15 minutes for a custom policy to take effect after the authorization.