Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Shuai, Liu <liushuai65@huawei.com> Co-committed-by: Shuai, Liu <liushuai65@huawei.com>
14 KiB
Configuring a Bucket Policy
Bucket policies define the access control over resources (buckets and objects) in OBS.
Procedure
- Log in to OBS Browser+.
- Select the bucket you want and choose More > Bucket Policy. The window shown in Figure 1 is displayed.
- Enter a bucket policy in the following format.
- Grant permissions to an account. In the following example, the account (whose account ID is 783fc6652cf246c096ea836694f71855) is granted the permission required to obtain the log management information about bucket logging.bucket3.
{ "Statement": [ { "Sid": "testing", "Effect": "Allow", "Principal": { "ID": [ "domain/783fc6652cf246c096ea836694f71855:user/*" ] }, "Action": [ "GetBucketLogging" ], "Resource": [ "logging.bucket3" ] } ] }
Table 1 describes the parameters that you need to manually modify in the example above:Table 1 Parameter changes Item to Modify
Description
GetBucketLogging
Value of the Action field that indicates the operation set in the policy. The Action field indicates all operations supported by OBS and its values are strings of case-insensitive characters. The value supports a wildcard character (*) that indicates all actions, for example, "Action":["List*", "Get*"]. You need to change the value as needed. For the actions supported by OBS, see .
Allow
Value of the Effect field that indicates whether the permission in the policy is allowed or denied. The value must be Allow or Deny.
logging.bucket3
The bucket on which the policy works. You can change the bucket name as needed.
783fc6652cf246c096ea836694f71855
ID of an account. You can change it as needed. You can obtain the account ID on the bucket's Basic Information page.
- Grant permissions to an IAM user. In the following example, the user (whose ID is 71f3901173514e6988115ea2c26d1999) under the account (whose ID is 219d520ceac84c5a98b237431a2cf4c2) is assigned the permission required to set log management for bucket logging.bucket3.
{ "Statement": [ { "Sid": "testing", "Effect": "Allow", "Principal": { "ID": [ "domain/219d520ceac84c5a98b237431a2cf4c2:user/71f3901173514e6988115ea2c26d1999" ] }, "Action": [ "PutBucketLogging" ], "Resource": [ "logging.bucket3" ] } ] }
Table 2 describes the parameters that you need to manually modify in the example above:
For details about the fields in a bucket policy, see .
- Grant permissions to an account. In the following example, the account (whose account ID is 783fc6652cf246c096ea836694f71855) is granted the permission required to obtain the log management information about bucket logging.bucket3.