nuclei-templates/cloud/azure/virtualmachines/azure-vm-unmanaged-disk-vol...

54 lines
1.9 KiB
YAML

id: azure-vm-unmanaged-disk-volumes
info:
name: Azure VM Unmanaged Disk Volumes Detected
author: princechaddha
severity: medium
description: |
Ensure that your Microsoft Azure virtual machines (VMs) are configured to use managed disk volumes for reliable, efficient, and simplified disk management. A managed disk is an abstraction of current Standard/Premium storage disk in Azure Storage. Managed disks provide granular access control with RBAC and better reliability for the virtual machines deployed within an Azure Availability Set.
impact: |
Using unmanaged disk volumes can lead to less efficient management and potential reliability issues in disk access within Azure VMs.
remediation: |
Configure your Azure VMs to use managed disks for better reliability and simplified management of disk resources.
reference:
- https://docs.microsoft.com/en-us/azure/virtual-machines/managed-disks-overview
tags: cloud,devops,azure,microsoft,virtual-machine,azure-cloud-config
flow: |
code(1);
for (let VMData of iterate(template.vmList)) {
set("ids", VMData);
code(2);
}
self-contained: true
code:
- engine:
- sh
- bash
source: |
az vm list --query '[*].{"id":id}'
extractors:
- type: json
name: vmList
internal: true
json:
- '.[]'
- engine:
- sh
- bash
source: |
az vm show --ids "$ids" --query 'storageProfile.{"osDiskType":osDisk.managedDisk.id,"dataDiskType":dataDisks[*].managedDisk.id}'
matchers:
- type: word
words:
- 'null'
- '[]'
extractors:
- type: dsl
dsl:
- 'ids + " is not using managed OS/data disk volume(s)"'
# digest: 490a0046304402206b098caf52729a99df153fff051093b1287352b8d06726d725f93bf278f875b102207eef2c944b927741822ed28eb618f35c602cd824b1158b326aff3d000fc65fba:922c64590222798bb761d5b6d8e72950