CLOUD SERVICE · AWS

AWS CloudTrail

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 →
Arch_AWS CloudTrail_64 imageIcon source: AWS

What is AWS CloudTrail

Read the extensive description

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. 

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 Insights analyzes management and data events to help identify and respond to unusual activity associated with API call rates and API error rates.

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 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.

Key AWS CloudTrail Features

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.

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.

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.

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.

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.

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.

Event Encryption

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

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.

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.

AWS CloudTrail Use Cases

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

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.

Security Analysis

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

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.

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.

AWS CloudTrail pricing models

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.

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.

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 Management Events

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

CloudTrail Network Activity Events

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

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.

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.

Services AWS CloudTrail integrates with

AWS Lambda image AWS Lambda

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

Open AWS Lambda →
Amazon Simple Storage Service image Amazon S3

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

Open Amazon S3 →

Concepts related to AWS CloudTrail