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

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

Related Detections