Skip to content

Conversation

@cx-andre-pereira
Copy link
Contributor

@cx-andre-pereira cx-andre-pereira commented Nov 17, 2025

Reason for Proposed Changes

  • Currently there is no query to ensure that resources of type "azurerm_virtual_machine", "azurerm_linux_virtual_machine" and "azurerm_windows_virtual_machine" are utilizing Managed Disks.

  • Quoting CIS_Microsoft_Azure_Compute_Services_Benchmark_v2.0.0 page 307: "Managed disks are by default encrypted on the underlying hardware, so no additional encryption is required for basic protection. It is available if additional encryption is required. Managed disks are by design more resilient that storage accounts. For ARM-deployed Virtual Machines, Azure Adviser will at some point recommend moving VHDs to managed disks both from a security and cost management perspective.".

Proposed Changes

  • Implemented the missing query.

  • The query will flag legacy "azurerm_virtual_machine" resources if :

  • For "azurerm_linux_virtual_machine" and "azurerm_windows_virtual_machine" resources it is simply checked that "os_managed_disk_id" field is undefined.

  • Note - 2 queries that are also related to vm resources exist but both miss resources. The query "VM Not Attached To Network" only checks for "azurerm_virtual_machine" resources while the second query "Azure Instance Using Basic Authentication" checks for "azurerm_virtual_machine" and "azurerm_linux_virtual_machine" but does not check for "azurerm_windows_virtual_machine".

I submit this contribution under the Apache-2.0 license.

@github-actions github-actions bot added feature New feature query New query feature labels Nov 17, 2025
@github-actions
Copy link
Contributor

kics-logo

KICS version: v2.1.13

Category Results
CRITICAL CRITICAL 0
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 1
Files parsed placeholder 1
Files failed to scan placeholder 0
Total executed queries placeholder 47
Queries failed to execute placeholder 0
Execution time placeholder 0

@cx-andre-pereira cx-andre-pereira marked this pull request as ready for review November 17, 2025 13:50
@cx-andre-pereira cx-andre-pereira requested a review from a team as a code owner November 17, 2025 13:50
@cx-andre-pereira cx-andre-pereira changed the title feat(query): implements "Beta - Virtual Machine Without Managed Disk" feat(query): implements "Beta - VM Without Managed Disk" Nov 17, 2025
@github-actions github-actions bot added arm Azure Resource Manager query terraform Terraform query azure PR related with Azure Cloud labels Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arm Azure Resource Manager query azure PR related with Azure Cloud feature New feature query New query feature terraform Terraform query

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant