59 lines
2.2 KiB
YAML
59 lines
2.2 KiB
YAML
id: azure-keyvault-update-unalerted
|
|
info:
|
|
name: Azure Key Vault Update Alert Not Configured
|
|
author: princechaddha
|
|
severity: high
|
|
description: |
|
|
Ensure that an Azure activity log alert is fired whenever "Update Key Vault" events are triggered within your Microsoft Azure cloud account. Activity log alerts get triggered when a new activity log event that matches the condition specified in the alert configuration occurs. For this conformity rule, the matched condition is "Whenever the Activity Log has an event with Category='Administrative', Signal name='Update Key Vault (vaults)'".
|
|
impact: |
|
|
Not configuring alerts for "Update Key Vault" events can allow unauthorized or unwanted changes to Key Vault resources to go unnoticed, thereby increasing security risks.
|
|
remediation: |
|
|
Configure alert rules to monitor and notify of "Update Key Vault" events by setting the alert condition to "Microsoft.KeyVault/vaults/write" and ensuring that an action group is attached for managing notifications.
|
|
reference:
|
|
- https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-activity-log
|
|
tags: cloud,devops,azure,microsoft,keyvault,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/write"
|
|
negative: true
|
|
|
|
extractors:
|
|
- type: dsl
|
|
dsl:
|
|
- 'id + " does not have the correct alert configuration for Update Key Vault events"'
|
|
# digest: 4a0a0047304502206d0df84e3e36655135df1e4ec88094c98e5cf19dce01c4d1bf1f150c85c5e67d022100b86894230387b11c04ac0062a3557a8d467e21f0cdb23637ba30df9245f9e4ce:922c64590222798bb761d5b6d8e72950 |