Introduction to OBS Permission Control
By default, OBS resources (buckets and objects) are private. Only resource owners can access their OBS resources. Without authorization, other users cannot access OBS. OBS permission control refers to granting permissions to other accounts or IAM users by editing access policies. For example, if you have a bucket, you can authorize another IAM user to upload objects to your bucket. You can also open buckets to non-public cloud users, so that anyone can access your buckets as public resources over the Internet. OBS offers multiple methods to help you to assign the resource permissions to others. Resource owners can formulate different permissions control schemes based on service requirements to ensure data security.
OBS Permission Control Model
OBS provides multiple permission control mechanisms, including IAM permissions, bucket policies, object ACLs, and bucket ACLs. Table 1 describes the mechanisms and application scenarios.
| Method | Description | Scenario |
|---|---|---|
| IAM Permissions | IAM permissions define the actions that can be performed on your cloud resources. In other words, IAM permissions specify what actions are allowed or denied. After an IAM user is created, the administrator needs to add the user to a group. IAM can grant the user group required OBS access permissions, and then all users in the group automatically inherit the permissions of the user group. |
|
| Bucket Policy | A bucket policy is attached to a bucket and objects in the bucket. Bucket owners can use bucket policies to grant IAM users or other accounts the permissions to operate buckets and objects in the buckets. Bucket policies supplement, and in many cases, replace ACLs of buckets and objects. |
|
| Object ACL | Controls access to objects for accounts or user groups. Object owners can configure the object access control list (ACL) to grant basic read and write permissions to specified accounts or user groups. NOTE:
|
|
| Bucket ACL | Controls access to buckets for accounts or user groups. Bucket owners can configure the bucket ACL to grant basic read and write permissions to specified accounts or user groups. NOTE:
|
|
Relationship Between OBS Permissions and IAM Permissions
OBS provides multiple permission control mechanisms, including time-limited access to objects, object ACLs, bucket ACLs, and bucket policies. Some service-level permissions (for example, creating a bucket and listing all buckets) cannot be configured through OBS and can only be configured on IAM. OBS permissions apply only to resources (buckets and objects). To grant both OBS service-level and resource-level permissions, you must use IAM permissions or both IAM and OBS permissions.
OBS Permission Control Elements
The following factors determine the authorization result:
- Principal (authorized user)
- Effect
- Resource
- Action
- Condition
For details about elements, see Bucket Policy Parameters.
Table 2 describes elements in different permission control mechanisms.
| Method | Principal | Supported Effect | Authorized Resource | Authorized Action | Condition Configuration |
|---|---|---|---|---|---|
| IAM Permissions | IAM user |
| All or specified OBS resources | All permissions to access OBS | Supported |
| Bucket Policy |
|
| Specified bucket and resources in the bucket | All permissions to access OBS | Supported |
| Object ACL |
| Allow | Specified object |
| Not supported |
| Bucket ACL |
| Allow | Specified bucket |
| Not supported |
How to Select IAM Permissions, Bucket Policies, and ACLs
Based on the advantages and disadvantages of the three elements, you are advised to preferentially use IAM permissions and bucket policies.
- Select IAM permissions in the following scenarios:
- Grant the same permissions to numerous IAM users under the same account.
- Grant the same permissions to all OBS resources or multiple buckets.
- Configure OBS service-level permissions, such as creating and listing buckets.
- Restrict the permissions of temporary access keys used for temporarily authorized access to OBS.
- Select bucket policies in the following scenarios:
- Grant permissions across accounts or grant permissions to anonymous users.
- Grant different permissions to different IAM users under the same account.
- Still do not know how to select?
Determine which problem you care more about:
- What the user can do - IAM permissions recommended
You can search for an IAM user and check the permissions of the user group to which the user belongs to know what the user can do.
- Who can access an OBS bucket - Bucket policies recommended
You can query the bucket and check the bucket policy to know who can access the bucket.
- What the user can do - IAM permissions recommended
You are advised to use the same element, because as the number of IAM permissions and bucket policies increase, permission maintenance becomes more difficult.
When to Select an ACL?
- As a supplement to IAM permissions and bucket policies:
IAM permissions and bucket policies have granted access permissions to an object set, but you want to grant access permissions to a single object.
- To allow an object to be accessible to all anonymous Internet users, configuring object ACL operations is more convenient.
When uploading an object, you can use the ACL header to specify the read and write permissions of the object.
Relationship Between Bucket ACLs and Bucket Policies
Bucket ACLs are used to control basic read and write access to buckets. Custom settings of bucket policies support more actions that can be performed on buckets. Bucket policies are a supplement to bucket ACLs. In most cases, you can directly use bucket policies to manage access to a bucket. Relationship Between Bucket Policies and Bucket ACLs shows the mapping between bucket ACL access permissions and bucket policy actions.
OBS Permission Control Principles
- Least privilege
Only the minimum permissions required for executing tasks are granted to IAM users or accounts. For example, if an IAM user only needs to upload and download objects to a specified directory, you can assign the user the read and write permissions to the directory instead of the whole bucket.
- Separation of duties
You are advised to use different IAM users under the same account to manage OBS resources and permissions. For example, use IAM user A to manage permissions, and use other IAM users to manage OBS resources.
- Restricted conditions
Configure refined conditions for bucket policies to restrict scenarios where a bucket policy takes effect, in order to enhance the security of resources in a bucket. For example, OBS is configured to accept only access requests from a specific IP address.
How Does the Authorization Mechanism Work When There Is Conflicts Between Access Control Methods?
In the OBS permission control elements, there are allow and deny effects, which indicate the permission to allow or deny an operation.
Based on the least-privilege principle, decisions default to deny, and an explicit deny statement always takes precedence over an allow statement. For example, IAM permissions grant a user access to an object, a bucket policy denies the user's access to that object, and there is no ACL. Then access will be denied.
If no method specifies an allow statement, then the request will be denied by default. Only if no method specifies a deny statement and one or more methods specify an allow statement, will the request be allowed. For example, if a bucket has multiple bucket policies with allow statements, the adding of a new bucket policy with an allow statement will simply add the allowed permissions to the bucket, but the adding of a new bucket policy with a deny statement will result in a re-arrangement of the permissions. The deny statement will take precedence over allow statements, even the denied permissions are allowed in other bucket policies.
Figure 4 is a matrix of the IAM permissions, bucket policies, and ACLs (allow and deny effects).
Concepts
- Account: An account is automatically created when you register with HUAWEI CLOUD. This account has full access permissions for the resources and IAM users under the account.
- IAM user: A user created by the administrator in IAM. An IAM user may be an employee, a system, or an application. An IAM user has access permissions to specified resources. IAM users have identity credentials (passwords and access keys) and can log in to the management console or call APIs.
- Anonymous user: A common visitor who has not registered with HUAWEI CLOUD.
- A log delivery user group: A user group who only delivers access logs of buckets and objects to the specified target bucket. OBS does not create or upload any file to a bucket automatically. Therefore, if you want to record access logs for a bucket, you need to grant the log delivery user group the permissions to deliver the access logs to your specified target bucket. This user group is only used to deliver internal logs of OBS.
Next Article: Permission Control Mechanisms

Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.