Identity and Access Management (IAM) controls who can do what in your cloud. AWS CloudTrail records every action for every identity. When combined, IAM data and CloudTrail logs become a source of truth for security and compliance. The challenge is turning that raw data into answers fast.
CloudTrail Query Runbooks solve this problem. A runbook is a repeatable set of queries that dig into specific IAM events—like failed login attempts, policy changes, or unusual access to sensitive resources. Instead of logging in to the console and clicking through menus, you define the queries once and run them anytime. This reduces human error and shortens investigation time.
Start with the essentials. Create queries for:
- IAM role or user policy updates
- Privilege escalations through inline policies
- Usage of long-unused IAM keys
- Access outside expected regions
Each query should filter on eventName, userIdentity, and sourceIPAddress. Store them in version-controlled files. Tie them to automation so they run on a schedule or trigger from alerts.