AWS Centralized Logging Architecture — Overview
Centralized logging is a foundational security requirement across all AWS certifications. The SCS-C03 exam tests your ability to design multi-account logging architectures that aggregate, correlate, and alert on security events. This post covers the complete logging pipeline: from source collection (CloudTrail, VPC Flow Logs, DNS logs) through aggregation (Security Lake, CloudWatch) to analysis (Athena, OpenSearch, SIEM).
CloudWatch Alarms
GuardDuty Findings
Step Functions playbooks
Systems Manager runbooks
Athena queries
OpenSearch dashboards
Log Sources — What to Collect
| Source | What It Captures | Destination Options | Key Exam Points |
|---|---|---|---|
| CloudTrail | All API calls (who did what, when, from where) | S3, CloudWatch Logs | Organization trail covers ALL accounts. Management events on by default. Data events (S3/Lambda) must be explicitly enabled. |
| VPC Flow Logs | Network traffic metadata (src/dst IP, port, action) | S3, CloudWatch Logs | Does NOT capture packet content. Transit Gateway flow logs for inter-VPC. Enable in ALL VPCs. |
| Route 53 Resolver Logs | DNS queries from VPCs | S3, CloudWatch Logs, Kinesis Firehose | Detects DNS exfiltration, C2 communication. Share via RAM to Log Archive account. |
| GuardDuty Findings | Threat detections (recon, compromise, crypto-mining) | EventBridge, S3 (export) | Delegated admin aggregates all member findings. Auto-archives after 90 days. |
| AWS Config | Resource configuration changes, compliance | S3, SNS | Aggregator for multi-account/region view. Config rules for compliance detection. |
| S3 Access Logs | Bucket-level access (who accessed what object) | S3 (target bucket) | Different from CloudTrail S3 data events. Best-effort delivery. Use for audit trails. |
| ELB Access Logs | Request details (client IP, latency, status codes) | S3 | Captures client IP even behind CloudFront. Useful for forensics. |
| WAF Logs | Web requests matched/blocked by WAF rules | S3, CloudWatch Logs, Kinesis Firehose | Full request headers, rule matched. Essential for tuning WAF rules. |
Organization CloudTrail Trail
- Setup: Create from the management account → automatically applies to ALL member accounts
- Storage: Central S3 bucket in Log Archive account with bucket policy allowing organization trail delivery
- Protection: S3 Object Lock (WORM), MFA Delete, bucket policy denying s3:DeleteObject, KMS encryption
- Validation: CloudTrail log file integrity validation (SHA-256 hash chain). Detects if log files are modified/deleted.
- Key exam trap: Member accounts can see the trail but CANNOT modify or delete it. Only the management account can.
Cross-Account Log Aggregation Patterns
| Pattern | How | Best For |
|---|---|---|
| Org Trail to Central S3 | Organization trail → S3 bucket in Log Archive account | CloudTrail API logs (cheapest, simplest) |
| CloudWatch Cross-Account | Source accounts → CloudWatch Logs destination (Kinesis/Firehose) → Central account | Real-time application logs, Lambda logs |
| Security Lake (Delegated Admin) | Delegated admin auto-collects from all member accounts | Unified OCSF schema, SIEM integration |
| Kinesis Firehose Cross-Account | Source account → cross-account Firehose delivery stream → S3/OpenSearch | High-volume streaming logs (VPC Flow, custom) |
Amazon Security Lake (OCSF)
- What: Centralized security data lake that automatically collects logs from 80+ AWS and third-party sources
- Schema: Normalizes ALL data to Open Cybersecurity Schema Framework (OCSF) — single schema regardless of source
- Storage: S3 with Apache Iceberg tables (efficient querying, time-travel)
- Sources: CloudTrail, VPC Flow Logs, Route 53, Security Hub, Lambda execution, S3 data events, EKS audit, WAF
- Subscribers: Query via Athena, or grant data access to third-party SIEMs (Splunk, Datadog, CrowdStrike)
- Multi-account: Delegated administrator collects from all Organization member accounts automatically
- Regions: Rollup regions — aggregate from multiple regions into one central region
- Exam relevance: “Normalize logs from multiple sources into a unified schema” → Security Lake
CloudWatch Logs — Real-Time Analysis
- Metric Filters: Parse log events → extract metrics → create alarms (e.g., count of “UnauthorizedAccess” → alarm if > 5/min)
- Subscription Filters: Stream logs in real-time to Lambda, Kinesis, Firehose, or OpenSearch
- Cross-Account Subscriptions: Source account creates subscription filter → sends to destination in central account (Kinesis/Firehose)
- Insights Queries: SQL-like queries across log groups. Find patterns, anomalies, top talkers.
- Data Protection: Mask sensitive data (SSN, credit cards) in logs automatically using data protection policies
- Retention: Configure per log group (1 day to 10 years, or never expire). Exam: default is never expire (costs money!).
Log Protection — Integrity & Access Control
| Control | Implementation | Purpose |
|---|---|---|
| Immutability | S3 Object Lock (Governance or Compliance mode) | Prevent log deletion/modification (WORM) |
| Encryption | SSE-KMS with customer-managed key | Encrypt logs at rest, control access via key policy |
| Integrity Validation | CloudTrail log file validation (digest files) | Detect if logs were tampered with |
| Access Separation | Log Archive account with restricted access (separate from workload accounts) | Least privilege — ops teams can’t delete logs |
| Alerting on Tampering | EventBridge rule for StopLogging/DeleteTrail API calls | Detect if someone tries to disable logging |
Exam Tips
| Exam | Key Points |
|---|---|
| SCS-C03 | “Centralized logging across all accounts” → Organization CloudTrail trail + S3 in Log Archive. “Normalize logs from multiple sources” → Security Lake (OCSF). “Real-time alerting on API calls” → CloudTrail → CloudWatch Logs → Metric Filter → Alarm. “Prevent log tampering” → S3 Object Lock + separate Log Archive account + log file integrity validation. “Detect disabled logging” → EventBridge rule on StopLogging. “Third-party SIEM integration” → Security Lake subscriber or Kinesis Firehose. |
| SAP-C02 | “Multi-account logging strategy” → Organization trail + dedicated Log Archive account. “Query logs across accounts” → Athena on centralized S3 or Security Lake. |
AWS Certification Exam Practice Questions
Question 1:
A security engineer needs to ensure that API activity logs from all 50 AWS accounts in the organization cannot be modified or deleted, even by administrators in those accounts. The logs must be retained for 7 years. Which solution meets these requirements?
- Create individual CloudTrail trails in each account sending to a local S3 bucket with versioning enabled
- Create an organization trail sending to an S3 bucket in a dedicated Log Archive account with S3 Object Lock in Compliance mode
- Create an organization trail sending to CloudWatch Logs with a 7-year retention policy
- Create individual trails with log file integrity validation enabled and MFA Delete on each bucket
Show Answer
Answer: B — An organization trail automatically collects logs from ALL member accounts. Storing in a separate Log Archive account means workload account admins cannot access the bucket. S3 Object Lock in Compliance mode prevents ANYONE (including root) from deleting objects until retention expires (7 years). Member accounts cannot modify or delete the organization trail. Individual trails (A, D) can be modified by account admins.
Question 2:
A company needs to detect within 1 minute when someone disables CloudTrail logging in any account. The detection must trigger an automated Lambda function to re-enable the trail. Which approach achieves this?
- AWS Config rule checking CloudTrail status with auto-remediation via SSM
- Organization trail → CloudWatch Logs → metric filter for StopLogging → alarm → SNS → Lambda
- EventBridge rule in each member account for StopLogging/DeleteTrail events → central event bus → Lambda
- GuardDuty finding for “Stealth:IAMUser/CloudTrailLoggingDisabled” → EventBridge → Lambda
Show Answer
Answer: C — EventBridge rules can detect CloudTrail API events (StopLogging, DeleteTrail) in near real-time. With organization-wide EventBridge rules forwarding to a central event bus, the Lambda function can re-enable the trail immediately. GuardDuty (D) also detects this but has a delay (typically 5-15 minutes). Config (A) checks periodically (not within 1 minute). CloudWatch metric filter (B) works but requires CloudTrail to be sending to CloudWatch Logs first — if the trail is stopped, no new events flow.
Question 3:
A company wants to aggregate security logs from CloudTrail, VPC Flow Logs, Route 53 DNS logs, and GuardDuty findings into a single data store. They need to query all sources with a unified schema. Third-party security tools must also access this data. Which solution provides this?
- Send all logs to a central S3 bucket, create Glue crawlers for each source, query with Athena
- Send all logs to CloudWatch Logs in a central account, use CloudWatch Logs Insights
- Enable Amazon Security Lake with delegated administrator, configure subscriber access for third-party tools
- Send all logs to Amazon OpenSearch Service with custom index templates per source
Show Answer
Answer: C — Security Lake automatically collects from all listed sources, normalizes to OCSF (unified schema), stores in S3 with Apache Iceberg tables, and supports subscribers (third-party SIEMs get direct data access). Option A requires manual schema management per source (no unified schema). CloudWatch Insights (B) doesn’t provide a unified schema or third-party access. OpenSearch (D) requires custom integration for each source.
Question 4:
A security team needs to analyze VPC Flow Logs across 100 accounts to find connections to known malicious IPs. The logs are stored in S3 in a central account. They want the lowest-cost query solution that doesn’t require infrastructure management. Which approach is best?
- Import logs into Amazon OpenSearch Service and create dashboards
- Use Amazon Athena with partitioned tables (by account, date, region) to query directly from S3
- Stream to Amazon Kinesis Data Analytics for real-time threat detection
- Load into Amazon Redshift for analytics queries
Show Answer
Answer: B — Athena is serverless (no infrastructure), queries S3 directly, and charges only per data scanned. Partitioning by account/date/region minimizes scan cost. OpenSearch (A) and Redshift (D) require provisioned infrastructure. Kinesis (C) is for real-time streaming, not ad-hoc historical analysis. This is the standard pattern for cost-effective log analysis.
Question 5:
A company’s CloudWatch Logs contain sensitive PII (Social Security numbers) from application logs. The security team needs to ensure PII is masked in log output while still allowing full log access for authorized incident responders. Which approach meets both requirements?
- Create a Lambda function to process logs before ingestion, redacting PII patterns
- Configure CloudWatch Logs data protection policy to mask SSN patterns, grant unmask permission to incident response IAM role
- Encrypt logs with KMS key accessible only to incident responders
- Create two separate log groups — one with PII (restricted) and one without (general access)
Show Answer
Answer: B — CloudWatch Logs data protection policies automatically detect and mask sensitive data (SSN, credit cards, etc.) using managed data identifiers. The logs:Unmask permission can be granted to specific IAM roles — allowing incident responders to see full data while regular users see masked output. This is a built-in feature requiring no custom code (unlike A) and doesn’t require separate log groups (unlike D).
Related Posts
- Config vs CloudTrail vs CloudWatch Compared
- Security Services Architecture – GuardDuty & Security Hub
- Multi-Account Architecture
- Data Lake & Analytics Architecture
- Incident Response Architecture
- IAM Security Architecture
References
- Creating an Organization Trail — AWS Docs
- Amazon Security Lake User Guide
- Centralized Flow Log Data — AWS Security Blog
- Log Archive Account — AWS Security Reference Architecture
Frequently Asked Questions
What is the difference between CloudTrail and VPC Flow Logs?
CloudTrail logs API calls (who created/modified/deleted AWS resources). VPC Flow Logs capture network traffic metadata (source/destination IPs, ports, accepted/rejected). CloudTrail tells you “who changed the security group rule.” Flow Logs tell you “what traffic is flowing through the network.” Both are essential for security — they answer different questions.
Security Lake vs manually sending logs to S3?
Security Lake automatically collects from 80+ sources, normalizes everything to the OCSF schema (unified format), partitions data for efficient querying, and supports direct subscriber access for SIEMs. Manual S3 aggregation requires you to set up each source individually, manage different schemas, and build custom integrations. Security Lake is the managed approach for organizations with multiple log sources and SIEM requirements.
How do I protect logs from being deleted by compromised admin accounts?
Three layers: (1) Separate Log Archive account — workload account admins have no access. (2) S3 Object Lock Compliance mode — even root cannot delete until retention expires. (3) Organization trail — member accounts cannot modify or delete it. Additionally, enable log file integrity validation to detect tampering, and create EventBridge rules to alert on any StopLogging/DeleteTrail API calls.