57 lines
1.7 KiB
YAML
57 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
|
|
metadata:
|
|
max-request: 2
|
|
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: 490a0046304402204f22697b5c7a4b568fa37b48600e0f99f469922bdd208491966d4eef4fd6355d02204f33504b85a9de2df430dde270e0f481760be59ca0340bb93c245143558b0444:922c64590222798bb761d5b6d8e72950 |