Checking Whether a Policy Has New Access
Function
This API is used to check whether a policy has new access.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
AccessAnalyzer::checkNoNewAccess |
Read |
- |
- |
- |
- |
URI
POST /v5/policies/check-no-new-access
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
existing_policy_document |
Yes |
String |
JSON policy document. |
|
new_policy_document |
Yes |
String |
JSON policy document. |
|
policy_type |
Yes |
String |
Type of the policy to be validated.
|
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
message |
String |
Whether the updated policy allows new access. |
|
check_result |
String |
Findings generated for the new access.
|
|
reasons |
Array of CheckNoNewAccessReason objects |
Statement description of a new action. |
Example Requests
Checking whether a policy has new access
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"
}
Example Responses
Status code: 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}"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
OK |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot