CloudTrail and API activity logging: the basics
What does "audit logging" actually mean across the CloudTrail family?
CloudTrail is the flight recorder for your AWS account. Every console click, SDK call and CLI command resolves to an API action, and a trail writes a durable record of it: who made the call, when, from which source IP, with what parameters, and what the service returned. Without a trail those events scroll past the always-on event history window and are gone, with no way to reconstruct them after the fact.
Security Hub turns the question "is our API activity properly logged?" into a family of separate controls, which is why a single account can fail several CloudTrail checks at once. One control asks whether any trail exists at all; another asks whether at least one trail is multi-Region and captures both read and write management events; another asks whether log file validation is on so the records are tamper-evident; another asks whether the trail is wired into CloudWatch Logs for real-time alerting; another asks whether the trail's own S3 bucket has access logging. They look like five problems on the report, but they are one capability: keep a complete, trustworthy, queryable audit trail of who did what.
The right way to satisfy this whole family is to create one multi-Region trail, configured properly the first time, and apply it across every account. A single trail with management events, log file validation, CloudWatch Logs delivery and a hardened, access-logged S3 bucket clears the entire group at once. Standing up a bare single-Region trail just to clear the easiest check guarantees the stricter ones flag right behind it and you do the work twice.
In this lesson you will learn how CloudTrail records API activity, the difference between the always-on event history and a real trail, and what a complete audit-logging posture looks like: multi-Region coverage, read and write management events, log file validation for tamper-evidence, CloudWatch Logs integration for alerting, and access logging on the trail's own bucket. The Controls this lesson covers section lists every Security Hub control in this capability, each linking to a deep page with the exact check and a copy-and-paste fix.
The audit that asked one question
A SaaS startup pursuing its first SOC 2 and a PCI attestation sailed through most of the technical review. Then the assessor asked for the CloudTrail logs covering the previous twelve months for the account holding cardholder data. The team went to pull them and discovered that account had never had a trail enabled. The console's event history showed the last 90 days, viewing only, with no durable export. There was simply no record for the other nine months. The finding was not "misconfigured logging", it was "no logging", and it pushed the attestation back a full quarter while they stood up trails and waited to accumulate enough history. The trail they eventually turned on cost a few dollars a month.
Finding the gaps in API activity logging
Devon is doing a Security Hub triage pass and sees several CloudTrail findings on a newly onboarded account that a team spun up outside the landing zone. The account already has running workloads, so it has been generating activity with nothing recording it.
Rather than clear the easiest finding first, Devon starts by listing what trails actually exist and how each one is configured, so he can fix the whole capability with one properly built trail instead of chasing each control separately.
List every trail and the configuration the controls care about: multi-Region coverage and log file validation. An empty list, or a single-Region trail, is the failing state.
One under-configured trail trips several controls. Fix it properly once rather than chasing each finding.
How CloudTrail logging actually worksdeep dive
Two things in AWS are easy to confuse. CloudTrail event history is always on, free, single-Region and covers the last 90 days of management events, but it is a viewing feature only and cannot be exported as a durable, validated record. A trail is the thing that delivers events as log files to an S3 bucket, and optionally to CloudWatch Logs, for as long as you keep them. The control family checks for the trail, not the event history, so event history existing does not satisfy any of these controls.
The key trail properties map directly to the controls. IsMultiRegionTrail must be true so global service events such as IAM and STS, emitted only in us-east-1, are captured along with every Region you do not use. The event selector must set ReadWriteType to ALL and IncludeManagementEvents to true so reconnaissance reads, not just writes, are logged. LogFileValidationEnabled produces hourly signed digest files chained with SHA-256 so the logs are tamper-evident. A CloudWatchLogsLogGroupArn streams the same events to CloudWatch Logs within a minute or two, where a metric filter and alarm can page someone on root login or an IAM policy change. And the trail's S3 bucket should itself have server access logging on, so reads and deletes of the audit log are recorded too.
Security Hub evaluates these through AWS Config managed rules on a periodic schedule, so a fix does not flip a finding to PASSED instantly. The control plane change is immediate, but the report catches up on the next evaluation. The strongest posture is an organisation trail created at the AWS Organizations level: it applies to every member account automatically, including accounts that do not exist yet, so the whole family stays green by default rather than per account.
What is the impact of incomplete API activity logging?
The first impact is investigative blindness. When a resource is deleted, a credential is misused or a configuration changes unexpectedly, the first question is always who did this, when and from where. CloudTrail is the answer. A missing trail leaves no record at all; a single-Region trail leaves the Regions you do not watch unrecorded; a write-only trail misses the reconnaissance an attacker performs before they act; and logs with no validation can be quietly rewritten by anyone who reaches the bucket. You cannot investigate what you never recorded, and history cannot be backfilled.
The second impact is detection latency. CloudTrail delivered only to S3 lands in batched files every several minutes, which is fine for forensics but useless for stopping an incident in progress. Wiring the trail into CloudWatch Logs collapses the alerting window to a minute or two and is what makes real-time alarms on root usage, IAM changes and KMS key disables possible. Capital One is the canonical example: every attacker action was logged from minute one, but no alarm fired, and the breach surfaced months later from an external tip.
The third impact is compliance. This family maps to the CIS AWS Foundations Benchmark, NIST 800-53 audit controls (AU-2, AU-3, AU-9, AU-12) and PCI DSS section 10. A passing set of CloudTrail controls across every account is one of the cheapest and most defensible artefacts you can hand an auditor; a failing one is a concrete, citable gap that can hold up an attestation.
The cost to satisfy all of this is small and runs the right way: management events to the first trail are free, so you pay only modest S3 storage and, where used, CloudWatch Logs ingestion. The expensive mistake is over-correcting by enabling per-event data events to "be safe", which are billed per event and can add hundreds or thousands of dollars a month. None of these controls require data events.
How do you build a complete audit trail safely?
Work the capability as one loop rather than chasing individual findings. Build one trail correctly, prove it is actually logging, then make coverage automatic across the organisation so the whole family stays green.
1. Inventory what exists and find the gaps
Run describe-trails across every account and Region. Record whether any trail exists, whether each is multi-Region, whether the event selector is ReadWriteType=ALL with management events, whether log file validation is on, and whether CloudWatch Logs delivery is configured. One under-configured trail is usually the single root cause behind several CloudTrail findings, so treat the trail, not the finding count, as the unit of work.
2. Build one trail that satisfies the whole family
Create a single multi-Region trail capturing read and write management events, with log file validation enabled, delivering to a dedicated, locked-down S3 bucket that has its own server access logging on. Wire it to a CloudWatch Logs group so events are queryable and alarmable within a minute or two. Do NOT enable data events to clear these controls: they are billed per event and none of the controls require them.
3. Prove it is actually recording and alerting
create-trail only defines the trail; start-logging begins delivery. Confirm IsLogging is true, watch the first log file land in S3, verify the event selectors, and add a metric filter and alarm on the high-value events (root login, IAM policy change, CloudTrail config change, KMS key disable). Close the ticket on "logging, validated, alarming", not on "trail created".
4. Make coverage automatic across the organisation
The durable fix is an organisation trail created at the AWS Organizations level, which applies to every member account automatically, including accounts that do not exist yet. Pair it with a Service Control Policy that prevents stopping or deleting logging outside the approved path, and an AWS Config rule to catch any drift. After that, no self-service account can be born without complete logging, and the CloudTrail family stops being a recurring finding.
# Create one multi-Region trail that satisfies the whole CloudTrail family.
aws cloudtrail create-trail \
--name org-audit-trail \
--s3-bucket-name my-cloudtrail-logs-bucket \
--is-multi-region-trail \
--include-global-service-events \
--enable-log-file-validation \
--cloud-watch-logs-log-group-arn arn:aws:logs:us-east-1:111122223333:log-group:/aws/cloudtrail/org:* \
--cloud-watch-logs-role-arn arn:aws:iam::111122223333:role/CloudTrail_CloudWatchLogs_Role
# Capture read AND write management events (not data events, which are billed per event).
aws cloudtrail put-event-selectors --trail-name org-audit-trail \
--event-selectors ReadWriteType=All,IncludeManagementEvents=true
# Defining the trail does not record anything: start it, then verify it is logging.
aws cloudtrail start-logging --name org-audit-trail
aws cloudtrail get-trail-status --name org-audit-trail --query IsLogging --output text
# For org-wide coverage, recreate with --is-organization-trail from the management
# or delegated-admin account so every member account inherits it automatically. Quick quiz
Question 1 of 5Security Hub shows several CloudTrail findings on one account: no multi-Region trail, no log file validation, no CloudWatch Logs delivery. What is the most efficient way to fix them?
You scored
0 / 5
Keep learning
Go deeper on how trails, event types and validation work across the CloudTrail control family.
- Security Hub controls for AWS CloudTrail The full CloudTrail control family with severities, resource types and remediation.
- Creating a trail for an organization How to apply one trail across every account so coverage is automatic and cannot be skipped.
- Logging management events with CloudTrail The difference between management and data events, event selectors, and which ones are free versus billed.
You can now treat audit logging as one capability rather than a scatter of findings: build one multi-Region trail with read and write management events, log file validation and CloudWatch Logs delivery, prove it is actually logging and alerting, and promote it to an organisation trail so every account inherits it by default. The Controls this lesson covers section below links every control in this group to its deep page and fix.
Back to the library