How it works
Azure authorization is spread over three layers that an attacker reads one after another. Microsoft Entra ID holds the identities: users, groups, service principals and managed identities. Azure Resource Manager (ARM) holds the resource hierarchy and decides management operations with Azure role-based access control. Each service then decides access to its own data. Reconnaissance is the work of joining the three into a graph that answers one question: which identity I control, or can take over, reaches which resource.
The hierarchy runs from management group to subscription to resource group to resource. A role assignment binds a principal to a role definition at one of those scopes and is inherited by everything below it. An assignment at a management group reaches every subscription under it; two sibling resource groups share nothing.
A role definition has four lists. actions and notActions describe management operations. dataActions and notDataActions describe data operations. notActions only subtracts from the same definition: a second role assigned to the same principal can grant what the first one excludes. An assignment can also carry a condition that limits it to some requests, and a group assignment is only as good as the group's membership at that moment.
The parts of the graph an attacker looks for:
- Assignments at high scopes. Owner, Contributor, User Access Administrator and Role Based Access Control Administrator at a subscription or management group.
- Identities attached to workloads. A virtual machine, function app or automation account with a managed identity turns "run code on this resource" into "act as this identity". See managed identity abuse.
- Application identities. An app registration and its enterprise application share an application ID, but ARM assignments point at the service principal's object ID. Joining on the wrong one hides real assignments.
- Resources that hold secrets. Key vaults, storage accounts, automation accounts and app settings. See Key Vault secret access abuse.
- Roles that include
Microsoft.Authorization/roleAssignments/write, which let the holder grant themselves more. See Azure RBAC role assignment abuse.
Tools such as AzureHound collect these objects and BloodHound draws the result as attack paths. The directory side of the same exercise is on the Entra ID reconnaissance page.
Prerequisites
- A credential for the tenant: a user, a service principal secret or certificate, a managed identity token from a compromised workload, or a stolen refresh token.
- A role on at least one scope. Reader is enough for everything on this page. With no role at all, the identity can still sign in but sees no subscriptions.
- Network access to
management.azure.comandlogin.microsoftonline.com. Nothing on this page needs access to the target's own network.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
The steps below are for an authorized assessment or a lab.
1. Establish the context
# Sign in. Add --allow-no-subscriptions for an identity that has directory access only
az login
# Which tenant and subscription the session points at
az account show
# Every subscription the identity can see
az account list --all --output table
# Management groups in the tenant
az account management-group list --output table
The tenantId and id fields of az account show identify the directory and the subscription. Run the remaining steps once per subscription, after az account set --subscription <id>.
2. List the resources
# Everything in the current subscription
az resource list --output table
# Only the resource types that usually hold secrets or identities
az resource list --resource-type Microsoft.KeyVault/vaults --output table
az resource list --resource-type Microsoft.Storage/storageAccounts --output table
az resource list --resource-type Microsoft.Automation/automationAccounts --output table
az resource list --resource-type Microsoft.ManagedIdentity/userAssignedIdentities --output table
The raw ARM API returns the same data and works with any token for management.azure.com:
az rest --method get \
--url "https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?api-version=2019-07-01"
3. List who has which role
# Every assignment in the subscription, including resource groups and resources
az role assignment list --all --output table
# What one principal holds, with inherited assignments and group assignments
az role assignment list --all --assignee alice@corp.example.com \
--include-inherited --include-groups --output table
# Assignments that apply to one resource, including those from parent scopes
az role assignment list --include-inherited \
--scope "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-prod/providers/Microsoft.KeyVault/vaults/kv-prod"
Without --all the command shows only assignments made at the subscription itself. Without --include-inherited it misses assignments made at a management group.
4. Read what each role allows
# The permission blocks of a built-in role
az role definition list --name "Contributor"
# Custom roles, where broad wildcards and roleAssignments/write tend to hide
az role definition list --custom-role-only true
Read actions and dataActions separately, then subtract notActions and notDataActions. A custom role's assignableScopes shows where it can be assigned, not where it is assigned.
5. Collect everything for graph analysis
AzureHound collects directory and ARM objects in one run and writes a file that BloodHound imports:
# With a user name and password
./azurehound -u "alice@corp.example.com" -p "<password>" list --tenant "corp.example.com" -o output.json
# With a refresh token, for example one obtained through a device code sign-in
./azurehound -r "<refresh token>" list --tenant "corp.example.com" -o output.json
# With an access token (JWT), limited to one object type
./azurehound -j "<access token>" list users --tenant "corp.example.com"
6. Build the paths
For each interesting resource, write the chain from the evidence: workload has identity, identity has role at scope, resource is under that scope, role includes the action. Keep management and data permissions apart. Reader at a subscription proves an identity can see that a storage account exists; it grants nothing for listing blobs, which needs a data role such as Storage Blob Data Reader or the account keys.
Impact
Reconnaissance changes nothing and takes nothing, so the direct impact is information. The value is what it enables: the attacker learns which single compromise (a virtual machine with a privileged managed identity, a service principal that owns a subscription, a group with Owner on a management group) gives the most, and goes there directly instead of making noise. It also shows which data stores are reachable with rights already held, which is where overprivileged access turns into data theft.
OPSEC and artifacts
- Read operations are not in the Activity Log. Listing resources, role assignments and role definitions is a series of GET requests to ARM, and the Azure Activity Log records writes, deletes and actions. A careful operator stays on reads for as long as possible.
- The sign-in is recorded. Getting a token for Azure Resource Manager writes a sign-in record with the client application, IP address and user agent. Azure CLI, Azure PowerShell and custom scripts identify themselves by application ID. Operators use a client and a network location the account already uses. A service principal or managed identity that suddenly requests ARM tokens from a new address stands out more than a user does.
- Collection tools are bursty. AzureHound requests every object type across every subscription in minutes. Operators scope the run (
list users, one subscription at a time) to look like an administrator's inventory job. The pattern that remains is one identity touching many subscriptions it never touched before. - The first non-read call is logged. Listing storage account keys, reading Key Vault secrets and retrieving publishing credentials are actions or data-plane operations. They appear in the Activity Log or the resource's diagnostic log, and they are usually the first hard evidence that enumeration happened.
- Graph collection may be logged separately. The directory half of an AzureHound run goes to Microsoft Graph, and tenants that export Microsoft Graph activity logs see those requests.
Detection
No log shows the enumeration itself in a default configuration, so detection works on the sign-in before it and the action after it.
- Sign-ins to Azure Resource Manager from a client, address or identity that doesn't normally manage Azure. In
SigninLogs,AADServicePrincipalSignInLogsandAADManagedIdentitySignInLogs, filter on the Azure Resource Manager resource and baseline by identity. - The first follow-on action. The detection rules for storage account keys listed, service keys and connection strings listed and Key Vault secrets read in bulk catch what an attacker does with the map. The listKeys source page describes the record.
- Role changes that follow. Privileged Azure role assignment and Global Administrator elevate access cover the escalation step. The record is Microsoft.Authorization/roleAssignments/write.
A query that puts role assignment writes on a timeline next to a suspicious sign-in:
AzureActivity
| where OperationNameValue =~ "Microsoft.Authorization/roleAssignments/write"
| project TimeGenerated, OperationNameValue, ActivityStatusValue, Caller, CallerIpAddress, CorrelationId
| order by TimeGenerated asc
An empty result does not clear an identity: the Activity Log has nothing to say about reads. The platform keeps Activity Log events for 90 days; route them to a workspace if you need longer.
Mitigation
Reading configuration can't be switched off, so the aim is to make the map less useful and the identities that can draw it fewer.
- Remove broad Reader assignments. Reader at a management group or the tenant root group gives a full inventory to whoever holds it. Assign at the resource group and prefer groups with reviewed membership.
- Narrow high-scope privileged roles. Fewer Owner, Contributor and User Access Administrator assignments at subscription scope and above means fewer paths to find. Make the remaining ones eligible through Privileged Identity Management rather than permanent.
- Separate management roles from data roles. Use data-plane roles for data access and disable shared keys on storage accounts where possible, so that Contributor is not also a data role through
listKeys. - Review custom roles for wildcards and for
Microsoft.Authorization/*. Follow least privilege when writing them. - Remove unused managed identity attachments and unused service principal role assignments. An identity nobody uses is still a node on the map.
- Require compliant devices and MFA for Azure management with a Conditional Access policy that targets the Windows Azure Service Management API, so a stolen password alone can't enumerate.
- Run the same analysis first. Collect your own tenant with the tools above and remove the paths before someone else finds them. The combined attack path analysis guide shows the method.
- Keep the logs that do exist: route sign-in logs for users, service principals and managed identities, the Activity Log and Key Vault and storage diagnostic logs to a central workspace.
Detection rules for this attack
Log events to collect
FAQ
What permissions does Azure reconnaissance need?
Very little. Reader on a subscription lets an identity list every resource in it, every role assignment and every role definition. An identity with a role on a single resource group sees that group. Reading secrets, keys and blob contents needs data-plane permissions, but finding out where they are and who can reach them does not.
Does the Azure Activity Log record enumeration?
No. The Activity Log records control-plane writes, deletes and actions. A GET that lists resources or role assignments leaves no entry there. Enumeration becomes visible only in sign-in logs (who obtained a token for Azure Resource Manager, from where, with which client) and in the first action that follows, such as listing storage keys.
What is the difference between Actions and DataActions in an Azure role?
Actions are management operations on the resource through Azure Resource Manager, such as reading a storage account's configuration. DataActions are operations on the data inside it, such as reading a blob. A role can grant one without the other, which is why Reader on a subscription shows that a storage account exists but can't list its blobs.
References
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.