01 Run get-credential-report command (OSX/Linux/UNIX) to obtain the IAM credential report for your AWS account. A credential report is a CSV document that lists all users (root and IAM users) currently available in your AWS account and the current status of their credentials:
aws iam get-credential-report
02 The command output should return the document in a TEXT/CSV format, encoded with the Base64 encoding scheme, e.g.:
{
"Content": "cmy5cixhcm4sdXNlcl9jcmVd ... bHNlLE4vQSxmYWxzZSxDBG3=",
"GeneratedTime": "2017-09-20T10:15:03Z",
"ReportFormat": "text/csv"
}
03 Decode the IAM credential report content from the command line (OSX/Linux/UNIX) using the Base64 string returned at the previous step as the input data. In the following example, the report is decoded and saved to a file named aws-iam-credentials-report.csv:
echo -n cmy5cixhcm4sdXNlcl9jcmVd ... bHNlLE4vQSxmYWxzZSxDBG3= | base64 –d >> aws-iam-credentials-report.csv
04 Open aws-iam-credentials-report.csv in your favorite file editor and check the value available in the password_next_rotation column for each listed AWS IAM user. The password_next_rotation attribute describes the date and time when the IAM user is required to set a new password according to the implemented password policy. The value for the AWS account (root user) is always set to not_supported. If your AWS account does have a password policy that requires password rotation, ensure that the IAM user passwords are changed according to the current password policy and skip the next steps within the audit section. If your AWS account does not have a password policy implemented yet, the password_next_rotation attribute value is set to N/A and you need to continue the audit process to get the IAM user passwords age.
05 Within aws-iam-credentials-report.csv file, check the value available in the password_last_changed column for each existing AWS IAM user. The password_last_changed attribute describes the date and time when an IAM user password was last set. If an existing IAM user does not have a password, the value for this attribute should be is N/A. Also, the value for the AWS account (root user) is always set to not_supported.
06 Based on the data available for the password_last_changed attribute, determine the age of your IAM user passwords. If the validity period for one or more AWS IAM user passwords is about to end soon, follow the Remediation/Resolution section instructions to reset these credentials to prevent their expiration and adhere to IAM security best practices.