CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
SOA-C02 · AssociateCloudOps Engineer - Associate
  • Week 1
    • 1.AWS Infrastructure Through an Operator's Eyes: Regions, AZs, and the Boundary of Responsibility
    • 2.IAM Operator's Manual: Users, Groups, Roles, Policy Evaluation Algorithm
    • 3.Advanced IAM: Building Guardrails with Permission Boundary, SCP, and Identity Center
    • 4.AWS Organizations: How One Person Operates 100 Accounts
    • 5.Week 1 Consolidated Review: Revisiting the First Week Through Operator Scenarios
  • Week 2
  • Week 3
  • Week 4
    • 1.CloudTrail: Design Principles of API Audit Logs and the Organization Trail
    • 2.CloudTrail Lake Advanced: SQL Audit Analysis, Insights Anomaly Detection, Cross-Account Queries
    • 3.AWS Config Advanced: Rule Evaluation Triggers, Custom Rule Lambda, Conformance Pack, Auto Remediation
    • 4.Audit Manager, License Manager, Resource Explorer: Audit Automation and Operational Visibility Design
    • 5.Week 4 Review: CloudTrail, Config, and the Audit Stack Together
  • Week 5
  • Week 6
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← SOA-C02/Week 4/Day 5

Based on the SOA-C02 exam guide·Report an error

SOA-C02· AssociateWeek 4 · Day 5~40 min read

Day 5 - Week 4 Review: CloudTrail, Config, and the Audit Stack Together

The tools of Week 4 answer a different question from CloudWatch. If CloudWatch shows "what is happening right now" in real time, this week's tools handle the after-the-fact, normative questions: "who did what in the past, is the current state compliant with the rules, and how do we submit the evidence to an external auditor?" For security incident response and compliance, after-the-fact tracing and an evidence system matter as much as real-time detection. Today we re-examine what layers CloudTrail, CloudTrail Lake, AWS Config, and Audit Manager form, and wrap up with 10 exam-style scenarios.

The Concept Map of Week 4

[AWS API call occurs]
        │
        ▼
[CloudTrail]  ─→  Event History (90 days free, immutable)
        │                │
        │                ▼
        │         [S3 Trail]  ─→  Log File Validation (SHA-256 hash chain)
        │                │              → Athena query analysis
        │                │              → SIEM integration (Splunk, Sumo Logic)
        │                ▼
        │       [CloudTrail Lake]  ─→  SQL queries (Event Data Store)
        │                │              → 7-year retention / Organization integration
        │                │              → Can ingest external events
        │                ▼
        │       [Insights Events]  ─→  ML: ApiCallRateInsight / ApiErrorRateInsight
        │                              → Needs 7 days of baseline learning
        │
        ▼
[EventBridge default bus]  ─→  Rule pattern matching → SNS / Lambda / SSM
        (all API calls delivered automatically)
        │
        ▼
[AWS Config]  ─→  Configuration Item (resource state snapshot)
        │              → Resource Timeline (change history visualization)
        │
        ▼
  [Config Rules]  ─→  Evaluation trigger (Configuration change | Periodic)
        │              → NON_COMPLIANT detection
        │              → SNS notification
        ▼
[Auto Remediation]  ─→  Automatic SSM Automation Runbook execution
        │
        ▼
[Conformance Pack]  ─→  A bundle of Rules (based on HIPAA/PCI/NIST)
        │              → Deployed across the whole Organization
        ▼
[AWS Audit Manager]  ─→  Framework → Control → Data Source → Assessment
                         → Automatic evidence collection (Config/CloudTrail/Security Hub)
                         → PDF/CSV report output

💡 Related theory: The design of this stack implements the Defense in Depth principle of security engineering and the theory of Audit Trail. NIST SP 800-92 "Guide to Computer Security Log Management" presents as a core principle that "it must always be possible to reconstruct who did what and when (accountability)." It is a layered structure in which CloudTrail provides the raw data for this accountability, Log File Validation provides tamper-evidence, Config provides state tracking, and Audit Manager provides compliance reporting.

Key Comparison Tables

CloudTrail vs AWS Config

ItemCloudTrailAWS Config
What it tracksAPI calls (actions)Resource configuration (state)
Question"Who did what""What state is it in now"
Unit of dataEvent (JSON)Configuration Item
Retention90 days by default (History), permanent with a TrailPermanent storage in S3
CostManagement free, Data $0.10/100K$0.003 per CI + $0.001 per Rule
Alarm integrationEventBridge pattern matching → SNS/LambdaRule evaluation → SNS or Auto Remediation
Tamper detectionLog File Validation (SHA-256)No tamper detection feature

CloudTrail Lake vs S3 Trail + Athena

ItemCloudTrail LakeS3 + Athena
AnalysisDirect SQL in the console (Event Data Store ID)Athena table + partition setup
Maximum retention7 years (2555 days)Permanent (S3 lifecycle policy)
Query cost$5 per TB scanned$5 per TB scanned (same)
External eventsPossible (other clouds, on-prem)Not possible
Multi-accountOrganization-enabled EDSOrganization Trail + S3
Operational burdenLow (AWS managed)High (ETL, partition, and schema management)
Duplicate costCaution: double billing when used together with a TrailSingle billing when only a Trail is used

The columnar storage design of CloudTrail Lake is the standard approach of OLAP (Online Analytical Processing) databases. Where row-based storage (OLTP) is optimized for quickly reading all the columns of a specific row, columnar storage greatly reduces I/O and cost for analytic queries that scan only specific columns (for example, eventName, sourceIPAddress). Apache Parquet, Google BigQuery, and Amazon Redshift work on the same principle. Most audit queries are column-oriented patterns that "find all rows with a specific eventName," so Lake's columnar storage is advantageous.

Comparing Config Rule Evaluation Triggers

Trigger typeWhen it runsExample Rules that fit
Configuration changeImmediately upon detecting a resource configuration changes3-bucket-public-read-prohibited, ec2-imdsv2-check
Periodic (1h/3h/6h/12h/24h)Full evaluation at each configured intervaliam-password-policy, Rules based on the user list
Hybrid (both)On change + at each intervalImportant Rules that must also catch drift after a change

The Configuration change trigger evaluates the Rule right after AWS Config consumes CloudTrail events, detects a resource change, and creates a CI (Configuration Item). Therefore, if CloudTrail is not working properly, the configuration change trigger of Config Rules is also delayed. The Periodic trigger does not have this dependency and runs on Config's internal scheduler. Rules based on external system state (Credential report, IAM user list) need checking even without a "configuration change," so Periodic is right.

Audit Manager vs Config vs Trusted Advisor

ItemAWS ConfigAWS Audit ManagerAWS Trusted Advisor
Main roleResource state evaluation, Rule violation detectionCompliance evidence collection, report automationAWS best-practice recommendations
OutputRule evaluation results, NON_COMPLIANT listPDF/CSV audit reports, evidence per ControlCheck results, recommendations
Framework conceptConformance Pack (similar)Central (HIPAA, PCI-DSS, SOC 2, etc.)None
Auditor supportNoneAuditor account invitation and review workflowNone
Automatic remediationAuto Remediation yesNone (reports only)None
CostCI + Rule billed separatelyBilled per AssessmentIncluded in Business/Enterprise Support

The "Continuous Compliance" concept that Audit Manager automates has its theoretical basis in NIST SP 800-137 "Information Security Continuous Monitoring." The key is the shift from an annual snapshot audit to continuous evidence collection. PCI-DSS v4.0 (released in 2022) changed in the direction of explicitly recommending continuous monitoring, and running Audit Manager Assessments continuously is the standard implementation that meets this requirement.

Comparison with Other Cloud Platforms

CapabilityAWSGCPAzure
API audit logsCloudTrailCloud Audit LogsAzure Activity Log
Resource state trackingAWS ConfigAsset InventoryAzure Resource Graph
SQL audit analysisCloudTrail LakeBigQuery AuditLog Analytics
Compliance evaluationConfig RulesSecurity Command CenterAzure Policy
Audit report automationAudit ManagerCompliance Reports ManagerMicrosoft Purview Compliance Manager
Organization auditOrganization TrailOrg-level Audit LogsManagement Group policy
Anomaly detectionCloudTrail InsightsSecurity Command Center AIMicrosoft Sentinel

GCP's Cloud Audit Logs is similar to CloudTrail, but differs in that Data Access logs are disabled by default and, when enabled, are included in Cloud Logging costs. Azure Activity Log keeps subscription-level control plane operations for 90 days (default), and for long-term retention you must export to a Log Analytics Workspace or Storage Account, which is similar to the CloudTrail S3 Trail. The structure is the same across all three platforms: "a default audit log exists, but data plane (object access) logs require separate enablement + additional cost."

Internals of Organization Trail and Governance Patterns

When an Organization Trail is turned on, every event occurring in member accounts is aggregated into an S3 bucket in the management account. Member account users cannot modify or delete this Trail. This lock mechanism is the core of security governance.

[Management Account]
  └─ Create Organization Trail
       ├─ S3 bucket: s3://org-audit-logs/
       │    └─ Prefix: AWSLogs/{org-id}/{account-id}/
       └─ Applied automatically to all member accounts
            ├─ Account A: Trail READ-ONLY (cannot delete/modify)
            ├─ Account B: Trail READ-ONLY
            └─ Account C: Trail READ-ONLY (applied automatically to new accounts)

As a hypothetical case, in 2021 a Korean SI company, Company B, had a member account administrator accidentally delete a Trail, leaving 2 weeks without audit logs. The log gap for that period was found in an external security audit, and considerable manpower was spent manually preparing additional explanatory materials. Afterward, they enabled an Organization Trail and applied an SCP that denies the cloudtrail:DeleteTrail and cloudtrail:StopLogging actions in member accounts. Even when an Organization Trail exists, doubly blocking Trail tampering with an additional SCP is the standard governance pattern.

CloudTrail Insights: The Limits of ML-Based Anomaly Detection and Suitable Use Cases

Insights learns the past 7 days of data as a baseline, and generates an Insight event when the current API call volume or error rate deviates in a statistically significant way. There are two types.

  • ApiCallRateInsight: the call volume of a specific API spikes relative to the baseline
  • ApiErrorRateInsight: the error rate of a specific API surges relative to the baseline

⚠️ Pitfall: Insights only does meaningful detection after the 7-day learning period. Right after you deploy a service or the traffic pattern changes completely, there are many false positives. Also, Insights works only in accounts where a Trail is enabled. And Insights itself has a separate cost ($0.35/100K analyzed events). For small accounts, it is good to compare cost efficiency with GuardDuty's CloudTrail-based threat detection. GuardDuty automatically analyzes CloudTrail and generates Findings, so it complements Insights.

The ML algorithm of CloudTrail Insights is not public, but the algorithms suited to detecting anomalies in API call volume are CUSUM (Cumulative Sum Control Chart) and EWMA (Exponentially Weighted Moving Average). CUSUM is a statistical method that cumulatively detects a change in the mean in a time series, proposed by Page (1954). It is effective at detecting small, persistent changes (the low and slow data exfiltration often seen in APT attacks). It is likely that this approach is used for CloudTrail Insights to detect an increase in S3 GetObject that happens little by little overnight.

Failure Patterns of Auto Remediation and SSM Automation

Auto Remediation automatically runs an SSM Automation Runbook when a Config Rule detects NON_COMPLIANT. In practice, 90% of "it does not work" cases come from one of three causes.

  1. Insufficient AutomationAssumeRole permissions: the IAM Role used when the Runbook runs lacks permission to modify the target resource
  2. Runbook parameter mapping error: the resource ARN from the Config Rule is not passed correctly as an input parameter of the Runbook
  3. The resource was already deleted: the resource disappeared between the time the Rule evaluated it and the time the Runbook ran

As a hypothetical case, in 2023 Company C in the financial sector connected Auto Remediation to the s3-bucket-public-read-prohibited Rule. It worked well in the test environment but not in production. The investigation found that the AutomationAssumeRole's permission to modify S3 bucket policy (s3:PutBucketPublicAccessBlock) existed for the test environment buckets, but the production buckets had a different Resource ARN pattern, so the permission was missing. The cause was identified by the message "AutomationExecution failed: Access Denied" in the "Remediation Execution Status" tab of the Config console. Using Resource: "*" in the AutomationAssumeRole goes against the principle of least privilege, but separating roles per rule is safer to prevent ARN pattern mistakes.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

A security team needs to trace "who downloaded customer PII data from the production S3 bucket." What CloudTrail setting is needed?

Question 2

You want to automate an immediate SNS notification + Slack notice when the Root user logs in to the console. Which combination of tools is the most suitable?

Question 3

A company wants to handle "automatically block when an S3 public bucket is created" without operator intervention. What is the most suitable combination?

Question 4

You must analyze one year of CloudTrail data with SQL for an external audit. What is the most suitable tool?

Question 5

Which service is most suitable for automatically detecting an abnormally large number of EC2 RunInstances calls?

Question 6

A company must submit HIPAA compliance evidence to an external auditor. What is the most efficient tool?

Question 7

You want to see non-compliant resources across multiple accounts at a glance. Which configuration is the standard?

Question 8

Auto Remediation is configured, but NON_COMPLIANT resources are not being remediated automatically. What is the troubleshooting order?

Question 9

You want to automatically block EC2 launches when the 200-core limit of a Microsoft Windows BYOL license is exceeded. Which tool is needed?

Question 10

You must prove the integrity of a Trail to an external auditor. What feature is needed, and how do you verify?

Week 5 Preview: The Core Weapon of CloudOps, AWS Systems Manager

In Week 5, if CloudWatch and CloudTrail track "what is happening" and "who did it," Systems Manager (SSM) is the operational execution engine that automates "how to fix and maintain."

  • Day 1: SSM overview, Agent installation patterns, Fleet Manager, Inventory collection
  • Day 2: Run Command, State Manager (enforcing Desired State), Maintenance Window
  • Day 3: Patch Manager: baselines, patch groups, patch compliance
  • Day 4: Parameter Store (SecureString/KMS), Session Manager (an SSH replacement without a VPN), Automation Runbook
  • Day 5: Week 5 review + 10 scenario questions

SSM is, together with CloudWatch, one of the top single-weight services in SOA-C02. Auto Remediation, Patch Manager, Run Command, and Parameter Store are staple exam scenarios. CloudTrail's Auto Remediation Runbook, Config's Remediation Execution, and CloudWatch Alarm's EC2 Action are all connected to SSM, so when Week 5 ends, Weeks 3-5 connect into one complete operations automation loop.

PreviousAudit Manager, License Manager, Resource Explorer: Audit Automation and Operational Visibility DesignWeek 4 · Day 4Next AWS Systems Manager: The Operator's Central Control TowerWeek 5 · Day 1

Official references

  • SOA-C02 official exam page(opens in a new tab)
  • AWS CloudTrail documentation(opens in a new tab)
  • Amazon S3 documentation(opens in a new tab)
  • AWS Systems Manager documentation(opens in a new tab)
  • Amazon CloudWatch documentation(opens in a new tab)
  • Amazon SNS documentation(opens in a new tab)

On this page

  • The Concept Map of Week 4
  • Key Comparison Tables
  • Comparison with Other Cloud Platforms
  • Internals of Organization Trail and Governance Patterns
  • CloudTrail Insights: The Limits of ML-Based Anomaly Detection and Suitable Use Cases
  • Failure Patterns of Auto Remediation and SSM Automation
  • Practice Questions
  • Week 5 Preview: The Core Weapon of CloudOps, AWS Systems Manager