nuclei-templates/cloud/aws/cloudwatch/cw-alarms-actions.yaml

56 lines
1.7 KiB
YAML

id: cw-alarms-actions
info:
name: CloudWatch Alarms Actions Enabled
author: princechaddha
severity: high
description: |
Ensure that all Amazon CloudWatch alarms have actions enabled (ActionEnabled: true) to respond to state changes.
impact: |
Without actions enabled, CloudWatch alarms cannot perform automated actions in response to state changes, potentially missing critical alerts.
remediation: |
Enable actions for each CloudWatch alarm by setting the ActionEnabled parameter to true, allowing for automated responses to alarms.
reference:
- https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html
tags: cloud,devops,aws,amazon,cloudwatch,aws-cloud-config
variables:
region: "us-east-1"
flow: |
code(1)
for(let AlarmName of iterate(template.alarms)){
set("alarm", AlarmName)
code(2)
}
self-contained: true
code:
- engine:
- sh
- bash
source: |
aws cloudwatch describe-alarms --region $region --query 'MetricAlarms[].AlarmName' --output json
extractors:
- type: json
name: alarms
internal: true
json:
- '.[]'
- engine:
- sh
- bash
source: |
aws cloudwatch describe-alarms --region $region --alarm-names "DiskWritesOpsAlarm" --query 'MetricAlarms[*].ActionsEnabled'
matchers:
- type: word
words:
- "false"
extractors:
- type: dsl
dsl:
- '"The Amazon CloudWatch " + alarm + " does not have any active actions configured"'
# digest: 4b0a00483046022100c25b4a5bed3d8e28421708a03ab05c2b09f619f6c38472a34377d2db18e4d730022100d057819cf7fbf55503e3a93b82daa4b438fb204056422e34bbcb5a6ddb4d425e:922c64590222798bb761d5b6d8e72950