nuclei-templates/cloud/azure/activitylog/azure-vm-poweroff-unalerted...

59 lines
2.4 KiB
YAML
Raw Normal View History

2024-07-25 13:03:55 +00:00
id: azure-vm-poweroff-unalerted
info:
name: Azure Virtual Machine Power Off Alert Not Configured
author: princechaddha
severity: high
description: |
Ensure that a Microsoft Azure activity log alert is fired whenever a "Power Off Virtual Machine" event is triggered within your cloud account. An Azure activity log alert fires each time the action event that matches the condition defined in the alert configuration is triggered. The alert condition that this conformity rule checks for is `Whenever the Administrative Activity Log "Power Off Virtual Machine (Microsoft.Compute/virtualMachines)" has "any" Event level, with "any" Status and Event initiated by "any"`
impact: |
Failure to monitor "Power Off Virtual Machine" events can result in missed critical alerts when virtual machines are powered off, potentially leading to operational disruptions and unauthorized actions going unnoticed.
remediation: |
Configure the activity log alert to trigger on the event "Microsoft.Compute/virtualMachines/powerOff/action". Ensure the alert condition includes any event level, status, and initiator to capture all related events.
reference:
- https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-activity-log
tags: cloud,devops,azure,microsoft,virtual-machines,azure-cloud-config
flow: |
code(1);
for (let AlertData of iterate(template.alertList)) {
set("id", AlertData);
code(2);
}
self-contained: true
code:
- engine:
- sh
- bash
source: |
az monitor activity-log alert list --output json --query '[?(enabled==`true`)].id'
extractors:
- type: json
name: alertList
internal: true
json:
- '.[]'
- engine:
- sh
- bash
source: |
az monitor activity-log alert show --ids "$id" --query 'condition'
matchers-condition: and
matchers:
- type: word
words:
- '"field": "operationName"'
- type: word
words:
- "Microsoft.Compute/virtualMachines/powerOff/action"
negative: true
extractors:
- type: dsl
dsl:
- 'id + " does not have the correct alert configuration for Power Off Virtual Machine events"'
2024-09-12 05:59:14 +00:00
# digest: 4a0a00473045022100bed21b58228571321094f88b408aa33214c408e85c3b8d0a3788987b9214080502205091d8830d3ea7bcfac6353c63f1e300875d1156cd99a346472b8f0245369eb3:922c64590222798bb761d5b6d8e72950