Skip to content
IAM Policy Generator

IAM policy example: read IAM configuration for an audit, with a least privilege rewrite

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

  1. Allow 73 actions (iam:Get*, iam:List*, iam:GenerateCredentialReport) on every resource.

    Action or patternActionsAccess levels
    iam:Get*34List 2, Read 32
    iam:List*38List 38
    iam:GenerateCredentialReport1Read 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

  1. 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 patternActionsAccess levels
    iam:GetUser1Read 1
    iam:GetRole1Read 1
    iam:GetGroup1Read 1
    iam:ListUsers1List 1
    iam:ListRoles1List 1
    iam:ListGroups1List 1
    iam:ListAttachedRolePolicies1List 1
    iam:ListRolePolicies1List 1
    iam:GetRolePolicy1Read 1
    iam:GetPolicy1Read 1
    iam:GetPolicyVersion1Read 1
    iam:GenerateCredentialReport1Read 1
  2. Allow 1 action (iam:GetCredentialReport) on every resource.

    Action or patternActionsAccess levels
    iam:GetCredentialReport1Read 1

Checks

No flags from the six checks.

Sources

  1. IAM User Guide: manage your own credentials, read 16 Nov 2026
  2. IAM User Guide: grant a user permissions to pass a role, read 16 Nov 2026
  3. AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026), read 16 Nov 2026

Last reviewed 16 Nov 2026.