azureblog.co.uk
← cd ~/roles
// roles/azure · storage

Defender for Storage Data ScannerAzure built-in role

Grants access to read blobs and update index tags. This role is used by the data scanner of Defender for Storage.

Role ID1e7ca9b1-60d1-4db8-a914-f2ca1ff27c40
CategoryStorage
Actions3
Data actions6

Before you assign it

  • It reaches the data, not just the resource. It has 6 data actions, such as reading blobs, secrets or messages.

What it can do

PermissionWhat it allows
Microsoft.Storage/storageAccounts/blobServices/containers/readReturns a container
Microsoft.Storage/storageAccounts/blobServices/readList blob services
Microsoft.Storage/storageAccounts/fileServices/shares/readGet file share

Data actions

PermissionWhat it allows
Microsoft.Storage/storageAccounts/blobServices/containers/blobs/readReturns a blob or a list of blobs
Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/writeReturns the result of writing blob tags
Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/readReturns the result of reading blob tags
Microsoft.Storage/storageAccounts/blobServices/containers/blobs/deleteReturns the result of deleting a blob
Microsoft.Storage/storageAccounts/fileServices/fileshares/files/readReturns a file/folder or a list of files/folders
Microsoft.Storage/storageAccounts/fileServices/readFileBackupSemantics/actionRead File Backup Semantics Privilege

Assign it

Scope it as tightly as you can: a resource or resource group rather than the whole subscription.

azure cli
az role assignment create \
  --assignee "jane.doe@contoso.com" \
  --role "Defender for Storage Data Scanner" \
  --scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
powershell3 lines
New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
  -RoleDefinitionName "Defender for Storage Data Scanner" `
  -Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"
bicep7 lines
resource assignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
  name: guid(resourceGroup().id, principalId, '1e7ca9b1-60d1-4db8-a914-f2ca1ff27c40')
  properties: {
    roleDefinitionId: subscriptionResourceId('Microsoft.Authorization/roleDefinitions', '1e7ca9b1-60d1-4db8-a914-f2ca1ff27c40')
    principalId: principalId
  }
}

Who already has it?

kql · azure resource graph
authorizationresources
| where type == "microsoft.authorization/roleassignments"
| where tostring(properties.roleDefinitionId) endswith "1e7ca9b1-60d1-4db8-a914-f2ca1ff27c40"
| project principalId = tostring(properties.principalId), principalType = tostring(properties.principalType), scope = tostring(properties.scope)

Other storage roles

Find the smallest role for a task →