T1136.003 Splunk · SPL

Detect Cloud Account in Splunk

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/

SPL Detection Query

Splunk (SPL)
spl
| union
    [search index=azure sourcetype="azure:monitor:aad:audit"
     (operationName="Add user" OR operationName="Add service principal" OR operationName="Add application" OR operationName="Add service principal credentials")
     result="success"
    | eval Source="AzureAD"
    | eval Actor=coalesce('initiatedBy.user.userPrincipalName', 'initiatedBy.app.displayName')
    | eval Target=coalesce('targetResources{}.userPrincipalName', 'targetResources{}.displayName')
    | eval IPAddress='initiatedBy.user.ipAddress'
    | eval IsServiceAccount=if(match(operationName, "service principal|application"), 1, 0)
    | table _time, Source, operationName, Actor, Target, IPAddress, IsServiceAccount, correlationId],
    [search index=aws sourcetype="aws:cloudtrail"
     (eventName="CreateUser" OR eventName="CreateRole" OR eventName="CreateServiceLinkedRole" OR eventName="CreateVirtualMFADevice")
     NOT errorCode=*
    | eval Source="AWS"
    | eval Actor=coalesce(userIdentity.userName, userIdentity.arn)
    | eval Target=coalesce('requestParameters.userName', 'requestParameters.roleName')
    | eval IPAddress=sourceIPAddress
    | eval IsServiceAccount=if(match(eventName, "Role|ServiceLinked"), 1, 0)
    | table _time, Source, eventName as operationName, Actor, Target, IPAddress, IsServiceAccount, awsRegion],
    [search index=o365 sourcetype="o365:management:activity"
     (Operation="Add user." OR Operation="New-MsolUser" OR Operation="New-AzureADUser")
    | eval Source="O365"
    | eval Actor=UserId
    | eval Target=ObjectId
    | eval IPAddress=ClientIP
    | eval IsServiceAccount=0
    | table _time, Source, Operation as operationName, Actor, Target, IPAddress, IsServiceAccount]
| eval SuspicionScore=0
| eval SuspicionScore=SuspicionScore + if(IsServiceAccount=1, 1, 0)
| eval SuspicionScore=SuspicionScore + if(match(IPAddress, "^(tor|vpn|proxy)") OR isnull(IPAddress) OR IPAddress="", 1, 0)
| eval SuspicionScore=SuspicionScore + if(match(lower(Target), "(admin|root|svc_|service_|test|tmp|temp)"), 1, 0)
| eval SuspicionScore=SuspicionScore + if(Actor="unknown" OR isnull(Actor), 2, 0)
| table _time, Source, operationName, Actor, Target, IPAddress, IsServiceAccount, SuspicionScore
| sort - _time
high severity high confidence

Multi-source SPL detection covering Azure AD audit logs, AWS CloudTrail, and Office 365 activity for cloud account creation events. Uses a union across three index/sourcetype combinations with a suspicion scoring model that elevates priority when: the new account is a service principal/role (+1), the source IP is absent or looks like infrastructure (+1), the target name contains privileged or automation-related keywords (+1), and the actor is unknown (+2). Analysts should investigate any event with SuspicionScore >= 2.

Data Sources

Cloud Service: Cloud AccountAzure AD Audit LogsAWS CloudTrailOffice 365 Management Activity

Required Sourcetypes

azure:monitor:aad:auditaws:cloudtrailo365:management:activity

False Positives & Tuning

  • IT helpdesk and identity administrators creating legitimate new employee accounts during onboarding
  • DevOps pipelines creating service principals or managed identities for CI/CD deployments
  • HR-driven automated provisioning systems creating accounts on new hire events
  • Break-glass or emergency access account creation with documented justification
  • Authorized red team exercises using AADInternals or similar tooling
Download portable Sigma rule (.yml)

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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).

Unlock Pro Content

Get the full detection package for T1136.003 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections