Module Overview
Estimated Time: 2-3 hours | Difficulty: Intermediate | Prerequisites: IAM, S3, basic logging concepts
- CloudTrail event types and structure
- Trail configuration and multi-region setup
- CloudTrail Lake for advanced querying
- CloudTrail Insights for anomaly detection
- Security investigation workflows
How CloudTrail Works
Event Types
Management Events
Operations on AWS resources (control plane):Data Events
Operations on data within resources:Insights Events
Unusual API activity detection:Event Structure
Creating a Trail
Multi-Region Trail
CloudFormation
CloudTrail Lake
Create Event Data Store
CloudTrail Lake is a managed data lake purpose-built for CloudTrail events. Instead of the old workflow (S3 -> Athena -> query), Lake lets you run SQL queries directly against your events. The trade-off: Lake costs more per GB than S3+Athena for large volumes, but eliminates the operational overhead of maintaining Glue tables, partitions, and Athena workgroups. For teams without a dedicated data platform, Lake is usually the right choice.Query with SQL
CloudTrail Insights
Enable Insights
Insights Event Example
Security Monitoring
CloudWatch Alarms
EventBridge Rules
Investigation Workflow
Best Practices
Enable Multi-Region
Attackers may target regions you don’t actively use
Log Validation
Enable log file integrity validation for forensics
Use Lake
CloudTrail Lake enables SQL queries without S3/Athena setup
Enable Insights
Detect unusual API activity patterns automatically
Security Checklist
🎯 Interview Questions
Q1: What's the difference between management events and data events?
Q1: What's the difference between management events and data events?
Management Events (Control Plane):
- Operations on AWS resources
- CreateBucket, DeleteUser, StartInstances
- Logged by default
- Lower volume
- Operations on data within resources
- GetObject, PutObject, Invoke
- Not logged by default (extra cost)
- High volume
Q2: How would you investigate a potential security breach using CloudTrail?
Q2: How would you investigate a potential security breach using CloudTrail?
- Identify compromised credentials: Find the access key or role
- Timeline analysis: Query all events from that identity
- Source IP analysis: Check for unusual IPs or geolocations
- Resource access: Identify what was accessed/modified
- Lateral movement: Check for AssumeRole or CreateAccessKey
- Scope assessment: Determine if other accounts affected
Q3: How do you ensure CloudTrail log integrity?
Q3: How do you ensure CloudTrail log integrity?
- Enable log file validation: Creates digest files with hashes
- KMS encryption: Encrypt logs at rest
- S3 bucket policy: Prevent deletion/modification
- Object Lock: Enable S3 Object Lock for immutability
- Cross-account: Store logs in separate security account
- MFA Delete: Require MFA for log deletion
Hands-On Lab
1
Create Organization Trail
Set up multi-region trail with encryption and validation
2
Enable Data Events
Configure S3 and Lambda data event logging
3
Set Up CloudTrail Lake
Create event data store and run sample queries
4
Create Alarms
Set up CloudWatch alarms for root account usage
5
Investigate
Use CloudTrail Lake to investigate a simulated incident
Next Module
AWS Config
Configuration compliance and change management