T1586.003 Splunk · SPL

Detect Cloud Accounts in Splunk

Adversaries may compromise cloud accounts to use during targeting operations. Compromised cloud accounts (Azure, AWS, GCP, Dropbox, OneDrive, GitHub) allow adversaries to leverage trusted third-party infrastructure for command and control, exfiltration to cloud storage, sending phishing or spam via cloud messaging services (AWS SES/SNS, SendGrid, Twilio), and acquiring additional cloud infrastructure without managing their own servers. Compromise methods include phishing for cloud credentials, password spraying, purchasing leaked credential sets from criminal markets, or stealing OAuth access tokens. APT29 has been observed using compromised Azure Virtual Machine accounts with residential proxies to obfuscate access to victim environments. This is a PRE-ATT&CK technique — the initial account compromise occurs outside the victim environment on third-party cloud platforms. Detection pivots to observable downstream effects: anomalous authentication events in cloud identity provider logs, risk signals from Identity Protection engines, MFA bypass indicators, and post-compromise behaviors such as bulk cloud storage access or cloud messaging API abuse.

MITRE ATT&CK

Tactic
Resource Development
Technique
T1586 Compromise Accounts
Sub-technique
T1586.003 Cloud Accounts
Canonical reference
https://attack.mitre.org/techniques/T1586/003/

SPL Detection Query

Splunk (SPL)
spl
index=azure sourcetype="azure:aad:signin" resultType=0
| eval user=userPrincipalName
| eval src_ip=ipAddress
| eval app=appDisplayName
| eval risk_level=lower(coalesce(riskLevelDuringSignIn, ""))
| eval risk_state=lower(coalesce(riskState, ""))
| eval risk_events=lower(coalesce(riskEventTypes_v2, ""))
| eval country=spath(_raw, "location.countryOrRegion")
| eval city=spath(_raw, "location.city")
| eval auth_req=lower(coalesce(authenticationRequirement, ""))
| eval ca_status=lower(coalesce(conditionalAccessStatus, ""))
| eval home_tenant=coalesce(homeTenantId, "")
| eval resource_tenant=coalesce(resourceTenantId, "")
| eval is_high_risk=if(
    risk_level IN ("high", "medium") OR risk_state IN ("atrisk", "confirmedcompromised"),
    1, 0)
| eval has_risky_event=if(
    match(risk_events, "(impossibletravel|anonymizedipaddress|maliciousipaddress|unfamiliarfeatures|passwordspray|leakedcredentials|nationstateip|riskyipaddress|investigationsthreatintelligence)"),
    1, 0)
| eval cross_tenant_mfa_bypass=if(
    auth_req="singlefactorauthentication" AND
    home_tenant!="" AND home_tenant!=resource_tenant,
    1, 0)
| where is_high_risk=1 OR has_risky_event=1 OR cross_tenant_mfa_bypass=1
| eval threat_indicators=mvappend(
    if(is_high_risk=1, "HighRiskSignIn", null()),
    if(has_risky_event=1, "RiskyEvent:".risk_events, null()),
    if(cross_tenant_mfa_bypass=1, "CrossTenantMFABypass", null())
)
| eval threat_score=is_high_risk + has_risky_event + cross_tenant_mfa_bypass
| table _time, user, src_ip, app, country, city, risk_level, risk_state, risk_events, cross_tenant_mfa_bypass, threat_score, threat_indicators
| sort - threat_score, - _time
high severity medium confidence

Detects compromised cloud account usage from Azure AD sign-in logs ingested via the Splunk Add-on for Microsoft Cloud Services (azure:aad:signin sourcetype). Evaluates successful authentications against three risk dimensions: Identity Protection risk level/state, specific risky event type matches, and cross-tenant MFA bypass patterns. Uses spath for nested JSON field extraction of location data. Threat score aggregates risk dimensions for analyst prioritization. Extend by adding a union with index=aws sourcetype=aws:cloudtrail eventName=ConsoleLogin to cover AWS account compromise indicators.

Data Sources

Application Log: Application Log ContentUser Account: User Account AuthenticationAzure AD Sign-In LogsSplunk Add-on for Microsoft Cloud Services

Required Sourcetypes

azure:aad:signin

False Positives & Tuning

  • Business travelers signing in from foreign countries triggering impossibleTravel or unfamiliarFeatures events that populate risk_events field
  • Corporate VPN or proxy services routing traffic through unexpected geographies or IP ranges flagged as anonymizing services by Identity Protection
  • Service accounts and automation pipelines authenticating from cloud-hosted infrastructure where Azure Identity Protection flags the hosting provider IP range as anomalous
  • Legacy B2B federation scenarios where partner tenant users regularly authenticate to home tenant resources with single-factor authentication under grandfathered conditional access exclusions
Download portable Sigma rule (.yml)

Other platforms for T1586.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 1Azure AD Password Spray Simulation

    Expected signal: Azure AD SigninLogs: multiple ResultType != 0 (error code 50126: invalid credentials) entries from the same source IPAddress within a 5-10 minute window, each with a different UserPrincipalName. Azure Identity Protection will aggregate the spray pattern and generate a passwordSpray risk event type within 15-30 minutes of the spray completing, appearing in Azure AD > Security > Identity Protection > Risk Detections.

  2. Test 2Sign-In from Anonymizing Proxy to Trigger Identity Protection Risk Event

    Expected signal: Azure AD SigninLogs: successful sign-in (ResultType=0) with IPAddress matching a known Tor exit node (verifiable against dan.me.uk/torlist or similar). RiskEventTypes_V2 populated with 'anonymizedIPAddress'. RiskLevelDuringSignIn set to 'medium' or 'high' within 5-15 minutes. The risk detection appears in Azure AD > Security > Identity Protection > Risk Detections with detectionTimingType='realtime' or 'nearRealtime'.

  3. Test 3OAuth Access Token Reuse for Cloud Storage Access

    Expected signal: Azure Storage diagnostic logs (StorageBlobLogs): AuthenticationType='OAuth', RequesterObjectId matches the test user's object ID, URI shows container list and blob download operations. No new SigninLogs entry is generated since token reuse does not trigger interactive authentication. Defender for Cloud Apps (if deployed) generates an anomalous cloud storage access alert when detecting storage API access from an unusual user agent or IP without corresponding SigninLogs event.

  4. Test 4AWS Cloud Credential Validation and Reconnaissance

    Expected signal: AWS CloudTrail events (sourcetype=aws:cloudtrail in Splunk): GetCallerIdentity (eventSource=sts.amazonaws.com), ListAttachedUserPolicies and ListGroupsForUser (eventSource=iam.amazonaws.com), ListBuckets (eventSource=s3.amazonaws.com), DescribeInstances (eventSource=ec2.amazonaws.com) — all sharing the same sourceIPAddress, userAgent (aws-cli/<version>), and accessKeyId within a 2-minute window. If AWS GuardDuty is enabled, Recon:IAMUser/MaliciousIPCaller or Recon:IAMUser/PortProbeUnprotectedPort findings may fire depending on source IP reputation.

Unlock Pro Content

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

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections