T1087.004
Cloud Account
Adversaries may attempt to get a listing of cloud accounts. Cloud accounts are those created and configured by an organization for use by users, remote support, services, or for administration of resources within a cloud service provider or SaaS application. With authenticated access, tools such as Get-MsolRoleMember, az ad user list, aws iam list-users, aws iam list-roles, and gcloud iam service-accounts list can enumerate cloud accounts across Azure AD, AWS IAM, and GCP. Tools like ROADTools, AADInternals, AzureHound, and Pacu have been used by threat actors including APT29 and Storm-0501 to conduct this activity.
Microsoft Sentinel / Defender
kusto
let CloudEnumPatterns = dynamic([
"Get-MsolRoleMember", "Get-MsolUser", "Get-AzureADUser", "Get-AzADUser",
"az ad user list", "az ad sp list", "az role assignment list", "az account list",
"aws iam list-users", "aws iam list-roles", "aws iam list-groups", "aws iam get-account-authorization-details",
"gcloud iam service-accounts list", "gcloud projects get-iam-policy", "gcloud organizations get-iam-policy",
"Get-MsolGroupMember", "Get-MsolServicePrincipal",
"Invoke-AzureHound", "roadrecon", "roadtools",
"AADInternals", "Get-AADIntUsers", "Get-AADIntTenantDetails",
"Invoke-Pacu", "pacu"
]);
let SuspiciousChildProcesses = dynamic(["powershell.exe", "pwsh.exe", "cmd.exe", "python.exe", "python3"]);
// Detection 1: Process-based cloud enumeration commands
DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ (SuspiciousChildProcesses)
| where ProcessCommandLine has_any (CloudEnumPatterns)
| extend CloudPlatform = case(
ProcessCommandLine has_any ("Get-Msol", "Get-AzureAD", "Get-Az", "az ad", "az account", "AADInternals", "AzureHound", "roadrecon"), "Azure/M365",
ProcessCommandLine has_any ("aws iam"), "AWS",
ProcessCommandLine has_any ("gcloud iam", "gcloud projects", "gcloud organizations"), "GCP",
"Unknown"
)
| extend ToolCategory = case(
ProcessCommandLine has_any ("Invoke-AzureHound", "roadrecon", "roadtools", "AADInternals", "Get-AADInt", "Invoke-Pacu", "pacu"), "KnownOffensiveTool",
ProcessCommandLine has_any ("Get-MsolRoleMember", "Get-MsolUser", "az ad user list", "aws iam list-users", "gcloud iam service-accounts list"), "BuiltInEnumeration",
"Other"
)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine,
CloudPlatform, ToolCategory
| sort by Timestamp desc medium severity
high confidence
Data Sources
Process: Process Creation Command: Command Execution Microsoft Defender for Endpoint
Required Tables
DeviceProcessEvents
False Positives
- IT administrators running legitimate user audits or access reviews using AZ CLI, AWS CLI, or PowerShell modules
- Security teams running authorized Identity Governance assessments or access certifications
- Automated scripts for user provisioning/deprovisioning that enumerate existing accounts before making changes
- Cloud cost optimization or compliance tooling that enumerates IAM resources for reporting
- DevOps pipeline scripts that validate service account existence before deployment
Last updated: 2026-04-13 Research depth: deep
References (14)
- https://attack.mitre.org/techniques/T1087/004/
- https://docs.microsoft.com/en-us/powershell/module/msonline/get-msolrolemember?view=azureadps-1.0
- https://docs.microsoft.com/en-us/cli/azure/ad/user?view=azure-cli-latest
- https://docs.aws.amazon.com/cli/latest/reference/iam/list-users.html
- https://docs.aws.amazon.com/cli/latest/reference/iam/list-roles.html
- https://cloud.google.com/sdk/gcloud/reference/iam/service-accounts/list
- https://github.com/True-Demon/raindance
- https://dirkjanm.io/introducing-roadtools-framework/
- https://o365blog.com/aadinternals/
- https://github.com/BloodHoundAD/AzureHound
- https://github.com/RhinoSecurityLabs/pacu
- https://www.blackhillsinfosec.com/red-teaming-microsoft-part-1-active-directory-leaks-via-azure/
- https://www.microsoft.com/en-us/security/blog/2021/10/25/nobelium-targeting-delegated-administrative-privileges-to-facilitate-broader-attacks/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1087.004/T1087.004.md
Unlock Pro Content
Get the full detection package for T1087.004 including response playbook, investigation guide, and atomic red team tests.
Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance