version and a statement, and can also contain principal information. principal can only be used in policy syntax-related parameters in policy management APIs.
A statement is composed of several sub-statements. Each sub-statement contains four elements: action, resource, condition, and effect, where condition is optional.
{ } [ ] " , :
= < > ( ) |
[<resource_string>, < resource_string>, ...]<principal_map> = { <principal_map_entry>, <principal_map_entry>, ... }
"resource": [<resource_string>]"resource": <resource_string>
<condition_block?>
("allow" | "deny")
<version_block> = "version" : "2.0"
policy = {<version_block><principal_block?>,<statement_block>}<version_block> = "version" : "2.0"<statement_block> = "statement" : [ <statement>, <statement>, ... ]<statement> = {<effect_block>,<action_block>,<resource_block>,<condition_block?>}<effect_block> = "effect" : ("allow" | "deny")<principal_block> = "principal": ("*" | <principal_map>)<principal_map> = { <principal_map_entry>, <principal_map_entry>, ... }<principal_map_entry> = "qcs":[<principal_id_string>, <principal_id_string>, ...]<action_block> = "action":("*" | [<action_string>, <action_string>, ...])<resource_block> = "resource":("*" | [<resource_string>, <resource_string>, ...])<condition_block> = "condition" : { <condition_map> }<condition_map> {<condition_type_string> : { <condition_key_string> : <condition_value_list> },<condition_type_string> : { <condition_key_string> : <condition_value_list> }, ...}<condition_value_list> = [<condition_value>, <condition_value>, ...]<condition_value> = ("string" | "number")
statement.version_block can follow effect_block.principal_block element cannot be used in the console and can only be used through policy management APIs and policy syntax-related parameters.action and resource.condition_type, a condition key condition_key, and a condition value condition_value.effect of each statement is deny or allow. If the statement of a policy contains both allow and deny, deny will take precedence.// All operations for all products"action":"*""action":"*:*"// All operations in COS"action":"cos:*"// Operation named `GetBucketPolicy` in COS"action":"cos:GetBucketPolicy"// Operation for matching some buckets in COS"action":"cos:*Bucket*"// Operation list named `GetBucketPolicy\\PutBucketPolicy\\DeleteBucketPolicy` in COS"action":["cos:GetBucketPolicy","cos:PutBucketPolicy","cos: DeleteBucketPolicy"]
qcs: project :serviceType:region:account:resource
// COS object. Region: Shanghai. Resource owner uid: 10001234. Resource name: bucket1/object2.qcs::cos:sh:uid/10001234:prefix//10001234/bucket1/object2// CMQ queue. Region: Shanghai. Resource owner uin: 12345678. Resource name: 12345678/queueName1. Resource prefix: queueNameqcs::cmqqueue:sh:uin/12345678:queueName/12345678/queueName1// CVM instance. Region: Shanghai. Resource owner uin: 12345678. Resource name: ins-abcdefg. Resource prefix: instanceqcs::cvm:sh:uin/12345678:instance/ins-abcdefg
string_equal, string_not_equal, date_equal, date_not_equal, ip_equal, ip_not_equal, numeric_equal, and numeric_not_equal. Below are examples:"condition":{"string_equal":{"cvm:region":["sh","gz"]},"ip_equal":{"qcs:ip":"10.131.12.12/24"}}
qcs:current_time, qcs:ip, qcs:uin, qcs:owner_uin, etc. For more information, please see Condition.principal also uses a six-segment description. Below is an example. For more information, please see Resource Description Method."principal": {"qcs":["qcs::cam::uin/1238423:uin/3232","qcs::cam::uin/1238423:groupid/13"]}
Feedback