From 759c3d9d38cf782aee87ad0bc698de7979e762a7 Mon Sep 17 00:00:00 2001 From: David du Colombier Date: Tue, 15 Sep 2026 12:44:27 +0200 Subject: [PATCH] azure: grant scanner read access to images and galleries The worker role granted galleries/images/versions/read alone, so the scanner could read a gallery version it already knew of but could not enumerate the galleries and image definitions above it, nor list classic managed images at all. Azure answers a list the caller cannot read with HTTP 200 and a filtered result set rather than 403, so a role missing these actions reports no images and logs nothing. Grant read on images, galleries and gallery image definitions. A managed image is read by copying the snapshot or disk it was captured from, and the disk write at the destination authorizes that copy on its own: an image whose snapshot answers 403 to this identity still scans to completion, so the three reads above are the whole addition. The ARM template carries the same list, so regenerate main.json with the Bicep version it pins. --- CHANGELOG.md | 4 ++++ azure/arm/main.bicep | 6 +++++- azure/arm/main.json | 5 ++++- azure/modules/roles/main.tf | 4 ++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b25429..5355af2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version TBD + +- azure: grant the scanner read access to images and image galleries + ## Version 0.13.0 - 2026-10-01 - aws: introduce the Agentless SaaS mode, where Datadog performs the scans from its own infrastructure by assuming the Datadog integration role: only IAM permissions are deployed in your account, no scanner infrastructure (see `examples/saas`) diff --git a/azure/arm/main.bicep b/azure/arm/main.bicep index 60b2d88..8434a8f 100644 --- a/azure/arm/main.bicep +++ b/azure/arm/main.bicep @@ -318,7 +318,11 @@ resource delegateRole 'Microsoft.Authorization/roleDefinitions@2022-04-01' = { 'Microsoft.Compute/disks/beginGetAccess/action' 'Microsoft.Compute/disks/endGetAccess/action' - 'Microsoft.Compute/galleries/images/versions/read' + 'Microsoft.Compute/images/read' + + 'Microsoft.Compute/galleries/read' + 'Microsoft.Compute/galleries/images/read' + 'Microsoft.Compute/galleries/images/versions/read' 'Microsoft.ContainerRegistry/registries/pull/read' diff --git a/azure/arm/main.json b/azure/arm/main.json index 7ebac66..79e2f4b 100644 --- a/azure/arm/main.json +++ b/azure/arm/main.json @@ -6,7 +6,7 @@ "_generator": { "name": "bicep", "version": "0.43.8.12551", - "templateHash": "12092533371131685033" + "templateHash": "7676876666099743877" } }, "functions": [ @@ -422,6 +422,9 @@ "Microsoft.Compute/disks/read", "Microsoft.Compute/disks/beginGetAccess/action", "Microsoft.Compute/disks/endGetAccess/action", + "Microsoft.Compute/images/read", + "Microsoft.Compute/galleries/read", + "Microsoft.Compute/galleries/images/read", "Microsoft.Compute/galleries/images/versions/read", "Microsoft.ContainerRegistry/registries/pull/read", "Microsoft.Web/sites/read", diff --git a/azure/modules/roles/main.tf b/azure/modules/roles/main.tf index 72c4f24..717e076 100644 --- a/azure/modules/roles/main.tf +++ b/azure/modules/roles/main.tf @@ -57,6 +57,10 @@ resource "azurerm_role_definition" "worker_role" { "Microsoft.Compute/disks/beginGetAccess/action", "Microsoft.Compute/disks/endGetAccess/action", + "Microsoft.Compute/images/read", + + "Microsoft.Compute/galleries/read", + "Microsoft.Compute/galleries/images/read", "Microsoft.Compute/galleries/images/versions/read", "Microsoft.ContainerRegistry/registries/pull/read",