Lesson 4 of 4 VPC Flow Logs and Network Logging

Choosing the Log That Answers Each Security Question

This lesson explains which logs beyond CloudTrail answer security questions, such as load balancer access logs, S3 server access logs and database logs, and why each must be enabled before it is needed.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the log source that answers an investigative question.
  • Describe what CloudTrail Insights detects.
  • Describe how logs are centralised and protected in a log archive account.

Which log answers the question

Each investigative question is answered by a particular log source. The following table identifies the appropriate source for each question.

QuestionLog sourceNotes
Who changed this resource's configuration?CloudTrail management eventsEnabled by default for 90 days of event history; create a trail to keep it
Who read or wrote this S3 object, Lambda invocation or DynamoDB item?CloudTrail data eventsMust be enabled and are charged; use advanced selectors to limit scope
Which requests went through this VPC endpoint?CloudTrail network activity eventsIncludes requests denied by the endpoint policy
Every request to a bucket, including anonymous and failed onesS3 server access logsBest-effort delivery, no extra charge beyond storage
Client IPs, paths, TLS versions at a load balancerELB access logs (and ALB connection logs for mTLS)Delivered to S3
Viewer requests at the edgeCloudFront standard or real-time logsReal-time logs stream to Kinesis Data Streams
API calls and authorizer resultsAPI Gateway access and execution logsCloudWatch Logs
Which requests WAF blocked and whyAWS WAF logsCloudWatch Logs, S3 or Firehose; redact sensitive fields
Which hosts were resolvedRoute 53 Resolver query logs (VPC) and public DNS query logsPublic query logs go to CloudWatch Logs in us-east-1
Who queried the databaseRDS/Aurora audit logs, Database Activity StreamsActivity streams are protected from database administrators
Kubernetes API activityEKS control plane audit logsEnable per cluster

The following diagram checks each log source against the investigators' question.

Why investigators cannot see who downloaded objects from a public bucket. CloudTrail management events, the only logging enabled, do not include GetObject. Anonymous downloads are recorded only by S3 server access logs or CloudTrail data events, and neither was on, so the history is gone.
The bucket was public, so the requests were anonymous.
Match the pairs

Which log answers it?

Exam skills 1.2.1 · 1.3.1 · 1.1.1

Match each investigative question with the log source that answers it.

Log in to try this activity Interactive activities are free with an account.

CloudTrail Insights

Insights learns the normal rate of write management API calls and error rates for an account and records an Insights event when activity deviates sharply, for example a burst of TerminateInstances calls or a spike in AccessDenied errors that suggests someone probing permissions. It is enabled per trail or event data store and charged per event analysed.

True or false

CloudTrail Insights

Exam skills 1.1.4

Check what CloudTrail Insights detects.

Log in to try this activity Interactive activities are free with an account.

Centralizing and protecting logs

Logs must be centralised and protected against tampering. The following list describes the recommended practices.

  • Deliver logs to a dedicated log archive account, with bucket policies that deny deletion and S3 Object Lock where retention is mandated.
  • Use organisation trails and Firewall Manager or Config rules to make sure every account and Region has the required logging enabled, and alert when it is turned off.
  • Stream CloudWatch Logs to a central account with cross-account subscription filters and Firehose.
  • Amazon Security Lake normalises many of these sources into OCSF for long-term, queryable storage.
Select all that apply

Central, protected logging

Exam skills 1.2.2 · 1.2.3

Pick the recommended practices for centralising and protecting logs.

Log in to try this activity Interactive activities are free with an account.
Worked example

After a data leak, investigators must determine which IP addresses downloaded objects from a public bucket over the last month. CloudTrail management events are enabled; nothing else is.

Management events do not include GetObject, and anonymous requests are only recorded by S3 server access logs or CloudTrail data events. Neither was enabled, so the history is unavailable. Going forward, enable server access logs (or data events) on sensitive buckets and block public access.

Check yourself

Which S3 logs capture anonymous requests?

Show answer

S3 server access logs, delivered on a best-effort basis.

Exam Tips

Remember for the exam

  • CloudTrail management events record control-plane changes; data events must be enabled for object-level activity.
  • S3 server access logs capture all requests, including anonymous ones, on a best-effort basis.
  • ELB access logs record client IPs and TLS protocol and cipher per request.
  • CloudTrail Insights detects unusual API call volumes and error rates.
  • Network activity events show requests through VPC endpoints, including denied ones.
  • Enable logging before an incident; logs cannot be recovered afterwards.