59 lines
2.2 KiB
YAML
59 lines
2.2 KiB
YAML
id: azure-key-vault-delete-unalerted
|
|
info:
|
|
name: Azure Key Vault Delete Alert Not Configured
|
|
author: princechaddha
|
|
severity: high
|
|
description: |
|
|
Ensure that a Microsoft Azure activity log alert is fired whenever a "Delete Key Vault" event is triggered inside your Azure cloud account. An activity log alert fires each time the action event that matches the condition specified in the alert configuration is triggered. The alert condition that this conformity rule checks for is "Whenever the Activity Log has an event with Category='Administrative', Signal name='Delete Key Vault (vaults)'".
|
|
impact: |
|
|
Without monitoring for "Delete Key Vault" events, unauthorized or unwanted deletions of key vaults might go unnoticed, leading to potential security and compliance risks.
|
|
remediation: |
|
|
Configure alert rules to monitor and notify whenever "Delete Key Vault" events occur by setting the alert condition to "Microsoft.KeyVault/vaults/delete" and attaching an action group to manage notifications.
|
|
reference:
|
|
- https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-activity-log
|
|
tags: cloud,devops,azure,microsoft,key-vault,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.KeyVault/vaults/delete"
|
|
negative: true
|
|
|
|
extractors:
|
|
- type: dsl
|
|
dsl:
|
|
- 'id + " does not have the correct alert configuration for Delete Key Vault events"'
|
|
# digest: 490a0046304402203f388c79d1aaee1de984ca49c16839fddd9c78f108adc2f2593a4190ed66cf3a0220456063ee7dc4119f33516e333b986bf9e2b2025836f4c5c2d9eb0baecc6e7607:922c64590222798bb761d5b6d8e72950 |