# Anomaly Detection

Anomaly detection identifies data or events that deviate from expected patterns and warrant investigation.

Cloud concept. Updated 2026-10-29. Page: https://blowstack.com/tools/cloud-concepts-hub/anomaly-detection

> Anomaly detection compares observed activity with an established baseline, statistical model, or expected pattern to identify unusual behavior. In cloud security, it helps engineers detect potentially compromised identities, unexpected network activity, and abnormal resource usage that fixed rules alone might miss. An anomaly is evidence for investigation, not proof of an attack.

Practice exams covering Anomaly Detection: [ANS-C01 AWS Certified Advanced Networking - Specialty](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty), [SOA-C03 AWS Certified CloudOps Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate), [DVA-C02 AWS Certified Developer - Associate](https://blowstack.com/practice-exams/aws-certified-developer-associate), [DOP-C02 AWS Certified DevOps Engineer - Professional](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional), [AIP-C01 AWS Certified Generative AI Developer - Professional](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional), [MLA-C02 (beta) AWS Certified Machine Learning Engineer - Associate](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate), [SCS-C03 AWS Certified Security - Specialty](https://blowstack.com/practice-exams/aws-certified-security-specialty), [SAP-C03 AWS Certified Solutions Architect - Professional](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional).

## 6 key aspects of Anomaly Detection

Effective anomaly detection combines contextual baselines, reliable telemetry, complementary rules, tuned sensitivity, and validated response workflows.

1. **Contextual baselines**: Define expected behavior for the relevant identity, resource, workload, or account rather than relying only on organization-wide averages. Include time-of-day and seasonal patterns when they materially affect activity.
2. **Complete and trustworthy telemetry**: Collect the audit events, metrics, and network observations needed for the detection use case. Monitor collection failures, account coverage, and regional coverage so gaps do not silently weaken detection.
3. **Complementary detection methods**: Use anomaly models for unexpected behavior and deterministic rules for known threats or prohibited actions. A fixed threshold is not inherently inferior; its suitability depends on the signal and operating context.
4. **Sensitivity and baseline management**: Tune detection sensitivity against both false positives and missed activity. Reassess baselines after legitimate workload changes and account for exceptional periods without permanently suppressing important signals.
5. **Correlated, actionable alerts**: Enrich anomalous observations with identity, resource sensitivity, related events, and severity. Route alerts to an accountable responder and require stronger evidence before taking disruptive automated action.
6. **Continuous validation**: Test detections using controlled scenarios and review their performance during real incidents. Dashboards should expose observed behavior, expected ranges, telemetry gaps, and alert trends.

## Cloud services for Anomaly Detection

Use GuardDuty for managed threat detection and CloudWatch for anomaly-based metric alarms and dashboards. Security Lake supplies centralized, normalized security data for subscriber analysis and investigation, while Security Hub brings supported findings into a common operational view. Macie adds information about sensitive data and S3 security concerns, helping responders prioritize affected resources. EventBridge routes selected findings and alarm transitions to notification, ticketing, or remediation workflows. These roles are complementary: collecting data, detecting unusual activity, aggregating findings, and responding are separate functions. Configure account and regional coverage explicitly, and validate the complete path from telemetry generation to responder notification.

- **[Amazon GuardDuty](https://blowstack.com/tools/cloud-services-hub/amazon-guardduty)**: GuardDuty analyzes supported AWS activity sources using techniques that include behavioral analysis, machine learning, and threat intelligence. It produces security findings for suspicious activity, but not every finding is based on anomaly detection.
- **[Amazon CloudWatch](https://blowstack.com/tools/cloud-services-hub/amazon-cloudwatch)**: CloudWatch metric anomaly detection models expected behavior and exposes an expected-value band for supported metrics. Engineers can configure alarms against that band and use dashboards to compare observed activity with expected patterns.
- **[Amazon Security Lake](https://blowstack.com/tools/cloud-services-hub/amazon-security-lake)**: Security Lake centralizes supported security data in a customer's AWS account and normalizes supported sources to the Open Cybersecurity Schema Framework. Subscribers can query or process that data for anomaly detection and investigation; Security Lake does not itself generate anomaly findings.
- **[AWS Security Hub](https://blowstack.com/tools/cloud-services-hub/aws-security-hub)**: Security Hub aggregates supported security findings and provides centralized visibility across configured accounts and Regions. It helps responders review findings in context, but finding aggregation is not itself behavioral anomaly detection.
- **[Amazon Macie](https://blowstack.com/tools/cloud-services-hub/amazon-macie)**: Macie discovers sensitive data in supported S3 objects and generates findings about sensitive data and S3 security concerns. These findings help prioritize investigations involving unusual activity around sensitive storage, but Macie is not a general-purpose behavioral anomaly detector.
- **[Amazon EventBridge](https://blowstack.com/tools/cloud-services-hub/amazon-eventbridge)**: EventBridge routes supported security findings and CloudWatch alarm state-change events to response workflows. Rules can select events by relevant attributes, but EventBridge performs event routing rather than statistical anomaly detection.

## Anomaly Detection exam questions

Real practice exam questions on Anomaly Detection, with the correct answer and its explanation.

### Question 1 (MLA-C02 (beta))

**Question:**

A manufacturer uses an AWS Glue ETL job to prepare machine telemetry for ML training. Each record contains an operating mode, motor load, and coolant flow. Engineers have a verified reference dataset of healthy operation for each mode. Some sensor faults produce load–flow combinations that are common in one mode but inconsistent with the relationship in another mode, even though each measurement is individually within its mode's typical range. Legitimate extreme measurements must not be changed automatically.

Which approach should the ML engineer add to the preparation pipeline to identify suspected faulty records for review?

**Correct answer:** Fit a multivariate model to the verified load–flow relationships for each operating mode. Score each incoming record against its mode's model and route unusually low-likelihood records, with their original values, for review.

**Explanation:** A mode-specific multivariate baseline can detect combinations that violate the expected relationship even when neither measurement is individually extreme. Preserving the original records for review avoids treating an anomaly score as proof of corruption or automatically changing legitimate extremes.

### Question 2 (SAP-C03)

**Question:**

A payment processor publishes a custom CompletedPayments metric to Amazon CloudWatch every minute, including zero values when no payments complete. Payment volume has predictable hourly and weekly patterns, but the normal volume gradually changes as merchants join the platform. A fixed low-volume threshold has missed daytime processing failures and generated false alarms overnight.

The operations team needs an alert when the 5-minute Sum is unusually low for the expected workload in at least 3 of the latest 5 evaluation periods. Unusually high volume must not trigger this alert. Two known processing outages occurred during the previous week. Their metric data must remain available for investigation but must not influence the learned baseline. The solution must adapt without custom model-training code or scheduled threshold updates and must notify an existing Amazon SNS topic.

Which configuration meets these requirements?

**Correct answer:** Configure a CloudWatch anomaly detector for the metric's 5-minute Sum and exclude the two outage time ranges from model training. Create an alarm on that Sum that breaches below the lower expected band, with 3 datapoints to alarm out of 5 evaluation periods. Configure the SNS topic as its ALARM action.

**Explanation:** CloudWatch learns expected patterns and adapts as the workload changes. Training exclusions prevent the known outages from influencing the model without deleting their metric data. A lower-band comparison detects only unusually low volume, and a 3-of-5 evaluation implements the required persistence. The SNS alarm action provides notification.

### Question 3 (SOA-C03)

**Question:**

A company publishes an application's processing latency to Amazon CloudWatch every minute. Normal latency follows predictable daily and weekly patterns. Overnight incidents can produce latency that is abnormal for that time but still below normal daytime peaks.

The company recently performed several load tests that produced unusually high latency. The test timestamps are documented, and metric publication was uninterrupted. A CloudOps engineer must configure alerting that detects unexpected latency increases without alerting on normal seasonal changes. The load-test results must not make future production slowdowns appear normal. The solution must require minimal ongoing threshold maintenance.

Which configuration meets these requirements?

**Correct answer:** Create a CloudWatch anomaly detection model for the latency metric and statistic. Exclude the documented load-test intervals from model training, and create an alarm that detects values above the model's upper band.

**Explanation:** CloudWatch anomaly detection learns expected patterns, including daily and weekly seasonality. Excluding the load-test intervals from training prevents those unusual observations from distorting the expected range. An upper-band alarm detects unusually high latency relative to the expected behavior for that time.

### Question 4 (AIP-C01)

**Question:**

A company operates a research assistant that invokes external search tools. For each tool, the application publishes execution-duration measurements to Amazon CloudWatch. Each one-minute period contains enough measurements to calculate a reliable p95. Normal p95 latency follows a repeatable hourly and weekly pattern, and latency that is normal during a weekday peak would be unusual overnight.

During the past week, a six-hour load test intentionally saturated one tool's downstream service. The test produced unusually high latency, but production conditions have since returned to normal. The operations team needs automated alerts when that tool's p95 latency deviates above its expected pattern, even if it remains below the application's overall latency limit. The load-test interval must remain visible for investigations but must not influence the expected pattern. The company wants to use CloudWatch's managed statistical monitoring rather than maintain custom forecasting code.

Which configuration best meets these requirements?

**Correct answer:** Create a CloudWatch anomaly detector for the tool's p95 latency and configure the load-test interval as an excluded training time range. Create an alarm that evaluates latency against the upper anomaly detection band.

**Explanation:** CloudWatch anomaly detection models expected metric behavior, including recurring temporal patterns. Excluding the known load-test interval from model training prevents that abnormal activity from influencing the baseline without deleting the metric history. An upper-band alarm detects unusually high latency relative to the expected pattern rather than only violations of a fixed latency limit.

### Question 5 (DVA-C02)

**Question:**

A developer reviews a CloudWatch dashboard for a production application's request latency. The dashboard displays the metric and a learned expected-value band, and an alarm detects values above the band. Yesterday, a planned 3-hour load test produced unusually high latency. The expected band has since widened, reducing the alarm's ability to detect smaller production regressions. Normal traffic has predictable daily peaks.

The developer must prevent the known load-test interval from influencing the expected band while retaining the metric data for investigation and preserving monitoring during future periods. Which action should the developer take?

**Correct answer:** Configure the metric's anomaly detector to exclude the load-test time range from model training.

**Explanation:** CloudWatch anomaly detection supports excluding specified time ranges from model training. Excluding the known, nonrepresentative load test prevents that interval from influencing the expected band without deleting the underlying metric data or disabling future monitoring.

### Question 6 (SCS-C03)

**Question:**

A company delivers security audit logs from a proprietary authorization service to an Amazon CloudWatch Logs log group that uses the Standard log class. A recent application compromise introduced previously unseen audit message patterns, but the total number of log events remained within its normal range. Existing alarms on event counts did not detect the change.

The security team needs ongoing monitoring that learns the application's log patterns and surfaces unusual changes for investigation, including newly appearing patterns. Analysts must be able to review the anomalous patterns and their supporting log events. The solution must not require predefined message signatures, manually initiated comparisons, or custom analysis code.

Which solution best meets these requirements?

**Correct answer:** Create a CloudWatch Logs anomaly detector for the log group with an appropriate evaluation frequency. Use the CloudWatch Logs anomaly view to investigate detected patterns and their associated log events.

**Explanation:** CloudWatch Logs anomaly detection learns patterns from log events and continuously evaluates incoming logs for deviations, including new patterns. Analysts can review anomalies and supporting events without maintaining signatures or custom analysis code.

### Question 7 (DOP-C02)

**Question:**

A company monitors an application's one-minute p95 latency metric with an Amazon CloudWatch alarm. The alarm compares latency with the upper boundary of ANOMALY_DETECTION_BAND(m1, 3) and requires three breaching data points within five evaluation periods. The model correctly follows the application's recurring workload patterns.

During controlled testing, a small but operationally significant latency regression lasts for 10 consecutive minutes. Every data point remains inside the expected band, so the alarm stays in OK. Larger regressions trigger the alarm successfully. The training history contains representative production behavior and no known incidents.

A DevOps engineer must make the alarm more sensitive to smaller sustained latency regressions while preserving the one-minute p95 measurement, the three-out-of-five evaluation, and the valid training history. Which change should the engineer make?

**Correct answer:** Change the expression to ANOMALY_DETECTION_BAND(m1, 2) and continue comparing latency with the upper boundary.

**Explanation:** The second argument controls the width of the expected band. Reducing it narrows the band, making smaller upward deviations eligible to breach. This increases sensitivity to latency regressions without changing the metric statistic, evaluation periods, required breach count, or training history.

### Question 8 (ANS-C01)

**Question:**

A company publishes a custom CloudWatch metric containing the total bytes sent each minute from a production VPC to internet destinations outside an approved allowlist. The metric has four weeks of history and predictable hourly and weekday traffic patterns. Security engineers want to detect unusually high outbound traffic without maintaining separate thresholds for different times of day. They must notify an existing Amazon SNS topic when at least three of the five most recent one-minute periods have unusually high traffic, even if those periods are not consecutive. Unusually low traffic must not trigger this notification. Which solution meets these requirements?

**Correct answer:** Create a CloudWatch anomaly detection alarm on the metric's one-minute Sum. Configure it to alarm above the upper anomaly detection band, with three datapoints to alarm out of five evaluation periods. Configure the SNS topic as its ALARM action.

**Explanation:** CloudWatch anomaly detection models expected behavior, including recurring hourly and weekday patterns. An upper-band alarm detects unusually high traffic without alarming on unusually low traffic. Three datapoints to alarm out of five evaluation periods implements the required nonconsecutive three-of-five evaluation. The SNS action sends the notification when the alarm enters ALARM.

## Practice Anomaly Detection in a full exam

Questions on Anomaly Detection in each practice exam, with every answer option and an explanation for each:

- [DOP-C02](https://blowstack.com/practice-exams/aws-certified-devops-engineer-professional): 8 questions
- [AIP-C01](https://blowstack.com/practice-exams/aws-certified-generative-ai-developer-professional): 6 questions
- [MLA-C02 (beta)](https://blowstack.com/practice-exams/aws-certified-machine-learning-engineer-associate): 4 questions
- [SAP-C03](https://blowstack.com/practice-exams/aws-certified-solutions-architect-professional): 4 questions
- [SCS-C03](https://blowstack.com/practice-exams/aws-certified-security-specialty): 4 questions
- [SOA-C03](https://blowstack.com/practice-exams/aws-certified-cloudops-engineer-associate): 2 questions
- [DVA-C02](https://blowstack.com/practice-exams/aws-certified-developer-associate): 1 question
- [ANS-C01](https://blowstack.com/practice-exams/aws-certified-advanced-networking-specialty): 1 question

## What is Anomaly Detection

Anomaly detection asks whether an observation is unusual for its context, rather than simply whether it exceeds a fixed limit. A sudden increase in failed authentication attempts may be suspicious, but the same count can have different meanings for a small administrative application and a large public service. Useful detection therefore considers the identity, resource, account, time period, and normal workload associated with an event.

Detection methods include statistical comparisons, machine learning models, and deviations from explicitly defined expected behavior. A baseline might describe an application's normal outbound traffic, an identity's usual API activity, or the daily pattern of access-denied errors. Seasonal models can distinguish an expected weekday peak from an unexpected overnight surge. Not all anomaly detection requires machine learning, and not every security finding represents an anomaly; some findings identify known malicious indicators or violations of explicit policies.

In the cloud, begin with reliable telemetry. Collect relevant audit events, network flow information, DNS activity, application logs, and resource metrics. Preserve identity, account, Region, resource, and timestamp information so investigators can correlate observations. For an organization, establish consistent collection and detection coverage across accounts and Regions, and monitor whether those controls remain enabled. Missing telemetry creates blind spots, and missing data must not automatically be interpreted as normal behavior.

Translate important security signals into metrics and actionable alerts. For example, derive a metric from access-denied audit events and monitor its rate against an expected range. A dashboard can show the observed metric alongside its baseline, related findings, and recent deployments. Combine anomaly-based alarms with fixed rules for events that are always significant, such as unauthorized changes to logging controls. A static threshold can be appropriate even when no historical baseline exists.

For AWS metric monitoring, Amazon CloudWatch can model expected metric behavior and evaluate alarms against an anomaly detection band. Amazon GuardDuty applies threat-detection techniques, including behavioral analysis, to supported data sources and produces security findings. Amazon Security Lake centralizes normalized security data for analysis by subscribers; it is not itself an anomaly-detection engine. AWS Security Hub aggregates supported findings and provides centralized security visibility, while Amazon Macie identifies sensitive data and S3 security concerns rather than serving as a general user-behavior detector.

Alert handling should consider severity, confidence, affected resource sensitivity, and corroborating evidence. An unusual API call from a new location deserves more attention when accompanied by privilege changes or unexpected data access. Route relevant findings to an incident workflow, assign ownership, and provide links to supporting evidence. Use approval or additional validation before disruptive automated actions such as disabling an identity, because legitimate operational changes can resemble attacks.

The main trade-off is sensitivity versus noise. Narrow expected ranges may generate false positives during releases, migrations, or traffic shifts; wide ranges can miss subtle attacks. New workloads need representative history, and baselines can drift as behavior changes. Exclude known exceptional periods from model training where supported, but avoid broad suppressions that hide future incidents. Validate detections with controlled tests, review missed incidents and unnecessary alerts, and track detection latency and investigation outcomes. Anomaly detection complements deterministic controls and threat intelligence; it does not replace them or guarantee that malicious activity will look unusual.

## Learn Anomaly Detection in lessons

7 short lessons on Anomaly Detection in 6 certification courses.

- MLA-C02 (beta): Anomaly Detection: detecting outliers against expected patterns (Premium), https://app.blowstack.com/lessons/anomaly-detection-detecting-outliers-against-expected-patterns-mla-c02
- SAP-C03: Anomaly Detection: unexpected cloud spending (Premium), https://app.blowstack.com/lessons/anomaly-detection-unexpected-cloud-spending-sap-c03
- SOA-C03: Anomaly Detection: baseline-driven metric alarms (Premium), https://app.blowstack.com/lessons/anomaly-detection-baseline-driven-metric-alarms-soa-c03
- AIP-C01: Anomaly Detection vs. Model Drift (Premium), https://app.blowstack.com/lessons/anomaly-detection-vs-model-drift-aip-c01
- SCS-C03: Anomaly Detection: baseline-driven security alerts (Premium), https://app.blowstack.com/lessons/anomaly-detection-baseline-driven-security-alerts-scs-c03
- DOP-C02: Anomaly Detection: baseline-driven alarm tuning (Premium), https://app.blowstack.com/lessons/anomaly-detection-baseline-driven-alarm-tuning-dop-c02
