Visualize IAM credential reports for all AWS accounts using AWS Quick Sight
Parag Nagwekar and Arun Chandapillai, Amazon Web Services
Summary
Warning: IAM users have long-term credentials, which presents a security risk. To help mitigate this risk, we recommend that you provide these users with only the permissions they require to perform the task and that you remove these users when they are no longer needed. |
|---|
You can use AWS Identity and Access Management (IAM)
This pattern includes steps and code to help you create and share IAM credential reports for all the AWS accounts in your organization by using AWS Quick Sight dashboards. You can share the dashboards with stakeholders in your organization. The reports can help your organization achieve the following targeted business outcomes:
Identify security incidents related to IAM users
Track real-time migration of IAM users to single sign-on (SSO) authentication by using AWS IAM Identity Center
Track AWS Regions accessed by IAM users
Support your organization's security and compliance requirements
Share information with other stakeholders
Prerequisites and limitations
Prerequisites
An active AWS account
An organization
with member accounts An IAM role
with permissions to access accounts in Organizations AWS Command Line Interface (AWS CLI) version 2, installed
and configured
Architecture
Technology stack
Amazon Athena
Amazon EventBridge
AWS Quick Sight
Amazon Simple Storage Service (Amazon S3)
AWS Glue
AWS Identity and Access Management (IAM)
AWS Lambda
AWS Organizations
Target architecture
The following diagram shows an architecture for setting up a workflow that captures IAM credential report data from multiple AWS accounts.

EventBridge invokes a Lambda function daily.
The Lambda function assumes an IAM role in every AWS account across the organization. Then, the function creates the IAM credential report and stores the report data in a centralized S3 bucket. You must enable encryption and block public access on the S3 bucket.
An AWS Glue crawler crawls the S3 bucket daily and updates the Athena table accordingly.
Quick Sight imports and analyzes the data from the credential report and builds a dashboard that you can share with stakeholders.
Tools
AWS services
Amazon Athena
is an interactive query service that makes it easy to analyze data in Amazon S3 by using standard SQL. Amazon EventBridge
is a serverless event bus service that helps you connect your applications with real-time data from a variety of sources, such as home-grown applications, AWS services, and third-party software. It routes events to targets such as Lambda functions, HTTP invocation endpoints using API destinations, or event buses in other AWS accounts. AWS Quick Sight
is a cloud-scale business intelligence (BI) service that helps you visualize, analyze, and report your data in a single dashboard. Quick Sight is a core component within AWS Quick, providing interactive data visualization, in-memory analytics through the Super-fast, Parallel, In-memory Calculation Engine (SPICE), embedded analytics, and dashboard sharing. AWS Identity and Access Management (IAM)
helps you securely manage access to your AWS resources by controlling who is authenticated and authorized to use them. AWS Lambda
is a compute service that helps you run code without needing to provision or manage servers. It runs your code only when needed and scales automatically, so you pay only for the compute time that you use.
Code
The code for this pattern is available in the GitHub getiamcredsreport-allaccounts-org
Epics
| Task | Description | Skills required |
|---|---|---|
Set up AWS Quick Enterprise edition. |
| AWS administrator, AWS DevOps, Cloud administrator, Cloud architect |
Integrate AWS Quick Sight with Amazon S3 and Athena. | You must authorize | AWS administrator, AWS DevOps, Cloud administrator, Cloud architect |
| Task | Description | Skills required |
|---|---|---|
Clone the GitHub repository. |
| AWS administrator |
Deploy the infrastructure. |
| AWS administrator |
Create an IAM permission policy. | Create an IAM policy
| AWS DevOps, Cloud administrator, Cloud architect, Data engineer |
Create an IAM role with a trust policy. |
Important Replace Note Organizations typically use automation to create IAM roles for their AWS accounts. We recommend that you use this automation, if available. Alternatively, you can use the | Cloud administrator, Cloud architect, AWS administrator |
Configure AWS Quick Sight to visualize the data. |
| AWS DevOps, Cloud administrator, Cloud architect, Data engineer |
Additional information
Additional considerations
Consider the following:
After you use AWS CloudFormation to deploy the infrastructure, you can wait for Lambda and AWS Glue to run on their schedules to create the reports in Amazon S3 and analyze them with Athena. Alternatively, you can run the Lambda function manually to create the reports in Amazon S3, and then run the AWS Glue crawler to create the Athena table from the data.
Quick helps you analyze and visualize data based on your business requirements. You can use parameters
in Quick to control widget data based on data fields that you choose. You can also use a Quick analysis to create parameters from your dataset (for example, Account, Date, and User fields such as partition_0,partition_1, anduser, respectively) and add controls for those parameters.To build your own Quick Sight dashboards, see Quick Workshops
from the AWS Workshop Studio website. To see sample Quick Sight dashboards, see the GitHub getiamcredsreport-allaccounts-org
code repository.
Targeted business outcomes
You can use this pattern to achieve the following targeted business outcomes:
Identify security incidents related to IAM users – Investigate users across the AWS accounts in your organization from a single dashboard. You can track the trend of an IAM user’s most recently accessed individual AWS Regions and the services that they used.
Track real-time migration of IAM users to single sign-on authentication – By using AWS IAM Identity Center
, users can sign in once with a single credential and access multiple AWS accounts and applications. If you’re planning to migrate your IAM users to IAM Identity Center, this pattern can help you transition and track all IAM user credential usage (such as access to the AWS Management Console or usage of access keys) across all AWS accounts. Track AWS Regions accessed by IAM users – You can control IAM user access to Regions for various purposes, such as data sovereignty and cost control. You can also track use of Regions by any IAM user.
Support compliance efforts – By following the principle of least privilege, you can grant only the IAM permissions that are required to perform a specific task. You can also track access to AWS services, access to the AWS Management Console, and use of long-term credentials.
Share information with other stakeholders – You can share curated dashboards with other stakeholders, without granting them access to IAM credential reports or AWS accounts.