ValidatePolicy - Access Analyzer

ValidatePolicy

Requests the validation of a policy and returns a list of findings. The findings help you identify issues and provide actionable recommendations to resolve the issue and enable you to author functional policies that meet security best practices.

Request Syntax

POST /policy/validation?maxResults=maxResults&nextToken=nextToken HTTP/1.1 Content-type: application/json { "locale": "string", "policyDocument": "string", "policyType": "string" }

URI Request Parameters

The request uses the following URI parameters.

maxResults

The maximum number of results to return in the response.

nextToken

A token used for pagination of results returned.

Request Body

The request accepts the following data in JSON format.

locale

The locale to use for localizing the findings.

Type: String

Valid Values: DE | EN | ES | FR | IT | JA | KO | PT_BR | ZH_CN | ZH_TW

Required: No

policyDocument

The JSON policy document to use as the content for the policy.

Type: String

Required: Yes

policyType

The type of policy to validate. Identity policies grant permissions to IAM principals. Identity policies include managed and inline policies for IAM roles, users, and groups. They also include service-control policies (SCPs) that are attached to an AWS organization, organizational unit (OU), or an account.

Resource policies grant permissions on AWS resources. Resource policies include trust policies for IAM roles and bucket policies for S3 buckets. You can provide a generic input such as identity policy or resource policy or a specific input such as managed policy or S3 bucket policy.

Type: String

Valid Values: IDENTITY_POLICY | RESOURCE_POLICY | SERVICE_CONTROL_POLICY

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "findings": [ { "findingDetails": "string", "findingType": "string", "issueCode": "string", "learnMoreLink": "string", "locations": [ { "path": [ { "index": number, "key": "string", "substring": { "length": number, "start": number }, "value": "string" } ], "span": { "end": { "column": number, "line": number, "offset": number }, "start": { "column": number, "line": number, "offset": number } } } ] } ], "nextToken": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

findings

The list of findings in a policy returned by Access Analyzer based on its suite of policy checks.

Type: Array of ValidatePolicyFinding objects

nextToken

A token used for pagination of results returned.

Type: String

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have sufficient access to perform this action.

HTTP Status Code: 403

InternalServerException

Internal server error.

HTTP Status Code: 500

ThrottlingException

Throttling limit exceeded error.

HTTP Status Code: 429

ValidationException

Validation exception error.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: