Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
AWS · SCS-C03

Logging solutions

SCS-C03 · Lesson 2 of 22 · 12:11

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the SCS-C03 exam (AWS Certified Security – Specialty). In this lesson: choosing log sources from requirements (CloudTrail management, data, and network activity events, VPC Flow Logs, and application logs), an organization trail delivered to a log archive account with a tight bucket policy and log file validation, the CloudWatch agent and centralized CloudWatch logs, Amazon Security Lake and OCSF, Route 53 Resolver query logs and Transit Gateway Flow Logs, and retention periods, log classes, and S3 lifecycle rules. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Where are the logs?

When an incident starts, the first question is always the same: what happened, and where are the logs? At AnyCompany Health, one account without logs can hide the whole story. This lesson covers how to choose log sources, configure logging across accounts, store logs in a lake, and capture network logs.

Log sources

Pick each log source from a requirement. CloudTrail captures API calls: management events by default, plus data events, such as object reads in S3 or Lambda invocations, and network activity events for calls through VPC endpoints, which you add when you need them. VPC Flow Logs capture the IP traffic of a VPC, a subnet, or a network interface, and application logs come from the instances, the containers, and the functions themselves. Then choose where each log is stored and for how long: CloudWatch Logs for searching and alarms, S3 for cheap long-term storage, with a retention period that matches the rules of the health sector.

Logging across the organization

An organization trail, created from the management account or a delegated administrator, logs the events of every member account in every enabled Region, and member accounts can see it but cannot modify it. Send it to a bucket in a dedicated log archive account, whose bucket policy allows only the CloudTrail service, with a source ARN condition for your trail, and turn on log file validation. On instances, the CloudWatch agent collects system logs and metrics, on EC2 and on premises, with a role that allows it to write to CloudWatch. And a central logging account receives the logs of every account, through subscription filters or log centralization across accounts and Regions.

Log lakes

For long-term analysis, put the logs in a lake. Amazon Security Lake turns CloudTrail events, VPC Flow Logs, Route 53 Resolver query logs, WAF logs, EKS audit logs, and Security Hub CSPM findings into Parquet files in the OCSF schema, through its own copy of the events, so most sources need no extra setup. Custom sources add the logs of other tools, written in OCSF, and subscribers, such as a third-party SIEM, either receive the data or query it in place. You can also build your own lake in S3 and query it with Athena, but Security Lake does the normalization for you.

Network logs

Network logs answer who talked to whom. VPC Flow Logs capture accepted and rejected traffic for a VPC, a subnet, or a network interface, and Transit Gateway Flow Logs capture the traffic that crosses a transit gateway between VPCs and on-premises networks. Route 53 Resolver query logs capture the DNS queries made from your VPCs, which reveal calls to suspicious domains. All three can go to CloudWatch Logs or S3, among other destinations, and they never slow down the traffic, because they are collected outside its path.

Retention and log classes

Logs must be kept long enough, and no longer. By default, CloudWatch Logs keeps log data indefinitely, so set a retention period on each log group, or an account-level retention policy, which takes precedence over the setting of the log group. The Essentials log class, formerly Infrequent Access, costs less to ingest and suits logs that you only query after the fact, such as forensic analysis. For years of storage, keep the log archive in S3, with lifecycle rules that move old logs to cheaper storage classes, and S3 Object Lock if no one may delete them early.

Recap

Let's recap. Pick each log source from a requirement: CloudTrail management, data, and network activity events, flow logs, and application logs. An organization trail goes to a log archive account, with a tight bucket policy and log file validation. The CloudWatch agent collects system logs, and a central account receives the logs of every account. Security Lake normalizes logs into OCSF for subscribers, and Resolver query logs and Transit Gateway Flow Logs complete the network view. And retention periods, log classes, and S3 lifecycle rules keep logs as long as needed.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. An auditor asks AnyCompany Health to prove that no one changed or deleted any CloudTrail log file after its delivery. What should the security engineer use?

    • S3 Versioning on the log bucket
    • A CloudWatch Logs metric filter
    • CloudTrail log file integrity validation
    • Macie automated discovery on the bucket
    Show the answer

    CloudTrail log file integrity validation

    Log file validation delivers a digest file every hour, signed with a private key, with a hash of each log file, so any change or deletion shows up. “S3 Versioning on the log bucket” would keep older versions, but it would not prove that nothing changed. “A CloudWatch Logs metric filter” is for counting events in the logs. And “Macie automated discovery on the bucket” is for finding sensitive data, not for proving integrity.

  2. GuardDuty reports that an instance looked up a crypto mining domain. Next time, the team wants every DNS query of that VPC over the last month, in its own logs. What should be turned on beforehand?

    • VPC Flow Logs on the subnet
    • CloudTrail data events for S3
    • Transit Gateway Flow Logs
    • Route 53 Resolver query logging
    Show the answer

    Route 53 Resolver query logging

    Resolver query logging captures every DNS query that resources in the VPC make, with the domain name. “VPC Flow Logs on the subnet” would show IP addresses and ports, not the names that were looked up. “CloudTrail data events for S3” is for API calls on objects in S3. And “Transit Gateway Flow Logs” is for traffic that crosses a transit gateway, again without names.

  3. A log group of debug logs has no retention setting, and its storage keeps growing. The team needs thirty days of these logs and nothing more. What should the security engineer do?

    • Set a 30-day retention period on the group
    • Move the log group to the Essentials class
    • Export the logs to S3 every month
    • Turn on deletion protection for the group
    Show the answer

    Set a 30-day retention period on the group

    A retention period of thirty days makes CloudWatch Logs delete the older events, usually within seventy-two hours after they expire. “Move the log group to the Essentials class” would lower the cost of ingestion, but it would keep every event. “Export the logs to S3 every month” is only a copy, so the logs would still pile up. And “Turn on deletion protection for the group” would prevent the deletion of the log group, the opposite of the need.