IAM policy example: read IAM configuration for an audit, with a least privilege rewrite
Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.
Allows an auditor to read IAM users, roles, groups, policies and the credential report without changing anything. The Get and List wildcards expand to 34 and 38 actions. The rewrite lists twelve read actions an access review uses. The names and the account ID 111122223333 are AWS documentation placeholders.
Open the workbench ยท All examples
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadIam",
"Effect": "Allow",
"Action": [
"iam:Get*",
"iam:List*",
"iam:GenerateCredentialReport"
],
"Resource": "*"
}
]
}
What it allows
- Allows every IAM action that starts with Get or List, plus credential report generation, on all resources.
What it allows
Allow 73 actions (iam:Get*, iam:List*, iam:GenerateCredentialReport) on every resource.
Action or pattern Actions Access levels iam:Get*34 List 2, Read 32 iam:List*38 List 38 iam:GenerateCredentialReport1 Read 1
Checks
No flags from the six checks.
The wildcards include 34 Get actions and 38 List actions, among them reads of service-specific credentials and SSH public keys.
Least privilege rewrite
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadIdentities",
"Effect": "Allow",
"Action": [
"iam:GetUser",
"iam:GetRole",
"iam:GetGroup",
"iam:ListUsers",
"iam:ListRoles",
"iam:ListGroups",
"iam:ListAttachedRolePolicies",
"iam:ListRolePolicies",
"iam:GetRolePolicy",
"iam:GetPolicy",
"iam:GetPolicyVersion",
"iam:GenerateCredentialReport"
],
"Resource": "*"
},
{
"Sid": "ReadCredentialReport",
"Effect": "Allow",
"Action": "iam:GetCredentialReport",
"Resource": "*"
}
]
}
The rewrite lists twelve actions plus the credential report download. Reads of service-specific credentials and SSH keys are removed.
What it allows
Allow 12 actions (iam:GetUser, iam:GetRole, iam:GetGroup, iam:ListUsers, iam:ListRoles, iam:ListGroups, iam:ListAttachedRolePolicies, iam:ListRolePolicies, iam:GetRolePolicy, iam:GetPolicy, iam:GetPolicyVersion, iam:GenerateCredentialReport) on every resource.
Action or pattern Actions Access levels iam:GetUser1 Read 1 iam:GetRole1 Read 1 iam:GetGroup1 Read 1 iam:ListUsers1 List 1 iam:ListRoles1 List 1 iam:ListGroups1 List 1 iam:ListAttachedRolePolicies1 List 1 iam:ListRolePolicies1 List 1 iam:GetRolePolicy1 Read 1 iam:GetPolicy1 Read 1 iam:GetPolicyVersion1 Read 1 iam:GenerateCredentialReport1 Read 1 Allow 1 action (iam:GetCredentialReport) on every resource.
Action or pattern Actions Access levels iam:GetCredentialReport1 Read 1
Checks
No flags from the six checks.
Related pages
Sources
- IAM User Guide: manage your own credentials, read 16 Nov 2026
- IAM User Guide: grant a user permissions to pass a role, read 16 Nov 2026
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026
Last reviewed 16 Nov 2026.