AWS Builder Center
Who Changed What in AWS? Understanding CloudTrail for Security Monitoring

Who Changed What in AWS? Understanding CloudTrail for Security Monitoring

Discover how AWS CloudTrail helps monitor account activity, track API calls, and investigate unexpected changes. Learn about management events, data events, CloudTrail logs, and how security teams use CloudTrail alongside CloudWatch and EventBridge to strengthen AWS security monitoring.



Introduction

Imagine opening your AWS account and discovering that an IAM policy has been modified, a new user has been created, or a resource has been deleted. The immediate questions are simple:
  • Who performed the action?
  • When did it happen?
  • Which resource was affected?
  • Was the activity expected or suspicious?
In cloud security, identifying an unexpected change is only the beginning. We also need a reliable way to investigate the activity behind it.
This is where AWS CloudTrail becomes important.
CloudTrail helps record activity in an AWS account, giving administrators, developers, auditors, and security teams a way to investigate actions performed through the AWS Management Console, AWS CLI, SDKs, and service APIs.
In this article, we'll explore how CloudTrail works, what its events contain, and how it can support a basic security investigation.

1. What is AWS CloudTrail?

AWS CloudTrail is an AWS service that records account activity as events. These events provide information about API requests and other supported activity within an AWS environment.
For example, CloudTrail can help you investigate actions such as:
  • Creating or deleting IAM users.
  • Attaching or modifying IAM policies.
  • Starting or terminating EC2 instances.
  • Changing security group rules.
  • Making API requests to AWS services.
  • Accessing supported data resources when the relevant data events are enabled.
Think of CloudTrail as an audit trail for activity in your AWS environment.
It helps answer questions about what happened and provides evidence that can be reviewed during troubleshooting, auditing, or security investigations.
However, CloudTrail is primarily a recording and visibility service. Recording an event does not automatically mean CloudTrail will block the action or alert you about it.

2. Understanding the Different Types of Events

Before investigating activity, it's important to understand the event categories you may encounter.

Management events

Management events record control-plane operations involving the configuration and management of AWS resources.
Examples include:
  • Creating an IAM user.
  • Changing a security group rule.
  • Modifying an IAM policy.
  • Creating an EC2 instance.
Management events are especially useful when investigating unexpected configuration changes or administrative activity.

Data events

Data events record certain resource-level operations, depending on the supported service and event configuration.
Examples include:
  • Reading an object from an S3 bucket.
  • Uploading an object to an S3 bucket.
  • Invoking a Lambda function.
Data events can be important when investigating activity involving application data. They generally need to be explicitly configured for the resources and event types you want to monitor.

Insights events

CloudTrail Insights can help identify unusual patterns in supported API activity, such as abnormal increases in API call volume or error rates.
Insights is different from ordinary event logging: it analyzes activity patterns to identify potential anomalies, and its availability depends on the supported Insights event types and configuration.
Important distinction: CloudTrail Event history displays management events, not data events or Insights events. If you need broader or longer-term visibility, configure an appropriate trail or CloudTrail Lake event data store.

3. What Information Does a CloudTrail Event Contain?

A CloudTrail event contains fields that help explain the request and its context.
Some useful fields include:
Field
Why it matters
 eventTime 
Shows when the event occurred
 eventName 
Identifies the requested action
 eventSource 
Identifies the AWS service involved
 userIdentity 
Provides information about the identity associated with the request
 sourceIPAddress 
Shows the source IP address when available
 awsRegion 
Identifies the AWS Region associated with the event
 requestParameters 
May contain details about the request
 errorCode 
Can indicate that the request failed
For example, an event involving an IAM policy change could help an investigator identify the action, the associated identity, the time, and the relevant request details.
Not every event contains every field, and some values may be omitted, redacted, or represented differently depending on the service and request.
It is also important not to treat an IP address or username as conclusive proof of who was operating an account. Investigators need to consider the full context, including temporary credentials, assumed roles, automation, and other related events.

4. A Practical Scenario: Investigating an Unexpected IAM Policy Change

Let's consider a hypothetical scenario.
A team discovers that an IAM policy was modified, potentially granting broader permissions than intended. The team needs to understand what happened before deciding how to respond.

Step 1: Open CloudTrail Event history

Sign in to the AWS Management Console, open CloudTrail, and select Event history.
Event history provides a searchable view of the previous 90 days of management events for the selected AWS Region.
Remember that Event history is regional. If the action may have occurred in another Region, investigate the relevant Region as well.

Step 2: Search for the relevant action

Narrow the search by time and look for events related to the suspected change.
Depending on the operation, relevant event names may include:
  •  PutUserPolicy 
  •  AttachUserPolicy 
  •  PutRolePolicy 
  •  AttachRolePolicy 
  •  CreatePolicyVersion 
The appropriate event name depends on how the policy was changed. These examples are useful starting points, not an exhaustive list.

Step 3: Examine the event details

Open a relevant event and inspect its event record.
Ask the following questions:
  • Which IAM identity or assumed role made the request?
  • When did it occur?
  • Which AWS Region was involved?
  • What resource or policy was affected?
  • Did the request succeed or fail?
  • Do the request parameters provide useful context?

Step 4: Correlate related activity

One event rarely tells the complete story.
Review nearby events to understand whether the action was preceded by a sign-in, role assumption, other permission changes, or additional resource modifications.
Compare the activity with the team's expected changes, deployment records, and approved administrative work.
A change made by an authorized administrator may be legitimate. An unexpected change deserves further investigation, but an unfamiliar IP address or unusual timestamp alone does not prove malicious activity.

Step 5: Decide on the response

If the investigation indicates that the change was unauthorized, follow the organization's incident-response process.
Depending on the evidence and potential impact, the response might include reviewing or restricting affected permissions, securing compromised credentials, checking for additional changes, and preserving relevant logs.
The objective is to establish what happened, determine the scope, and respond appropriately rather than making assumptions from a single event.

5. How Can CloudTrail Support Continuous Monitoring?

Searching Event history is useful for investigating recent activity, but security teams often need ongoing visibility.
A more complete monitoring approach can combine CloudTrail with other AWS services.

CloudTrail with Amazon S3

A CloudTrail trail can deliver event log files to an Amazon S3 bucket for storage and later analysis.
This is useful when an organization needs an ongoing record beyond the 90-day Event history window. Access to the log bucket should be tightly controlled, and retention should match the organization's requirements.

CloudTrail with Amazon CloudWatch Logs

A configured trail can deliver selected events to CloudWatch Logs. Teams can then create metric filters and alarms for relevant activity.
For example, a team might monitor selected IAM changes or failed console sign-in events. The exact events captured depend on the trail's configuration.

CloudTrail with Amazon EventBridge

EventBridge can match supported CloudTrail events against rules and route matching events to configured targets.
This enables event-driven workflows, such as notifying a security team when a selected administrative action occurs.
These services serve different purposes: CloudTrail records activity, while CloudWatch and EventBridge can help monitor or route selected events.
References:

6. Common Mistakes to Avoid

Even when CloudTrail is available, monitoring gaps can affect an investigation.
Mistake 1: Assuming Event history contains every event type
Event history covers management events. If you need S3 object-level activity or other data events, configure the relevant event selectors and storage or querying solution.
Mistake 2: Looking in only one Region
A search in the wrong Region may not show the activity you're investigating. Multi-Region trails can help capture activity across enabled Regions.
Mistake 3: Treating the default history window as permanent storage
Event history covers 90 days of management events per Region. For longer retention, configure a trail or CloudTrail Lake event data store appropriate to your needs.
Mistake 4: Assuming every event is malicious
Unexpected activity needs investigation. Consider identity context, approved changes, related events, and the actual impact before drawing conclusions.
Mistake 5: Leaving audit logs insufficiently protected
Restrict access to CloudTrail log storage and protect the integrity and availability of the records. Consider log-file integrity validation and appropriate retention controls.
Mistake 6: Expecting CloudTrail to block an action automatically
CloudTrail records activity; it is not, by itself, a preventive access-control or automatic incident-response system. Detection, alerting, and response require appropriate configuration and complementary controls.

7. A Beginner-Friendly CloudTrail Security Checklist

When reviewing CloudTrail for an AWS account, consider these questions:
  • Is there an appropriate trail for ongoing logging?
  • Does the trail cover the required AWS Regions?
  • Are the management events relevant to the security requirements being recorded?
  • Are the necessary data events configured for sensitive resources?
  • Are logs delivered to appropriately protected storage?
  • Is retention sufficient for audit and investigation needs?
  • Are important events routed to monitoring or alerting systems?
  • Is access to CloudTrail configuration and stored logs restricted?
  • Is log-file integrity validation enabled where appropriate?
  • Is there a documented process for investigating and responding to suspicious activity?
Not every environment requires the same configuration. The right approach depends on its resources, security requirements, retention needs, and budget.

Conclusion

AWS CloudTrail is an important part of understanding activity within an AWS environment. It helps teams investigate API requests, review administrative changes, and build an audit trail for security monitoring.
For someone learning cloud security, understanding CloudTrail is also a useful step toward learning how security analysts investigate identity-related changes and suspicious cloud activity.
The key takeaway is simple: recording activity is only the first step. Effective security monitoring also requires the right event coverage, protected logs, useful alerts, and a clear investigation process.
As I continue learning AWS and cloud security, I'm focusing not only on how cloud services work, but also on how their activity can be monitored and investigated.
Discussion question: If you noticed an unexpected IAM policy change in an AWS account, which would you investigate first: the identity that made the change, the event's request details, or the surrounding activity?
I'd love to hear how cloud engineers and security professionals approach this kind of investigation.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article