IAM policy structure

The following JSON document is an example that was created to describe some of the key features of IAM policy documents:

{    "Version": "2012-10-17",    "Statement": [        {            "Sid": "MyGeneralEC2Statement"            "Effect": "Allow",            "Action": "ec2:*",            "Resource": "*"        },        {            "Effect": "Allow",            "Action": [                "iam:GetUser"            ],            "Resource": "arn:aws:iam::123456789012:user/TestUser"        },        {            "Effect": "Allow",            "Action": "sts:AssumeRole",            "Resource": "*",            "Condition": {                "Bool": {                    "aws:MultiFactorAuthPresent": "true"                }            }        }    ]}

This policy has examples of some of the most common features of IAM policies. First, we have the Version key, which specifies the version of the policy language that is being used. The best practice is to use the latest version, which ...

Get Hands-On AWS Penetration Testing with Kali Linux now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.