nuclei-templates/cloud/azure/activitylog/azure-storage-account-delet...

60 lines
2.3 KiB
YAML
Raw Normal View History

2024-07-25 13:03:55 +00:00
id: azure-storage-account-delete-unalerted
info:
name: Azure Storage Account Delete Alert Not Configured
author: princechaddha
severity: high
description: |
Ensure that a Microsoft Azure activity log alert is fired whenever a "Delete Storage Account" event is triggered within your cloud account. An Azure activity log alert fires each time the event that matches the condition specified in the alert configuration is triggered. The alert condition that this conformity rule checks for is "Whenever the Administrative Activity Log 'Delete Storage Account (Microsoft.Storage/storageAccounts)' has 'any' Event level, with 'any' status and event is initiated by 'any'".
impact: |
Failure to have alert rules for the deletion of storage accounts can allow malicious or accidental deletions to go unnoticed, potentially leading to data loss and security breaches.
remediation: |
Ensure alert rules are configured to fire on "Delete Storage Account" events by setting the alert condition to "Microsoft.Storage/storageAccounts/delete" and ensuring that an action group is attached to manage notifications.
reference:
- https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-activity-log
tags: cloud,devops,azure,microsoft,storage-account,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.Storage/storageAccounts/delete"
negative: true
extractors:
- type: dsl
dsl:
- 'id + " does not have the correct alert configuration for Delete Storage Account events"'
2024-09-12 05:22:06 +00:00
# digest: 4a0a00473045022100f94e0849123653aa0c21d5977c85714b666c8f14a63f09223ee517b00477094f0220769b9e9a2cd7330fe591c31957f6db0e2ed980678d27fa9fb5075bf144284a23:922c64590222798bb761d5b6d8e72950