AWS CloudTrail
Cloud service · AWS · Updated

AWS CloudTrail

In short

AWS CloudTrail is a service that provides a comprehensive log of user activity and API usage across the AWS infrastructure, enabling security monitoring, compliance auditing, and operational troubleshooting.

Cloud Services Hub →

9 key features of AWS CloudTrail

AWS CloudTrail offers comprehensive event history, customizable event logging, continuous monitoring, multi-region tracking, and deep integration with AWS services for enhanced audit, compliance, and security management.

01
Event History

AWS CloudTrail's Event History allows you to view the last 90 days of management events in the current AWS Region, rather than all account activity.

02
Management and Data Events

CloudTrail captures Management events that provide insights into management operations performed on resources in your AWS account, as well as Data events that record resource operations performed on or within the resource itself.

03
Continuous Monitoring

With AWS CloudTrail, you can continuously monitor your AWS account's activity, with detailed records of account actions taken through the AWS Management Console, AWS SDKs, command line tools, and other AWS services.

04
Integration with AWS services

CloudTrail integrates with Amazon CloudWatch Logs and Amazon S3 for archiving and analyzing your event history, enhancing your ability to meet compliance requirements and security analysis.

05
Customizable Event Retention

You have flexibility in how long you retain your event logs, allowing you to keep them for as long as you meet your compliance and auditing requirements.

06
Event Encryption

CloudTrail log files delivered to your S3 bucket are encrypted by default using S3 server-side encryption (SSE).

07
Multi-region Configuration

CloudTrail supports multi-region configuration, enabling you to track user activity and API usage across all regions with a single trail, simplifying compliance and governance.

08
Custom Event Selectors

You can customize which events are logged by defining event selectors, allowing you to optimize the balance between detail in your logs and the volume of events recorded.

09
Log File Integrity Validation

CloudTrail log file integrity validation detects whether log files were modified or deleted after delivery, using SHA-256 hashing and SHA-256 with RSA digital signatures.

Where AWS CloudTrail is used

AWS CloudTrail is utilized for compliance auditing, security analysis, resource lifecycle tracking, and operational troubleshooting, by logging actions taken in your AWS environment.

  1. 01
    Compliance Auditing

    AWS CloudTrail aids in compliance audits by providing a comprehensive history of actions taken in your AWS environment. This includes who made API calls, when they were made, and from where, ensuring that you can effectively monitor and verify compliance with policies and regulations.

  2. 02
    Security Analysis

    By tracking user activity and API usage, CloudTrail supports security monitoring and provides account activity records for analysis and remediation.

  3. 03
    Resource Lifecycle Tracking

    CloudTrail offers insights into the lifecycle of resources within your AWS account. Tracking the creation, modification, and deletion of AWS resources helps in understanding configurations over time and aids in resource optimization and cost management.

  4. 04
    Operational Troubleshooting

    This service simplifies operational troubleshooting by providing detailed event histories, which can be crucial for pinpointing the causes of unexpected changes or errors in your AWS infrastructure. It assists teams in quickly resolving issues, maintaining operational efficiency.

How AWS CloudTrail is priced

AWS CloudTrail pricing includes a free tier for event history and some management events; beyond that, it charges for management, data, and insights events, as well as usage for CloudTrail Lake based on data storage and query bytes scanned.

Free Tier

CloudTrail Event History provides the most recent 90 days of management events at no charge. Creating trails also lets you deliver one copy of ongoing management events to an S3 bucket for free, subject to applicable limits.

CloudTrail Management Events

Management events delivered to Amazon S3 cost $2.00 per 100,000 events after the first free copy.

CloudTrail Data Events

Data events delivered to Amazon S3 are billed at $0.10 per 100,000 events.

CloudTrail Insights Events

CloudTrail Insights costs $0.35 per 100,000 management events analyzed per insight type and $0.03 per 100,000 data events analyzed per insight type.

CloudTrail Lake

CloudTrail Lake charges for ingestion, retention, and queries. One-year extendable retention pricing charges $0.75/GB for CloudTrail management, data, and network activity events and $0.50/GB for other auditable sources; the first year of retention is included, with extended retention at $0.023/GB-month up to 10 years. Seven-year retention pricing includes seven years of retention and charges ingestion at $2.50/GB for the first 5 TB/month, $1/GB for the next 20 TB/month, and $0.50/GB above 25 TB/month. Lake queries cost $0.005/GB scanned under either option.

CloudTrail Network Activity Events

Network activity events delivered to Amazon S3 cost $0.10 per 100,000 events.

CloudTrail Data Event Aggregation

Data event aggregation delivered to Amazon S3 costs $0.03 per 100,000 data events analyzed, in addition to data event charges.

Direct CloudWatch Logs Delivery

Direct delivery of CloudTrail management and data events to CloudWatch Logs costs $0.25/GB delivered, plus CloudWatch Logs ingestion fees.

Services AWS CloudTrail works with

Amazon S3Amazon S3

Stores CloudTrail log files in Amazon S3 buckets, enabling long-term storage and analysis of logs.

AWS LambdaAWS Lambda

Processes CloudTrail logs in near real-time for custom actions and insights.

Amazon API GatewayAmazon API Gateway

CloudTrail records API Gateway management operations, including changes to APIs, stages, and authorizers. These events help identify who changed an API's configuration.

Amazon AppFlowAmazon AppFlow

CloudTrail records AppFlow API activity, including the creation, modification, and deletion of flows. You can use these events to investigate changes to data-transfer configurations.

Amazon AthenaAmazon Athena

CloudTrail logs stored in S3 can be queried with Athena, and CloudTrail Lake supports federation for querying event data stores through Athena. CloudTrail also records Athena API activity, such as query submissions and workgroup changes.

Amazon Augmented AI (Amazon A2I)Amazon Augmented AI (Amazon A2I)

CloudTrail records management operations for A2I human review workflows. You can also enable supported data-event logging for human loop operations to audit interactions with individual reviews.

Amazon AuroraAmazon Aurora

CloudTrail records Aurora control-plane activity through Amazon RDS APIs. These events identify who created a cluster, changed its configuration, or initiated a snapshot operation.

Amazon Aurora ServerlessAmazon Aurora Serverless

CloudTrail records RDS API operations that configure Aurora Serverless clusters, including changes to supported capacity and scaling settings. This provides an audit trail of administrative changes rather than a record of automatic capacity adjustments.

Amazon Bedrock

CloudTrail records Bedrock management API activity, and supported model invocation operations can be captured as data events. These records identify callers and operations without replacing Bedrock's separate model invocation logging.

Amazon Bedrock AgentCore

CloudTrail records supported AgentCore control-plane operations, such as creating and updating runtime resources. Supported runtime data events can also be selected to audit invocation activity.

What is AWS CloudTrail

3 min read

Amazon Web Services (AWS) CloudTrail is a service designed to enable governance, compliance, operational auditing, and risk auditing of your AWS account. With CloudTrail, users can log, continuously monitor, and retain account activity related to actions across their AWS infrastructure. This service provides an invaluable layer of insight that helps organizations ensure compliance with internal policies and regulatory standards by tracking user activity and API usage across their AWS environments. 

CloudTrail focuses on who did what, when, and from where in AWS. It records API calls and related events made by or on behalf of an AWS account. These calls can originate from various sources including the AWS Management Console, AWS SDKs, command line tools, and higher-level AWS services. The detailed logging covers calls made to almost all AWS services, capturing information including the identity of the API caller, the time of the API call, the source IP address of the API caller, the request parameters, and the response elements returned by the AWS service. 

Event history is available automatically when you create an AWS account and provides an immutable event record. Searches filter events on a single attribute.

For a trail or event data store using advanced event selectors, all conditions across those selectors can contain at most 500 total values; this quota cannot be increased.

Network activity events record AWS API actions made through VPC endpoints, including requests allowed or denied by endpoint policies. These events are delivered only to the VPC endpoint owner and must be explicitly enabled on a trail or event data store.

The data recorded by CloudTrail enables AWS customers to perform security analysis, resource change tracking, and troubleshooting. Importantly, it also helps in detecting unusual activity in their accounts which can indicate potential security incidents or vulnerabilities. Additionally, for customers subject to regulatory requirements, CloudTrail's logs can play a crucial role in demonstrating compliance with external policies. AWS CloudTrail logs are stored in an S3 bucket specified by the user, and the service supports the encryption of the log files using AWS Key Management Service (AWS KMS) for added security. 

CloudTrail Lake can ingest activity events from AWS, other cloud providers, in-house applications, and SaaS applications, and immutably store audit-worthy events. CloudTrail Lake will no longer be open to new customers starting May 31, 2026. For similar capabilities, explore Amazon CloudWatch.

CloudTrail Lake supports multi-attribute SQL queries, including scheduled queries and multiple concurrent queries.

CloudTrail Insights analyzes management and data events to help identify and respond to unusual activity associated with API call rates and API error rates.

Data event aggregation consolidates data events into 5-minute summaries showing access frequency, error rates, and most-used actions.

CloudTrail also integrates with Amazon CloudWatch Logs and Amazon EventBridge, providing a way to take real-time action on the log data it captures. For example, users can set up alerts for specific events like the creation of new IAM users or roles, or the deletion of EC2 instances, helping them respond quickly to changes in their AWS environment. One of the key benefits of AWS CloudTrail is its ability to centralize logging across multiple accounts and AWS regions. This feature is particularly useful for large organizations with multiple teams operating in different environments. By aggregating logs in a single account, organizations can simplify their monitoring and auditing processes, making it easier to analyze activity patterns and identify potential issues. 

CloudTrail allows a maximum of five trails per AWS Region; this quota cannot be increased.

CloudTrail management and data events can also be delivered directly to CloudWatch Logs without creating a trail.

Overall, AWS CloudTrail offers a powerful and convenient way to increase visibility into the actions being performed in an AWS environment. CloudTrail records account activity and service events from most AWS services. This level of oversight and detail makes CloudTrail a fundamental component of any robust AWS security strategy.

Concepts related to AWS CloudTrail

AWS CloudTrail exam questions

Real practice exam questions on AWS CloudTrail, with the correct answer and its explanation. Answer them with every option in the exam simulator.

AIB-C01

A financial services company plans to expand an AI pilot to several business units. During the production readiness review, leaders find that teams can change AWS resource configurations through both deployment automation and direct administrative access. Existing model-quality reports and release approvals do not establish who actually made each change. Before approving expansion, the risk committee requires an ongoing, independently reviewable record of AWS administrative activity. Which action best addresses this governance gap?

Show answerCORRECT ANSWER

Use AWS CloudTrail to record AWS administrative activity, with centrally governed retention, defined review responsibilities, and a process for investigating unexpected changes.

CloudTrail provides evidence of AWS API activity, including the caller and time of an action. Combining this evidence with retention requirements, accountable reviewers, and an investigation process addresses the production governance gap across automated and direct administrative activity.

MLA-C02

A company uses an AWS CloudTrail trail to deliver audit logs for its Amazon SageMaker AI workloads to Amazon S3. For newly delivered logs, a regulatory policy requires retention for seven years. During that period, no user, including the AWS account root user, may permanently delete the records or shorten their retention. Logs must remain immediately accessible for the first 90 days; afterward, retrieval within 48 hours is acceptable. Which configuration meets these requirements while reducing long-term storage costs?

Show answerCORRECT ANSWER

Enable S3 Object Lock on the destination bucket with a default seven-year retention period in compliance mode. Use an S3 Lifecycle rule to transition log objects to S3 Glacier Deep Archive after 90 days.

Object Lock compliance mode prevents permanent deletion of protected object versions or shortening of their retention, including by the root user. Lifecycle transitions preserve Object Lock protection. Keeping logs in an immediately accessible storage class initially and transitioning them to Glacier Deep Archive after 90 days reduces archival costs while supporting the allowed retrieval window.

SAP-C03

A company uses AWS Organizations to manage 50 application accounts across two AWS Regions. Applications make in-Region Amazon Bedrock InvokeModel and InvokeModelWithResponseStream requests with text inputs and outputs. An existing multi-Region organization trail delivers API activity records to a log archive account.

After an investigation, the security team discovers that the centralized records identify model API calls but do not contain the prompts or generated responses. The company must capture those contents for future invocations and maintain copies in an S3 bucket in the log archive account. Investigators must be able to correlate the contents with invocation metadata. Applications must continue calling Amazon Bedrock directly without code changes or an inference proxy.

An existing account-enrollment pipeline can deploy account-specific resources and settings in both Regions. Which solution meets these requirements?

Show answerCORRECT ANSWER

Use the enrollment pipeline to enable Amazon Bedrock model invocation logging with text delivery in each application account and Region. Deliver logs to same-account, same-Region S3 buckets, and configure S3 replication with the required permissions to copy them to the log archive bucket. Retain invocation request IDs for correlation.

Amazon Bedrock model invocation logging captures supported text inputs, outputs, and invocation metadata without application changes. It must be configured in each account and Region, and its S3 destination must be in that same account and Region. Replication provides centrally controlled copies in the log archive account, while request IDs support correlation with API activity records.

Practice AWS CloudTrail in a full exam

Questions on AWS CloudTrail in each practice exam, with every answer option and an explanation for each:

Start a free practice exam

Learn AWS CloudTrail in lessons

31 short lessons on AWS CloudTrail in 11 certification courses.

and 25 more lessons

Open the lessons

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.