Skip to content
Export guide · Identity

How to export your AWS IAM configuration, and what we check in it

Where you run it: AWS CloudShell (the CloudShell icon in the AWS console's navigation bar; the AWS CLI is already installed) or the AWS CLI on your own computer, signed in with read-only IAM access.

In short

AWS IAM configuration export: the file AWS IAM writes of its own settings, which a configuration review reads setting by setting without connecting to AWS IAM.

How to export the AWS IAM configuration, step by step, what the review checks in the file (51 checks run), and what it does not read.

The fileJSON, one file (aws-iam.json) with four lists: UserDetailList, GroupDetailList, RoleDetailList and Policies
Checks run on it51
Highest grade its findings reachPROVEN
Feeds attack pathsYes
Not read from this export1 area, listed below

Sources: AWS IAM documentation (1); AWS IAM documentation (2); the vendor table.

How to export it

Who can pull it
An IAM user or role allowed iam:GetAccountAuthorizationDetails
Time
About 2 minutes; the command itself can take a minute or more on an account with hundreds of roles.
The file
JSON, one file (aws-iam.json) with four lists: UserDetailList, GroupDetailList, RoleDetailList and Policies

No console export: The steps use the command AWS documents for a snapshot of IAM users, groups, roles and policies (get-account-authorization-details); this guide gives no console download for it. AWS CloudShell runs the command inside the console, with no command line tools to install.

From the command line

  1. aws iam get-account-authorization-details --output json > aws-iam.json

    The vendor's page, checked 2026-11-11
  2. In CloudShell, choose Actions > Download file and enter aws-iam.json (on your own computer the file is already in the folder you ran the command in) (if Actions has no Download file, CloudShell opened in the console toolbar: choose Open in new browser tab, then Actions > Download file)

    The vendor's page, checked 2026-11-11

The script the steps run: AWS IAM export (one command).

What the file looks like

JSON, one file (aws-iam.json) with four lists: UserDetailList, GroupDetailList, RoleDetailList and Policies. It varies with the number of users, groups, roles and policies in the account: AWS documents no size. The upload takes files up to 10 MB.

What it holds: IAM users, groups and roles with their inline policy documents, attached policy names and tags, each role's trust policy and instance profiles, and the managed policies in the answer with their versions, in one file.

No long-lived secrets are in this file, but the policy documents are sensitive. Run these commands in bash (macOS, Linux, WSL, or AWS CloudShell): in Windows PowerShell 5.1, > writes UTF-16, which jq and the upload refuse.

Afterwards

In CloudShell, run rm aws-iam.json, and delete the downloaded copy on your computer. The steps create no key, token, user or role, so there is nothing to revoke. If IAMReadOnlyAccess, an inline policy or AWSCloudShellFullAccess was added for this export, ask your AWS administrator to remove it.

If the export goes wrong

What you seeThe fix
Access denied: "User: ... is not authorized to perform: iam:GetAccountAuthorizationDetails", or CloudShell does not start and says "Unable to start the environment. You don't have required permissions. Ask your IAM administrator to grant access to AWS CloudShell"Ask your AWS administrator for the inline policy with iam:GetAccountAuthorizationDetails, or to attach IAMReadOnlyAccess to your IAM user or role, then run the command again. If CloudShell will not start, ask for AWSCloudShellFullAccess as well, or run the commands with the AWS CLI on your own computer.
On your own computer, the command says it cannot find your AWS credentialsSign the AWS Command Line Interface (AWS CLI) in before you run the command (aws configure, or aws sso login --profile <your-profile> and add --profile <your-profile> to the command), or run it in AWS CloudShell, where you are already signed in.
The upload says "Invalid JSON" or "Could not recognize as IAM auth details or policy doc"Upload aws-iam.json exactly as the command wrote it (no --query, no --output table), written in bash or CloudShell, not Windows PowerShell 5.1, which writes the file as UTF-16.

What we read from it

Checks run
51
Formats read
aws iam get-account-authorization-details · Single IAM policy doc · aws iam get-account-password-policy · aws iam get-account-summary · IAM credential report (CSV download) · aws iam get-credential-report
Releases
2012-10-17 to current

Checks run is the number of checks that reached a result on this system's own export in our tests, as the vendor table shows it.

The areas checked

  • Every IAM user, group, role and instance profile, with attached and inline policy documents
  • Wildcard actions and resources, administrator access, privilege-escalation actions and iam:PassRole
  • Role trust policies: who can assume each role, external IDs, and conditions on federated and OIDC trust

The grade its findings reach

Proven A finding from this file can reach PROVEN: the stored file is read a second time by a separate reader, and the finding is found at the setting it names.

Its findings feed attack paths: each one can be a step on a path an attacker could take to your crown jewels.

Attack paths, the one change and dollar figures are MODELED. How each grade is worked out is on the method page.

What we do not read from this export

  • Service Control Policies at the organization level
  • AWS-managed policies statement by statement: just customer-managed and inline policies are read statement by statement
  • Resource-based policies on buckets, keys and queues
  • Password, MFA and access-key age: that is in the credential report, not this file

Limits of the reader

  • The checks of this system are not counted: a check counts once a test shows it firing on a file in the layout the vendor documents.

A finding never comes from what the file does not hold: live traffic, running hosts and logs are not in a configuration export.

A AWS IAM finding from the sample company

Sample company: Acme Capital (fictional)

PowerUserRole over-provisioned on production

CriticalObservedAWS IAM · role PowerUserRole › attached policies

Run the sample to see this finding with its fix and the paths it sits on.

Questions

Who can export the AWS IAM configuration?

An AWS Identity and Access Management (IAM) user or role that is allowed the action iam:GetAccountAuthorizationDetails (AWS access level: Read), because that is the one action the command calls. Narrowest: ask your AWS administrator for an inline policy with that action on Resource "*" (IAM console → Users or Roles → the name → Permissions → Add permissions → Create inline policy). Easier: the AWS managed policy IAMReadOnlyAccess. It allows more than this export uses: iam:Get*, iam:List*, iam:SimulateCustomPolicy, iam:SimulatePrincipalPolicy, and two actions that make IAM build a report, iam:GenerateCredentialReport and iam:GenerateServiceLastAccessedDetails. SecurityAudit, if you already have it, includes the same IAM actions. To run the commands in AWS CloudShell, the same user also needs CloudShell permissions. The quick way is the AWS managed policy AWSCloudShellFullAccess (cloudshell:*), which AWS says "Grants permission to use AWS CloudShell with full access to all features": opening the shell, uploading and downloading files, and deleting the CloudShell home directory. For less, AWS lists the actions one by one: cloudshell:CreateEnvironment, cloudshell:CreateSession, cloudshell:GetEnvironmentStatus and cloudshell:StartEnvironment to launch CloudShell, cloudshell:PutCredentials to use your console sign-in inside it, and cloudshell:GetFileDownloadUrls for Download file. CloudShell permissions allow no action in IAM, AWS Config or AWS WAF: the commands inside still need the permissions above. On your own computer none of this is needed.

Does the export change anything?

Nothing in IAM: the command calls one action, which AWS classes as Read. AWS CloudTrail records the call. In AWS CloudShell, launching the shell creates a compute environment, and aws-iam.json stays in its home directory until you delete it or 120 days pass after your last session in that Region.

Does the file hold passwords or keys?

No passwords, access keys or secret keys: the command's output has no field for them. Still sensitive, in clear text: user, group and role names, the account ID in every Amazon Resource Name (ARN), tags, the inline and managed policy documents, and each role's trust policy, which can name outside accounts and hold an sts:ExternalId condition value. With redaction on (the default), the passwords, keys and tokens the review recognises are replaced with a placeholder before anything is stored; the check before upload shows how many it found.