CmdID

CmdID / aws / aws accessanalyzer

aws accessanalyzer check-access-not-granted

Checks whether the specified access isn't allowed by a policy. AWS CLI reference

1 example 3 options Its page in the AWS CLI reference

Opens CmdID with your command. It is read in your browser and sent nowhere.

Examples

from aws-cli, each command read by CmdID

To check whether the specified access isn't allowed by a policy

The following check-access-not-granted example checks whether the specified access isn't allowed by a policy.

aws accessanalyzer check-access-not-granted --policy-document file://myfile.json --access actions="s3:DeleteBucket","s3:GetBucketLocation" --policy-type IDENTITY_POLICYIdentify
--policy-documentThe JSON policy document to use as the content for the policy.
--accessAn access object containing the permissions that shouldn't be granted by the specified policy.
--policy-typeThe type of policy.

Contents of myfile.json:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::amzn-s3-demo-bucket",
                "arn:aws:s3:::amzn-s3-demo-bucket/*"
            ]
        }
    ]
}
Its output
{
    "result": "PASS",
    "message": "The policy document does not grant access to perform one or more of the listed actions."
}

For more information, see Previewing access with IAM Access Analyzer APIs in the AWS IAM User Guide.

Options

3 in the AWS CLI reference
--accessAn access object containing the permissions that shouldn't be granted by the specified policy.
--policy-documentThe JSON policy document to use as the content for the policy.
--policy-typeThe type of policy.