# 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.

```json
{
  "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.

- Allows 73 actions (iam:Get*, iam:List*, iam:GenerateCredentialReport) on every resource.

Checks:
- No flags.

The wildcards include 34 Get actions and 38 List actions, among them reads of service-specific credentials and SSH public keys.

## Least privilege rewrite

```json
{
  "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.

- Allows 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.
- Allows 1 action (iam:GetCredentialReport) on every resource.

Checks:
- No flags.

- [Paste it into the workbench](/)
- [Every IAM action and its access level](/actions/iam/)

## Related pages

- [IAM policy example: use one KMS key to encrypt and decrypt](/examples/kms-encrypt-decrypt-one-key/)
- [IAM policy example: use a KMS key only through S3](/examples/kms-use-key-through-s3-only/)
- [IAM policy example: administer KMS keys without using them](/examples/kms-key-administrator-without-use/)
- [All of them](/examples/)

## Sources

- IAM User Guide: manage your own credentials: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_examples_iam_credentials_console.html (read 16 Nov 2026)
- IAM User Guide: grant a user permissions to pass a role: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html (read 16 Nov 2026)
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026): https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/examples/iam-read-only-audit/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
