Detect Cloud Account in Sumo Logic CSE
Adversaries may create cloud accounts to maintain access to victim systems. Cloud accounts include user accounts, service principals, managed identities (Azure), IAM users and roles (AWS), and service accounts (GCP). With sufficient access, adversaries create secondary credentialed accounts that do not require persistent remote access tools. Known actors include APT29 (creating Azure AD users), LAPSUS$ (creating global admin accounts in victim cloud tenants), and the AADInternals toolkit. Cloud accounts can be scoped to specific services to reduce detection surface and are often followed by credential additions or role escalation for persistence.
MITRE ATT&CK
- Tactic
- Persistence
- Technique
- T1136 Create Account
- Sub-technique
- T1136.003 Cloud Account
- Canonical reference
- https://attack.mitre.org/techniques/T1136/003/
Sumo Detection Query
(_sourceCategory="azure/audit" OR _sourceCategory="aws/cloudtrail" OR _sourceCategory="o365/audit")
| json auto
| where (
(operationName in ("Add user", "Add service principal", "Add application", "Add service principal credentials") and result = "success")
OR (eventName in ("CreateUser", "CreateRole", "CreateServiceLinkedRole", "CreateVirtualMFADevice") and !(errorCode matches "*"))
OR (Operation in ("Add user.", "New-MsolUser", "New-AzureADUser"))
)
| if (_sourceCategory matches "azure*", "AzureAD",
if (_sourceCategory matches "aws*", "AWS",
if (_sourceCategory matches "o365*", "O365", "Unknown"))) as cloud_platform
| if (operationName matches "*service principal*" or operationName matches "*application*" or eventName matches "*Role*", 1, 0) as is_service_account
| if (cloud_platform = "AzureAD",
coalesce(%"initiatedBy.user.userPrincipalName", %"initiatedBy.app.displayName"),
if (cloud_platform = "AWS",
coalesce(%"userIdentity.userName", %"userIdentity.arn"),
UserId)) as actor
| if (cloud_platform = "AzureAD",
coalesce(%"targetResources[0].userPrincipalName", %"targetResources[0].displayName"),
if (cloud_platform = "AWS",
coalesce(%"requestParameters.userName", %"requestParameters.roleName"),
ObjectId)) as target_account
| if (cloud_platform = "AzureAD", %"initiatedBy.user.ipAddress",
if (cloud_platform = "AWS", sourceIPAddress, ClientIP)) as source_ip
| eval suspicion_score = 0
| eval suspicion_score = suspicion_score + if (is_service_account = 1, 1, 0)
| eval suspicion_score = suspicion_score + if (isNull(source_ip) or source_ip = "", 1, 0)
| eval suspicion_score = suspicion_score + if (actor matches "unknown" or isNull(actor), 2, 0)
| eval suspicion_score = suspicion_score + if (target_account matches "*admin*" or target_account matches "*svc_*" or target_account matches "*service*" or target_account matches "*test*" or target_account matches "*tmp*", 1, 0)
| fields _messagetime, cloud_platform, operationName, eventName, Operation, actor, target_account, source_ip, is_service_account, suspicion_score
| sort by _messagetime desc Detects cloud account creation events (user accounts, service principals, IAM users/roles) across Azure AD, AWS CloudTrail, and Office 365 audit logs. Computes a suspicion score based on account type, initiating actor, and naming patterns consistent with adversary tradecraft.
Data Sources
Required Tables
False Positives & Tuning
- Service account creation by DevOps teams deploying new microservices that require dedicated cloud identities for least-privilege access
- Automated cloud governance tools periodically creating sandbox or ephemeral IAM roles for developer environments on a scheduled basis
- Identity federation sync jobs (Azure AD Connect, AWS SSO sync) that replicate on-premises accounts to cloud directories and appear as new account creation events
Other platforms for T1136.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 1Create Azure AD User via Azure CLI
Expected signal: Azure AD AuditLogs: OperationName='Add user', Result='success', InitiatedBy.user.userPrincipalName=<your admin UPN>, TargetResources[0].displayName='df00tech-test-user'. The event appears within 1-2 minutes of execution.
- Test 2Create Azure Service Principal via PowerShell (AADInternals Pattern)
Expected signal: Azure AD AuditLogs: two sequential events — OperationName='Add application' followed within seconds by OperationName='Add service principal', then OperationName='Add service principal credentials'. All three events share the same CorrelationId or occur within the same 1-minute window from the same InitiatedBy UPN.
- Test 3Create AWS IAM User with Access Keys
Expected signal: AWS CloudTrail: CreateUser event with requestParameters.userName='df00tech-atomic-test-user' and responseElements.user.arn containing the new user ARN. Followed within seconds by CreateAccessKey event with the same userName. Both events share the sourceIPAddress of the calling machine and the userIdentity.arn of the executing role.
- Test 4Create Azure AD User via AADInternals PowerShell Module
Expected signal: Azure AD AuditLogs: OperationName='Add user', Result='success'. The InitiatedBy field will show the authenticated user's UPN (not an application identity, since AADInternals authenticates as the user). Sysmon Event ID 1 on the Windows host: Process Create for powershell.exe with CommandLine containing 'AADInternals' and 'New-AADIntUser'. PowerShell ScriptBlock Log Event ID 4104 captures the full command including credentials (monitor for this in SIEM).
References (10)
- https://attack.mitre.org/techniques/T1136/003/
- https://docs.microsoft.com/en-us/office365/admin/add-users/about-admin-roles?view=o365-worldwide
- https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html
- https://support.google.com/cloudidentity/answer/7332836?hl=en&ref_topic=7558554
- https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/add-users-azure-active-directory
- https://learn.microsoft.com/en-us/entra/identity-platform/app-objects-and-service-principals?tabs=browser
- https://www.microsoft.com/en-us/security/blog/2021/10/25/nobelium-targeting-delegated-administrative-privileges-to-facilitate-broader-attacks/
- https://www.microsoft.com/en-us/security/blog/2022/03/22/dev-0537-criminal-actor-targeting-organizations-for-data-exfiltration-and-destruction/
- https://aadinternals.com/aadinternals/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1136.003/T1136.003.md
Unlock Pro Content
Get the full detection package for T1136.003 including response playbook, investigation guide, and atomic red team tests.