3.3.1.13. Audit Trail Management for Regulated Workloads (CloudTrail, Object Lock, Database Activity Streams, Security Lake)
3.3.1.13. Audit Trail Management for Regulated Workloads (CloudTrail, Object Lock, Database Activity Streams, Security Lake)
💡 First Principle: A regulated audit trail must be complete (every account, Region and relevant data access), tamper-evident, retained for the mandated period, and out of reach of the people it audits.
Building the trail:
- Completeness: one organization trail (multi-Region, every member account, members cannot stop it) for management events. Add data events only where needed (regulated S3 buckets, DynamoDB tables, Lambda functions), scoped with advanced event selectors so cost stays predictable; data events are what answer "who read this object". The console's event history covers 90 days of management events only.
- Tamper evidence: turn on log file integrity validation. CloudTrail writes hourly digest files that hash and sign each log file, and
aws cloudtrail validate-logsproves whether any file was changed or deleted. - Immutability and retention: deliver to a bucket in a dedicated log archive account, encrypted with a customer managed KMS key, with S3 Object Lock in compliance mode for the retention period (governance mode can be bypassed by privileged users) and lifecycle transitions to S3 Glacier Deep Archive for cost.
- Separation of duties: SCPs (or Control Tower mandatory controls) deny
cloudtrail:StopLogging,DeleteTrail,UpdateTrailand changes to the log bucket; only the security team has access to the log archive account. - Database-level activity: CloudTrail records API calls, not SQL statements. Database activity streams (Aurora PostgreSQL, Aurora MySQL, RDS for Oracle, RDS for SQL Server) push an encrypted (KMS) stream of database activity to Kinesis, outside the DBAs' control, for near-real-time monitoring. Engine audit logs (
pgAudit, audit plugins) to CloudWatch Logs are cheaper, but DBAs who manage parameter groups can turn them off.
Querying and correlating:
- Athena over the log archive bucket (partition projection) answers ad-hoc questions across years of logs at low cost; CloudWatch Logs metric filters give near-real-time alerts.
- Amazon Security Lake collects CloudTrail management and data events, VPC Flow Logs, Route 53 Resolver query logs, Security Hub findings, EKS audit logs and more from every account into buckets you own, normalized to OCSF, with retention rules, and gives SIEM tools and analysts access as subscribers (data access or query access through Lake Formation).
- CloudTrail Lake is closed to new customers since May 31, 2026 (AWS points to CloudWatch for similar capabilities), so new designs use a trail plus S3, Athena, Security Lake or CloudWatch.
- Audit logs for AI services follow the same rules: deliver model invocation logs to a protected central store.
⚠️ Exam Trap: Object Lock stops deletion, but only log file validation proves that the content of each file is exactly what CloudTrail delivered. Regulated designs use both, and an account-local trail with MFA Delete is not a substitute for an organization trail in a separate log archive account.