← 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 ID | 1e7ca9b1-60d1-4db8-a914-f2ca1ff27c40 |
|---|---|
| Category | Storage |
| Actions | 3 |
| Data actions | 6 |
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
| Permission | What it allows |
|---|---|
Microsoft.Storage/storageAccounts/blobServices/containers/read | Returns a container |
Microsoft.Storage/storageAccounts/blobServices/read | List blob services |
Microsoft.Storage/storageAccounts/fileServices/shares/read | Get file share |
Data actions
| Permission | What it allows |
|---|---|
Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read | Returns a blob or a list of blobs |
Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/write | Returns the result of writing blob tags |
Microsoft.Storage/storageAccounts/blobServices/containers/blobs/tags/read | Returns the result of reading blob tags |
Microsoft.Storage/storageAccounts/blobServices/containers/blobs/delete | Returns the result of deleting a blob |
Microsoft.Storage/storageAccounts/fileServices/fileshares/files/read | Returns a file/folder or a list of files/folders |
Microsoft.Storage/storageAccounts/fileServices/readFileBackupSemantics/action | Read File Backup Semantics Privilege |
Assign it
Scope it as tightly as you can: a resource or resource group rather than the whole subscription.
az role assignment create \
--assignee "jane.doe@contoso.com" \
--role "Defender for Storage Data Scanner" \
--scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"New-AzRoleAssignment -SignInName "jane.doe@contoso.com" `
-RoleDefinitionName "Defender for Storage Data Scanner" `
-Scope "/subscriptions/<subscription id>/resourceGroups/<resource group>"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?
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
- Azure File Sync Reader · 1 permission
- Storage Blob Delegator · 1 permission
- Storage File Data SMB Share Reader · 1 permission
- Storage File Data SMB Take Ownership · 1 permission
- Storage File Delegator · 1 permission
- Storage Queue Data Message Sender · 1 permission
- Storage Queue Delegator · 1 permission
- Storage Table Delegator · 1 permission