Guide

AWS IAM Credential Report: How to Read It for an Access Review

What the AWS IAM credential report lists, how to download it, what each column and value means, what it leaves out, and how to use it in an access review.

Part of the guide User Access Review: How to Run One, Step by Step

11 min readLast updated

When your auditor asks how you know nobody who left can still get into AWS, the IAM credential report is a good first file to open. It takes a minute to download, and it covers every IAM user in an account. It is also easy to misread. This guide explains what it holds, what each value means, what it leaves out, and how to use it in a user access review.

The AWS IAM credential report is a CSV file AWS builds for one account. It lists every IAM user and the root user, whether each has a password, active access keys and MFA, and when the password and each key were last used. It shows which logins exist and which went unused. It does not show what users may do.

A few AWS words come up on this page:

  • IAM (Identity and Access Management) is the part of AWS that decides who can do what.
  • An IAM user is a login that lives in one AWS account. It can have a password, for the AWS console, and access keys.
  • An access key is a long-lived pair of codes that a program or a person’s command line uses to call AWS. AWS allows up to two per user.
  • The root user is the login created with the AWS account. It can do anything in the account.
  • MFA (multi-factor authentication) asks for a second check at sign-in, such as a code from a phone.
  • An IAM role is a set of permissions that a person or a program takes on for a while, with no password or key of its own.

What the IAM credential report includes

AWS’s page on generating credential reports describes a report of all users in the account and the status of their credentials. In practice that means:

  • One row per IAM user, and one row for the root user.
  • For each row: the password, the first two access keys, MFA, and up to two X.509 signing certificates.
  • When each user was created, when the password and each key were last used, and, for keys, the AWS service and Region of that last use.

It leaves out more than people expect:

  • Roles. AWS’s page on IAM roles says a role has no standard long-term credentials such as a password or access keys. With nothing to report, roles are not in the file.
  • People who sign in through IAM Identity Center or another identity provider. They reach the account through roles, so they are not in it either. AWS’s page on permission sets explains how Identity Center creates those roles.
  • Groups and policies. Nothing in the report says what a user is allowed to do. An unused admin and an unused read-only user look the same.
  • Other credentials. The report covers only the first two access keys per user. AWS says it leaves out service-specific credentials, such as CodeCommit passwords and Amazon Bedrock long-term API keys. For those, AWS points to the ListServiceSpecificCredentials and ListAccessKeys APIs.
  • Other accounts. Each report covers one AWS account, and there is no report for a whole AWS Organization. If you have twelve accounts, you need twelve reports: sign in to, or take on a role in, each account and download its own.

How to download the credential report

You need permission to call iam:GenerateCredentialReport and iam:GetCredentialReport. AWS gives a policy example with just those two.

From the IAM console

  1. Sign in to the AWS console and open IAM.
  2. In the navigation pane, choose Credential report.
  3. Choose Download Report. AWS saves a CSV file named status_reports_ followed by the date and time.

With the AWS CLI

AWS returns the report Base64-encoded, so decode it on the way to a file. The commands are in the get-credential-report reference:

aws iam generate-credential-report
until aws iam get-credential-report --query GeneratedTime --output text; do sleep 5; done
aws iam get-credential-report --query Content --output text | base64 --decode > credential-report.csv

Always run generate-credential-report first. Without it, get-credential-report fails with ReportNotPresent when there is no report yet, or ReportExpired when the last one has expired. While AWS is still building the report, it fails with ReportInProgress, which is why the second line waits and tries again. Once the report is ready, that line prints the time AWS built it. Write that time on the file. A review describes a moment, and the report you hold may be up to four hours old.

Two rules from AWS shape how you use it. AWS builds a new report at most once every four hours, and hands you the most recent one if you ask again sooner. And AWS stores a single report per account, so a new one replaces the last. Keep your own dated copy for the review record.

What each column means

The columns, in order, from AWS’s description of the report format. AWS’s documentation writes yes and no as TRUE and FALSE. The file you download may hold them in lower case, true and false, so compare them without regard to case. Some cells hold a word instead of a date: N/A means not applicable, no_information means AWS has no record, and not_supported is what the root user’s row always shows for password_next_rotation.

IAM credential report columns, from the AWS documentation
ColumnWhat it holdsWhat to watch for
user, arnThe user name and its full AWS name (ARN).Find the root user's row by its ARN, which ends in ":root". Its user column is not a person's name. A user name may contain commas.
user_creation_timeWhen the user was created.A new user may have no use yet. That is not the same as unused.
password_enabledTrue if the user has a console password.False means the user cannot sign in to the console. AWS says new member accounts of an organization show false on the root row, because they have no root credentials.
password_last_usedWhen the password was last used to sign in to an AWS website, such as the console.no_information means never used, or not used since October 20, 2014. N/A means no password.
password_last_changed, password_next_rotationWhen the password was last set, and when the account password policy says it must change.The next rotation holds a date only if your password policy requires rotation.
mfa_activeTrue if an MFA device is enabled for the user.A password with false here is a console login with one factor.
access_key_1_activeTrue if the user has a first access key and it is Active.An inactive key can be made active again.
access_key_1_last_rotatedWhen the key was created or last changed.Tells you the age of the key, not its use.
access_key_1_last_used_date, _region, _serviceWhen, in which Region and for which AWS service the key was last used to call AWS.N/A means no key, never used, or not used since April 22, 2015. The Region is also N/A when the service is not Region-specific, such as Amazon S3.
access_key_2_ columnsThe same five columns for the second key.AWS allows two keys so that one can replace the other.
cert_1_active, cert_1_last_rotated, cert_2_ columnsWhether each signing certificate is active, and when it was created or changed.Ask who uses an active one.
additional_credentials_infoFilled in when a user has more than two access keys or certificates. Since AWS allows two of each, it is normally empty.The report does not describe the extra ones. List them with the actions it names.

Five traps when you read it

“No use” has several meanings

no_information in password_last_used covers a password that was never used and one last used before October 20, 2014. N/A in a key’s last used date covers no key, a key never used, and a key last used before April 22, 2015. Read the _active column first. An active key with N/A is a key nobody recorded using. That is worth a question. It does not mean the key is safe to delete.

A gap in 2018

AWS says that, because of a service issue, password last used data leaves out sign-ins from May 3, 2018 22:50 PDT to May 23, 2018 14:08 PDT. A user whose last sign-in fell in that window shows their last sign-in before May 3, 2018 instead. Anyone with a sign-in after May 23, 2018 has an accurate date. Access key dates are not affected.

Times are only as fine as AWS records them

AWS records only the first use of a password in any five minutes, and the first use of a key in any fifteen. For a review this does not matter. For an investigation of who did what, use AWS CloudTrail, the service that records API calls, not this report.

Do not split the file on commas by hand

IAM user names can contain commas, as the CreateUser API reference shows in its allowed characters. A spreadsheet or a real CSV reader handles quoted values. A quick cut -d, or awk -F, does not, and shifts every column after the comma.

Unused is not the same as not needed

An emergency access user should go unused. So should a key used by a yearly job. A row flagged as unused needs a person to say whether it stays, with a reason. The reverse is true too: a user who changed teams and still signs in every day looks healthy in this report. That is how privilege creep, the slow build-up of access nobody removes, hides.

Checks to run for a review

These checks turn the report into a short list for reviewers. They follow AWS’s own advice on finding unused credentials and its root user best practices, which include not creating access keys for the root user.

What to look for in the credential report, and the question it raises
CheckColumnsQuestion for the reviewer
Console login not usedpassword_enabled is true, password_last_used older than your limit or no_informationDoes this person still need to sign in to the console?
Console login without MFApassword_enabled is true, mfa_active is falseWhy does this login have one factor only?
Active key not usedaccess_key_N_active is true, last used date older than your limit or N/ADoes a program or a person still need this key?
Old active keyaccess_key_N_active is true, last_rotated older than your rotation ruleWho owns this key, and when will it be replaced?
Root user with a keyRoot row, access_key_N_active is trueWhy does the root user have an access key at all?
User of someone who leftuser, matched against your staff and contractor listWho owns this login now?

The last check is the one the report cannot do alone. Compare the user names with your current staff and contractor list. A user that matches nobody is an orphaned account. A user that matches a program, such as a deploy job, needs a named owner: the service account governance guide explains how to give each one.

For engineers, here is a short script that runs the first five checks on a downloaded report, and also flags a root user without MFA unless its row says it has no password. It only reads the file. Pass the report, your limit for unused in days (90 if you leave it out), and your limit for key age in days (365 if you leave it out):

#!/usr/bin/env python3
# Reads an IAM credential report and prints one line per thing a reviewer should look at.
# Usage: python3 flag-credentials.py credential-report.csv [unused-days] [key-age-days]
import csv
import sys
from datetime import datetime, timezone

if len(sys.argv) < 2:
    sys.exit("usage: flag-credentials.py credential-report.csv [unused-days] [key-age-days]")
report = sys.argv[1]
days = int(sys.argv[2]) if len(sys.argv) > 2 else 90
key_days = int(sys.argv[3]) if len(sys.argv) > 3 else 365
now = datetime.now(timezone.utc)
NO_DATE = {"N/A", "no_information", "not_supported"}


def age(value):
    """Days since a date in the report, or None for the words that stand for no date."""
    if value in NO_DATE:
        return None
    return (now - datetime.fromisoformat(value.replace("Z", "+00:00"))).days


def yes(value):
    return value.strip().lower() == "true"  # the docs write TRUE, a file may hold true


out = csv.writer(sys.stdout, delimiter="\t")
with open(report, newline="", encoding="utf-8-sig") as f:
    for row in csv.DictReader(f):
        root = row["arn"].endswith(":root")
        who = "root user" if root else row["user"]
        flag = lambda text: out.writerow([who, text])
        created = age(row["user_creation_time"])
        new = created is not None and created < days  # too new to call unused
        has_password = yes(row["password_enabled"])
        if root and row["password_enabled"].strip().lower() != "false":
            has_password = True  # the root row may say not_supported here
        if has_password:
            used = age(row["password_last_used"])
            if used is None and not new:
                flag("has a password with no recorded sign-in")
            elif used is not None and used > days:
                flag(f"password last used {used} days ago")
            if not yes(row["mfa_active"]):
                flag("has a password and no MFA")
        for n in ("1", "2"):
            if not yes(row[f"access_key_{n}_active"]):
                continue
            if root:
                flag(f"root user has active access key {n}")
            used = age(row[f"access_key_{n}_last_used_date"])
            if used is None and not new:
                flag(f"active access key {n} has no recorded use")
            elif used is not None and used > days:
                flag(f"access key {n} last used {used} days ago")
            made = age(row[f"access_key_{n}_last_rotated"])
            if made is not None and made > key_days:
                flag(f"access key {n} created or changed {made} days ago")
        if row.get("additional_credentials_info", "N/A") not in ("", "N/A"):
            flag("has more keys or certificates than the report shows")

It needs Python 3.7 or later and nothing else. Each line it prints is a user name, a tab, and the reason to look. It does not flag a user created within your unused limit for having no recorded use. Run it on the file as downloaded: a spreadsheet that saves the file again can rewrite the dates, and the script then stops with an error rather than guess. For example, for a made-up user named tom with a console password, no MFA and an old key, its lines include has a password and no MFA and access key 1 last used 636 days ago. It uses the standard CSV reader, so commas in user names are safe.

How to use the report in a user access review

The report is one input to the review, not the review.

  1. Download a report for each account in scope, on the same day, and record the GeneratedTime of each.
  2. Add what each user may do. The report has no groups or policies. aws iam get-account-authorization-details, in the AWS CLI reference, returns every user, group and role in the account with the policies attached to each. It needs the iam:GetAccountAuthorizationDetails permission too. For each user it gives their own policies and the names of their groups, and each group’s policies are listed with the group. Join user to groups to policies, then to the report on the user name.
  3. Add the people who come in another way. If you use IAM Identity Center, export its assignments: which person or group holds which permission set in which account. They are not in the report, and they are often most of your people.
  4. Add the flags as columns. “Password last used 140 days ago” next to a line helps a reviewer decide in seconds. Roles are not in the report: if you need their use too, IAM Access Analyzer’s unused access findings cover them, as the IAM Access Analyzer guide explains.
  5. Send each line to someone who knows the work. People go to their manager. Users for programs go to the team that owns the program. Root and admin access gets a second look, as the privileged user access review guide explains.
  6. Make the removals and check them. Your admins deactivate or delete what reviewers rejected. Download a new report, at least four hours after the first, and check that each rejected key shows false in its _active column, or that the user is gone.
  7. Keep the record together. The dated reports, the list reviewers saw, each decision with its reviewer and reason, and the tickets for removals. The free user access review template has columns for each.

If your auditor asks how often, the frameworks differ. PCI DSS v4.0.1 requirement 7.2.4 says user accounts and access privileges are reviewed at least once every six months, and requirement 8.2.6 says inactive user accounts are removed or disabled within 90 days of inactivity. For IAM users, the report’s last-used dates help you find accounts with no use in 90 days. It does not cover people who come in through Identity Center. Accounts used by programs fall under requirement 7.2.5.1, where your own targeted risk analysis sets the interval. SOC 2 and ISO 27001 set no review interval: your own access control policy sets it, and the auditor tests that you kept to it.

Where Acciew fits

Acciew runs the review part for AWS. It asks AWS for the same credential report, and reads IAM users, groups and roles, the policies attached to each, who may assume each role, and when each user and role was last used. It shows each manager the access of their people, with how they got it, and asks for a yes or no from an email link. At the end it builds the evidence pack. It only reads, and your admins make every change. It does not read IAM Identity Center. It is in early access, with design partners first.

Have an access review coming up?

Acciew is in early access. We are looking for design partners: teams with a user access review ahead of them.

Apply as a design partner

Questions and answers

What is an IAM credential report?

It is a CSV file that AWS builds for one AWS account. It has one row for each IAM user and one for the root user, with the state of their password, access keys, MFA and signing certificates, and when the password and keys were last used. You download it from the IAM console, the AWS CLI or the IAM API.

How often can I generate a credential report?

AWS builds a new report at most once every four hours. If you ask again within four hours, you get the most recent report instead of a new one. AWS keeps only one report per account, and a new one replaces the old.

Does the credential report include IAM roles or IAM Identity Center users?

No. It lists IAM users and the root user only. Roles have no password or access keys of their own, and people who sign in through IAM Identity Center reach accounts through roles, so neither appears. To see roles and when they were last used, list them with the IAM console or the AWS CLI.

How do I find unused access keys in AWS?

Download the credential report and look at access_key_1_last_used_date and access_key_2_last_used_date for every key whose active column is true. N/A on an active key means AWS has no record of it being used. A date older than your limit, such as 90 days, means the key has not been used since.

Is the credential report enough for a user access review?

No. It shows which credentials exist and whether they were used, but not what each user is allowed to do, and it records no decision. A review also needs each user's groups and policies, a reviewer's yes or no for each access, and the removals that follow. Use the report as one column in that list.