Detect Cloud Groups in Elastic Security
Adversaries may attempt to find cloud groups and permission settings to understand role assignments, privilege levels, and group memberships within a cloud environment. Tools such as Get-MsolRole (Office 365), az ad user get-member-groups (Azure CLI), ROADTools, AADInternals, and Pacu are used to enumerate cloud identity groups. In AWS, ListRolePolicies and ListAttachedRolePolicies enumerate role policies. Adversaries use this information to identify privileged accounts, determine lateral movement paths, and select targets for privilege escalation.
MITRE ATT&CK
- Tactic
- Discovery
- Technique
- T1069 Permission Groups Discovery
- Sub-technique
- T1069.003 Cloud Groups
- Canonical reference
- https://attack.mitre.org/techniques/T1069/003/
Elastic Detection Query
any where
(
event.dataset == "azure.auditlogs" and
event.outcome == "success" and
event.action in~ (
"List group members", "List groups", "Get group",
"List directory roles", "List directory role members",
"List role assignments", "Get role assignment"
)
)
or
(
event.category == "process" and
event.type == "start" and
process.name in~ ("powershell.exe", "pwsh.exe", "az.cmd", "az.exe") and
process.command_line like~ (
"*Get-MsolRole*", "*Get-MsolRoleMember*", "*Get-AzureADGroup*",
"*Get-AzureADGroupMember*", "*Get-AzureADDirectoryRole*",
"*Get-AzureADDirectoryRoleMember*", "*Get-MgGroup*", "*Get-MgGroupMember*",
"*Get-MgDirectoryRole*", "*Get-MgDirectoryRoleMember*",
"*az ad group*", "*az role assignment list*", "*az ad user get-member-groups*",
"*ListRolePolicies*", "*ListAttachedRolePolicies*", "*ListGroupPolicies*",
"*Get-AzRoleAssignment*", "*Get-AzADGroup*",
"*roadrecon*", "*roadtools*", "*aadinternals*", "*invoke-aadintrecon*",
"*azurehound*", "*stormspotter*", "*pacu*"
)
) Detects cloud identity group and role enumeration (T1069.003) via two paths: (1) successful Azure AD audit log operations for group and role read actions ingested through the Elastic Azure integration, and (2) endpoint process launch events where PowerShell or az CLI is executed with known cloud group enumeration cmdlets or offensive reconnaissance tools such as ROADrecon, AADInternals, AzureHound, and Pacu. The dual-path approach ensures coverage regardless of whether the attacker operates purely from the cloud control plane or from a compromised endpoint.
Data Sources
Required Tables
False Positives & Tuning
- IT administrators using Azure AD PowerShell (MSOnline, AzureAD, Microsoft.Graph modules) or az CLI for legitimate group management, access reviews, or identity reporting
- Automated compliance or IAM governance scripts that enumerate group memberships on a scheduled basis using service account credentials
- Azure AD Connect synchronization, CASB solutions, or cloud security posture management (CSPM) tools that continuously read group and role data for policy enforcement
Other platforms for T1069.003
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Enumerate Azure AD Groups via MSOnline PowerShell Module
Expected signal: Sysmon Event ID 1: PowerShell process creation with CommandLine containing 'Get-MsolRole' and 'Get-MsolRoleMember'. PowerShell ScriptBlock Log Event ID 4104 with full script content. Azure AD Audit Logs: 'List directory roles' and 'List directory role members' operations attributed to the authenticated user. Sysmon Event ID 3: Outbound network connections to login.microsoftonline.com and graph.windows.net.
- Test 2Enumerate Azure AD Groups via Azure CLI
Expected signal: Sysmon Event ID 1: az.cmd process creation with CommandLine containing 'ad group list', 'ad user get-member-groups', 'role assignment list'. Sysmon Event ID 3: Network connections to management.azure.com and graph.microsoft.com. Azure AD Audit Logs: 'List groups', 'List role assignments' operations. File creation events (Sysmon ID 11) for output files in TEMP directory.
- Test 3Enumerate AWS IAM Role Policies via AWS CLI
Expected signal: Sysmon Event ID 1: PowerShell and aws.exe process creation events with CommandLine containing 'list-roles', 'list-role-policies', 'list-attached-role-policies', 'list-groups'. Sysmon Event ID 3: Outbound connections to iam.amazonaws.com (port 443). File creation events for output files. AWS CloudTrail: ListRoles, ListRolePolicies, ListAttachedRolePolicies, ListGroups API calls attributed to the IAM principal.
- Test 4Enumerate Azure AD Groups using Microsoft Graph PowerShell SDK
Expected signal: Sysmon Event ID 1: PowerShell process with CommandLine containing 'Get-MgGroup', 'Get-MgDirectoryRole', 'Get-MgDirectoryRoleMember'. Sysmon Event ID 3: Outbound connections to graph.microsoft.com (port 443). PowerShell ScriptBlock Log Event ID 4104. Azure AD Audit Logs: 'List groups', 'List directory roles', 'List directory role members' operations. Sysmon Event ID 11: CSV file creation in TEMP directory.
References (13)
- https://attack.mitre.org/techniques/T1069/003/
- https://docs.microsoft.com/en-us/powershell/module/msonline/get-msolrole?view=azureadps-1.0
- https://docs.microsoft.com/en-us/cli/azure/ad/user?view=azure-cli-latest
- https://cloud.google.com/identity/docs/reference/rest
- https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAcl.html
- https://unit42.paloaltonetworks.com/compromised-cloud-compute-credentials/
- https://www.blackhillsinfosec.com/red-teaming-microsoft-part-1-active-directory-leaks-via-azure/
- https://github.com/dirkjanm/ROADtools
- https://o365blog.com/post/aadinternals/
- https://github.com/RhinoSecurityLabs/pacu
- https://github.com/BloodHoundAD/AzureHound
- https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/concept-audit-logs
- https://learn.microsoft.com/en-us/graph/api/group-list-members
Unlock Pro Content
Get the full detection package for T1069.003 including response playbook, investigation guide, and atomic red team tests.