This section covers the following exam objective:
Domain 2: Incident Response
Task 2.1: Design and test an incident response plan
Threat detection in AWS relies on managed services that continuously monitor activity, configurations, and data to identify suspicious behavior, vulnerabilities, and compliance risks.
These services eliminate the need to build detection systems from scratch and provide seamless integration across accounts.
You should be able to:
AWS provides specialized services that focus on different aspects of security detection.
| Service | Primary Use Case | Key Characteristics |
|---|---|---|
| Amazon GuardDuty | Threat detection (IAM, EC2, S3, DNS, EKS) | ML-based anomaly detection, integrates with Security Hub |
| Amazon Macie | Sensitive data discovery in S3 | Detects PII/PHI, supports compliance |
| Amazon Inspector | Vulnerability scanning | Continuous assessments for EC2, ECR, Lambda |
| AWS Config | Configuration monitoring | Detects drift and policy violations |
| IAM Access Analyzer | Access analysis | Identifies unintended external access |
GuardDuty is the primary threat detection service and frequently appears in exam scenarios.
Effective threat detection requires more than identifying isolated events—it involves correlating multiple signals to uncover broader attack patterns.
| Technique | Description | AWS Service |
|---|---|---|
| Anomaly Detection | Identify deviations from baseline behavior | CloudWatch Anomaly Detection, GuardDuty |
| Correlation | Link findings across services | Amazon Detective, Security Hub |
| Validation | Query and confirm suspicious events | Amazon Athena, CloudTrail Lake |
Visualization tools help identify patterns and anomalies that may not be obvious in raw logs.
| Visualization Tool | Purpose |
|---|---|
| CloudWatch Dashboards | Visualize metrics and alarms |
| Security Hub Insights | Aggregate findings across accounts |
| Amazon QuickSight | Custom dashboards from Athena queries |
Centralization provides a unified view of security posture across accounts.
For multi-account environments, the correct approach is:
Security Hub + ASFF + EventBridge automation
After detection, findings must be analyzed for severity, accuracy, and context.
Always connect:
CloudWatch metric filters transform log patterns into measurable metrics, enabling detection of anomalies such as repeated login failures.
{
"filterPattern": "{ ($.eventName = ConsoleLogin) && ($.errorMessage = \"Failed authentication\") }",
"metricName": "FailedConsoleLogins",
"metricNamespace": "Security"
}
CloudWatch metric filters are often the first layer of anomaly detection before advanced services are used.
Amazon Athena allows SQL-based analysis of logs stored in S3, making it ideal for validating suspicious activity at scale.
import boto3athena = boto3.client("athena")response = athena.start_query_execution(
QueryString="""
SELECT *
FROM cloudtrail_logs
WHERE eventName='ConsoleLogin'
AND errorMessage='Failed authentication';
""",
QueryExecutionContext={"Database": "securitylogs"},
ResultConfiguration={"OutputLocation": "s3://my-athena-results/"}
)
This query identifies failed login attempts, which can indicate brute-force attacks.
Use Athena when:
Primary service for real-time threat detection:
Used for:
| Service | Focus Area |
|---|---|
| Macie | Sensitive data |
| Inspector | Vulnerabilities |
| Config | Misconfigurations |
| IAM Access Analyzer | Access exposure |
Avoid manual approaches—automation and managed services are key.
Detecting security threats and anomalies in AWS requires a multi-layered approach that combines:
Detection → Centralization → Correlation → Validation
Mastering this flow will help you confidently solve exam scenarios and design real-world AWS security solutions.