Back to Checks
CloudWatch metric alarm has actions configured for the ALARM state
cloudwatch_alarm_actions_alarm_state_configured
Service: cloudwatchSeverity: high
OfficialBuilt-inVerified
Categories:resilience
Resource Type:AwsCloudWatchAlarm
Amazon CloudWatch metric alarms are evaluated for actions configured for the ALARM state. The finding flags alarms that have no action to execute when their monitored metric crosses its threshold.
Risk
Without an ALARM action, threshold breaches trigger no notification or automated response. This delays detection and containment, risking:
- Availability: prolonged outages or missed scale-out
- Integrity/confidentiality: unchecked anomalies enabling tampering or data loss
Run this check with Prowler
Run in Prowler CloudRun
prowler aws --checks cloudwatch_alarm_actions_alarm_state_configuredRecommendation
Assign at least one ALARM-state action per alarm (e.g., notify via SNS or run automated remediation with Lambda/SSM). Keep actions enabled, apply least privilege to targets, and regularly test. For critical metrics, add redundant paths (EventBridge) for defense in depth.
Remediation
CLI
aws cloudwatch put-metric-alarm --alarm-name <alarm-name> --metric-name <metric-name> --namespace <namespace> --statistic <statistic> --period <period-seconds> --evaluation-periods <evaluation-periods> --threshold <threshold> --comparison-operator <comparison-operator> --alarm-actions <action-arn>Terraform
# Terraform: add an ALARM action to a metric alarm
resource "aws_cloudwatch_metric_alarm" "<example_resource_name>" {
alarm_name = "<example_resource_name>"
metric_name = "<metric-name>"
namespace = "<namespace>"
statistic = "Average"
period = 60
evaluation_periods = 1
threshold = 1
comparison_operator = "GreaterThanThreshold"
alarm_actions = ["<action-arn>"] # CRITICAL: ensures an action is configured for ALARM state
}NativeIaC
# CloudFormation: add an ALARM action to a metric alarm
Resources:
<example_resource_name>:
Type: AWS::CloudWatch::Alarm
Properties:
AlarmName: <example_resource_name>
MetricName: <metric-name>
Namespace: <namespace>
Statistic: Average
Period: 60
EvaluationPeriods: 1
Threshold: 1
ComparisonOperator: GreaterThanThreshold
AlarmActions:
- <action-arn> # CRITICAL: adds an action for ALARM state so the check passesOther
1Open the AWS Console and go to CloudWatch > Alarms
2Select the target alarm and choose Edit (or Modify alarm)
3In Actions, under When alarm state is ALARM, add an action (e.g., select an SNS topic or other supported action)
4Click Save changes
Check Code
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.cloudwatch.cloudwatch_client import (
cloudwatch_client,
)
class cloudwatch_alarm_actions_alarm_state_configured(Check):
def execute(self):
findings = []
if cloudwatch_client.metric_alarms is not None:
for metric_alarm in cloudwatch_client.metric_alarms:
report = Check_Report_AWS(
metadata=self.metadata(), resource=metric_alarm
)
report.status = "PASS"
report.status_extended = f"CloudWatch metric alarm {metric_alarm.name} has actions configured for the ALARM state."
if not metric_alarm.alarm_actions:
report.status = "FAIL"
report.status_extended = f"CloudWatch metric alarm {metric_alarm.name} does not have actions configured for the ALARM state."
findings.append(report)
return findingsReferences
- https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarms-and-actions
- https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/cloudwatch/client/put_metric_alarm.html
- https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm
- https://docs.aws.amazon.com/securityhub/latest/userguide/cloudwatch-controls.html#cloudwatch-15
- https://support.icompaas.com/support/solutions/articles/62000233431-ensure-cloudwatch-alarms-have-specified-actions-configured-for-the-alarm-state
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/aws/CloudWatch/cloudwatch-alarm-action.html
- https://awscli.amazonaws.com/v2/documentation/api/2.0.34/reference/cloudwatch/put-metric-alarm.html