校验策略是否有新访问权限 - CheckNoNewAccess
功能介绍
校验策略是否有新访问权限。
授权信息
账号根用户具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备如下身份策略权限,更多的权限说明请参见权限和授权项。
授权项 | 访问级别 | 资源类型(*为必须) | 条件键 | 别名 | 依赖的授权项 |
|---|---|---|---|---|---|
AccessAnalyzer::checkNoNewAccess | Read | - | - | - | - |
URI
POST /v5/policies/check-no-new-access
请求参数
参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
existing_policy_document | 是 | String | 该策略JSON格式策略文档。 |
new_policy_document | 是 | String | 该策略JSON格式策略文档。 |
policy_type | 是 | String | 要校验的策略类型。
|
响应参数
状态码:200
参数 | 参数类型 | 描述 |
|---|---|---|
message | String | 更新后的策略是否允许新访问权限的消息。 |
check_result | String | 检查新访问权限的结果。
|
reasons | Array of CheckNoNewAccessReason objects | 新增action的statement描述。 |
请求示例
校验策略是否有新访问权限。
POST https://{hostname}/v5/policies/check-no-new-access
{
"existing_policy_document" : "{\\\"Version\\\":\\\"5.0\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Action\\\":[\\\"iam:users:createUserV5\\\"]}]}",
"new_policy_document" : "{\\\"Version\\\":\\\"5.0\\\",\\\"Statement\\\":[{\\\"Effect\\\":\\\"Allow\\\",\\\"Action\\\":[\\\"iam:users:createUserV5\\\",\\\"obs:bucket:createBucket\\\"]}]}",
"policy_type" : "identity_policy"
} 响应示例
状态码:200
OK
{
"check_result" : "fail",
"message" : "The modified permissions grant new access compared to your existing policy.",
"reasons" : [ {
"description" : "New access in the statement with sid: {statement_sid}.",
"statement_index" : 0,
"statement_id" : "{statement_sid}"
} ]
} 状态码
状态码 | 描述 |
|---|---|
200 | OK |
错误码
请参见错误码。

