Learn Domain 2: Security Logging and Monitoring (AWS SCS-C02) with Interactive Flashcards
Master key concepts in Domain 2: Security Logging and Monitoring through our interactive flashcard system. Click on each card to reveal detailed explanations and enhance your understanding.
AWS CloudTrail
AWS CloudTrail is a critical AWS service that provides governance, compliance, operational auditing, and risk auditing of your AWS account. It continuously records and logs API calls and events made across your AWS infrastructure, capturing who made the request, what service was accessed, what action was performed, the parameters of the action, and the response returned.
CloudTrail is essential for Domain 2 (Security Logging and Monitoring) of the SCS-C02 exam. Here are its key aspects:
**Event Types:**
1. **Management Events** – Capture control plane operations like creating EC2 instances, configuring IAM policies, or setting up VPCs. These are enabled by default.
2. **Data Events** – Track data plane operations such as S3 object-level activity (GetObject, PutObject) and Lambda function invocations. These must be explicitly enabled.
3. **Insights Events** – Detect unusual API activity patterns, such as spikes in resource provisioning or IAM actions.
**Key Features:**
- **Trail Configuration**: Trails can be single-region or multi-region (recommended for security best practices). Organization trails can cover all accounts in AWS Organizations.
- **Log Storage**: Events are delivered to S3 buckets and optionally to CloudWatch Logs for real-time monitoring and alerting.
- **Log Integrity**: CloudTrail supports log file integrity validation using SHA-256 hashing to detect tampering.
- **Encryption**: Log files are encrypted by default using SSE-S3, but can be configured with SSE-KMS for enhanced security.
- **Integration**: Works with Amazon EventBridge, CloudWatch Alarms, SNS notifications, and AWS Athena for querying logs.
**Security Best Practices:**
- Enable multi-region trails across all accounts.
- Enable log file integrity validation.
- Restrict access to CloudTrail S3 buckets using bucket policies.
- Use KMS encryption for sensitive logs.
- Store logs in a centralized, dedicated security account.
- Monitor for trail disabling or modification using CloudWatch alarms.
CloudTrail Lake provides managed storage and SQL-based querying of events without needing separate S3 storage, simplifying log analysis for security investigations.
Amazon CloudWatch Logs and Metrics
Amazon CloudWatch Logs and Metrics are fundamental AWS services for security logging and monitoring, critical to the SCS-C02 exam's Domain 2.
**CloudWatch Logs** enables you to centralize, monitor, and store log data from AWS services, applications, and on-premises resources. Key features include:
- **Log Groups & Log Streams**: Logs are organized into log groups (containers) and log streams (sequences of events from the same source).
- **Log Insights**: A powerful query language for analyzing log data interactively, enabling security investigations and troubleshooting.
- **Metric Filters**: Transform log data into actionable CloudWatch metrics by defining patterns to search for (e.g., failed login attempts, unauthorized API calls).
- **Subscription Filters**: Real-time streaming of log data to services like AWS Lambda, Amazon Kinesis, or Amazon OpenSearch for further processing.
- **Encryption**: Logs can be encrypted using AWS KMS keys for data protection at rest.
- **Retention Policies**: Configurable retention periods from 1 day to indefinite, supporting compliance requirements.
**CloudWatch Metrics** provides real-time monitoring of AWS resources and applications:
- **Standard Metrics**: Automatically collected from AWS services (EC2 CPU utilization, S3 bucket sizes, etc.).
- **Custom Metrics**: User-defined metrics published via the PutMetricData API.
- **Alarms**: Trigger notifications via SNS or automated actions (e.g., Lambda functions, Auto Scaling) when thresholds are breached.
- **Anomaly Detection**: Uses machine learning to detect unusual patterns indicating potential security incidents.
- **Dashboards**: Visual representations for centralized security monitoring.
**Security Relevance:**
CloudWatch integrates with AWS CloudTrail to monitor API activity, VPC Flow Logs for network traffic analysis, and GuardDuty findings. Metric filters can detect suspicious patterns like root account usage, security group changes, or IAM policy modifications. CloudWatch Alarms enable automated incident response, while cross-account log aggregation supports centralized security monitoring in multi-account environments.
These services form the backbone of AWS security observability, enabling detection, alerting, and compliance auditing across your infrastructure.
VPC Flow Logs
VPC Flow Logs is a feature in Amazon Web Services (AWS) that enables you to capture detailed information about the IP traffic going to and from network interfaces in your Virtual Private Cloud (VPC). This is a critical tool for security logging and monitoring, directly relevant to Domain 2 of the AWS Certified Security – Specialty (SCS-C02) exam.
VPC Flow Logs can be configured at three levels: the VPC level, subnet level, or individual network interface level. Each flow log record captures fields such as source and destination IP addresses, source and destination ports, protocol, packet count, byte count, action (ACCEPT or REJECT), and log status.
Flow log data can be published to three destinations: Amazon CloudWatch Logs, Amazon S3, or Amazon Kinesis Data Firehose. When sent to S3, logs can be queried using Amazon Athena for cost-effective analysis. CloudWatch Logs enable real-time monitoring and alarm creation via metric filters.
From a security perspective, VPC Flow Logs are invaluable for several use cases: detecting unusual traffic patterns that may indicate a breach, identifying overly permissive security group rules by analyzing rejected versus accepted traffic, conducting forensic investigations after a security incident, and meeting compliance requirements for network traffic auditing.
Key considerations include: Flow Logs do not capture real-time data (there is a delay of several minutes). They do not log DNS traffic to Amazon-provided DNS servers, DHCP traffic, traffic to the instance metadata service (169.254.169.254), or Amazon Time Sync Service traffic. Flow Logs are not mutable once created — you must delete and recreate them to change configurations.
For the SCS-C02 exam, understanding how to integrate VPC Flow Logs with other AWS services like AWS CloudTrail, Amazon GuardDuty (which uses Flow Logs as a data source), and AWS Security Hub is essential. Enabling Flow Logs across all VPCs is considered a security best practice and supports a defense-in-depth monitoring strategy.
AWS Config Rules
AWS Config Rules are a powerful feature within AWS Config that enables continuous evaluation of your AWS resource configurations against desired settings and best practices. In the context of the AWS Certified Security – Specialty (SCS-C02) exam, understanding Config Rules is essential under Domain 2: Security Logging and Monitoring.
AWS Config Rules work by evaluating the configuration of AWS resources recorded by AWS Config. There are two types of rules: **AWS Managed Rules**, which are predefined and maintained by AWS (e.g., checking if S3 buckets have encryption enabled, ensuring EBS volumes are encrypted, or verifying that CloudTrail is enabled), and **Custom Rules**, which are authored using AWS Lambda functions to define organization-specific compliance logic.
Rules can be triggered in two ways: **Configuration Change-based**, which evaluates resources whenever a relevant configuration change is detected, and **Periodic**, which runs evaluations at a specified frequency (e.g., every 1, 3, 6, 12, or 24 hours).
When a rule evaluates a resource, it marks the resource as either **COMPLIANT** or **NON_COMPLIANT**. This compliance status is tracked over time, providing a compliance timeline for auditing purposes. Non-compliant resources can trigger automated remediation actions using **AWS Config Remediation Actions**, which integrate with AWS Systems Manager Automation documents to automatically fix misconfigurations.
For enterprise-scale deployments, **AWS Config Conformance Packs** allow you to bundle multiple Config Rules and remediation actions into a single deployable entity. These can be deployed across multiple accounts using AWS Organizations.
Key security use cases include detecting unencrypted resources, identifying overly permissive security groups, ensuring IAM policies follow least privilege, verifying multi-factor authentication (MFA) is enabled, and monitoring for public access to resources.
Config Rules integrate with Amazon EventBridge for real-time notifications, Amazon SNS for alerts, and AWS Security Hub for centralized compliance visibility. This makes them a cornerstone of proactive security monitoring and continuous compliance assessment in AWS environments.
Athena for Security Analysis
Amazon Athena is a serverless, interactive query service that plays a critical role in security analysis within AWS environments. It allows security professionals to analyze large volumes of log data stored in Amazon S3 using standard SQL queries, without the need to set up or manage any infrastructure.
**Key Security Use Cases:**
1. **VPC Flow Log Analysis:** Athena can query VPC Flow Logs to identify suspicious network traffic patterns, unauthorized access attempts, unusual data transfers, and connections to known malicious IP addresses.
2. **CloudTrail Log Analysis:** Security teams can use Athena to investigate API activity across AWS accounts, detect unauthorized API calls, identify privilege escalation attempts, and trace the timeline of security incidents.
3. **S3 Access Log Analysis:** Athena enables querying S3 server access logs to detect unauthorized data access, unusual download patterns, or potential data exfiltration attempts.
4. **ALB/ELB Log Analysis:** Load balancer logs can be analyzed to identify web application attacks, DDoS patterns, and anomalous request behaviors.
**How It Works:**
Athena uses AWS Glue Data Catalog to define table schemas over raw log data in S3. Once tables are created, analysts can run SQL queries directly against the data. It supports various formats including JSON, CSV, Parquet, and ORC.
**Security Benefits:**
- **Serverless:** No infrastructure to secure or maintain
- **Cost-Effective:** Pay only per query and data scanned
- **Scalable:** Handles petabytes of log data seamlessly
- **Integration:** Works with Amazon QuickSight for visualization and AWS Security Hub for centralized findings
- **Partitioning:** Supports data partitioning by date/region to optimize query performance and reduce costs
**Best Practices:**
- Use columnar formats like Parquet to reduce data scanned
- Partition logs by date for efficient querying
- Use workgroups to control query access and costs
- Encrypt query results using KMS
Athena is an essential tool for incident response, threat hunting, and continuous security monitoring in the AWS ecosystem.
Centralized Logging Architecture
Centralized Logging Architecture in AWS is a critical design pattern for the Security Specialty exam, focusing on aggregating logs from multiple AWS accounts, regions, and services into a single, secure location for analysis, monitoring, and compliance.
**Core Components:**
The architecture typically revolves around a dedicated **Log Archive account**, which serves as the central repository. AWS Organizations enables multi-account log aggregation, while AWS CloudTrail, VPC Flow Logs, AWS Config, and CloudWatch Logs serve as primary log sources.
**Key Design Principles:**
1. **Cross-Account Log Aggregation:** Organizations use CloudTrail organization trails to automatically collect API activity across all member accounts. S3 bucket policies and cross-account IAM roles allow logs to flow into the central logging account.
2. **Amazon S3 as Central Repository:** Logs are stored in dedicated S3 buckets with server-side encryption (SSE-KMS), versioning, Object Lock (WORM compliance), and lifecycle policies for cost-effective retention.
3. **Real-Time Streaming:** CloudWatch Logs subscription filters with Amazon Kinesis Data Firehose enable real-time log delivery to services like Amazon OpenSearch Service or Amazon S3 for immediate analysis.
4. **Security Controls:** The log archive account should have strict access controls, SCPs preventing log deletion, MFA delete on S3 buckets, and AWS KMS encryption keys managed centrally.
5. **AWS Control Tower Integration:** Control Tower automatically provisions a Log Archive account with preconfigured CloudTrail and AWS Config logging across all enrolled accounts.
**Analysis and Monitoring:**
Amazon Athena queries logs directly from S3, while Amazon OpenSearch provides search and visualization capabilities. Amazon Security Lake normalizes security logs into the OCSF format, enabling standardized analysis across multiple log sources.
**Compliance Benefits:**
Centralized logging supports regulatory requirements (PCI DSS, HIPAA, SOC 2) by ensuring log integrity, immutability, and defined retention periods. CloudTrail log file validation ensures tamper detection.
This architecture ensures complete visibility, rapid incident response, and audit readiness across the entire AWS environment.