Detect Cloud Accounts in Sumo Logic CSE
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/
Sumo Detection Query
_sourceCategory=Azure/SignInLogs
| json field=_raw "resultType" as result_type
| json field=_raw "userPrincipalName" as user
| json field=_raw "ipAddress" as src_ip
| json field=_raw "appDisplayName" as app
| json field=_raw "riskLevelDuringSignIn" as risk_level
| json field=_raw "riskState" as risk_state
| json field=_raw "riskEventTypes_v2" as risk_events
| json field=_raw "authenticationRequirement" as auth_req
| json field=_raw "homeTenantId" as home_tenant
| json field=_raw "resourceTenantId" as resource_tenant
| json field=_raw "location.countryOrRegion" as country
| where result_type = "0"
| toLowerCase(risk_level) as risk_level_lc
| toLowerCase(risk_state) as risk_state_lc
| toLowerCase(risk_events) as risk_events_lc
| toLowerCase(auth_req) as auth_req_lc
| where (
risk_level_lc in ("high", "medium")
OR risk_state_lc in ("atrisk", "confirmedcompromised")
OR risk_events_lc matches "*impossibletravel*"
OR risk_events_lc matches "*anonymizedipaddress*"
OR risk_events_lc matches "*maliciousipaddress*"
OR risk_events_lc matches "*unfamiliarfeatures*"
OR risk_events_lc matches "*passwordspray*"
OR risk_events_lc matches "*leakedcredentials*"
OR risk_events_lc matches "*nationstateip*"
OR risk_events_lc matches "*riskyipaddress*"
OR risk_events_lc matches "*investigationsthreatintelligence*"
OR (
auth_req_lc = "singlefactorauthentication"
AND !isNull(home_tenant)
AND !isBlank(home_tenant)
AND home_tenant != resource_tenant
)
)
| eval threat_score = if(risk_level_lc in ("high","medium"), 1, 0)
+ if(risk_state_lc in ("atrisk","confirmedcompromised"), 1, 0)
+ if(auth_req_lc = "singlefactorauthentication" AND !isNull(home_tenant) AND !isBlank(home_tenant) AND home_tenant != resource_tenant, 1, 0)
| fields _messageTime, user, src_ip, app, country, risk_level, risk_state, risk_events, auth_req, home_tenant, resource_tenant, threat_score
| sort by threat_score desc, _messageTime desc Detects compromised Azure cloud account usage in Sumo Logic by parsing raw Azure AD sign-in JSON logs collected via the Sumo Logic Azure Event Hub collector. Extracts Identity Protection fields, normalises to lower-case for consistent matching, evaluates risk levels, compromise states, risky event category strings via glob matches, and cross-tenant MFA bypass conditions. Computes a composite threat score (0-3) based on indicator count for analyst triage prioritisation.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate remote workers on residential ISPs or consumer VPN products (NordVPN, ExpressVPN) triggering anonymizedIPAddress or riskyIPAddress signals where personal VPN use is permitted by policy
- B2B collaboration flows where guest users from partner organisations have MFA enforced in their home tenant and the resource tenant legitimately observes singleFactorAuthentication as the home-tenant MFA claim is trusted
- Security red team engagements or authorised penetration tests deliberately exercising Azure Identity Protection detections against sandbox or production accounts during scoped testing windows
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.
- 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.
- 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'.
- 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.
- 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.
References (10)
- https://attack.mitre.org/techniques/T1586/003/
- https://unit42.paloaltonetworks.com/compromised-cloud-compute-credentials/
- https://awakesecurity.com/blog/threat-hunting-series-detecting-command-control-in-the-cloud/
- https://www.netcraft.com/blog/popular-email-platform-used-to-impersonate-itself/
- https://www.microsoft.com/security/blog/2021/10/25/nobelium-targeting-delegated-administrative-privileges-to-facilitate-broader-attacks/
- https://learn.microsoft.com/en-us/azure/active-directory/identity-protection/concept-identity-protection-risks
- https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/reference-azure-monitor-sign-ins-log-schema
- https://learn.microsoft.com/en-us/microsoft-365/security/defender/advanced-hunting-emailevents-table
- https://docs.splunk.com/Documentation/AddOns/released/MSCloudServices/ConfigureInputs
- https://mandiant.com/resources/blog/apt29-microsoft-365
Unlock Pro Content
Get the full detection package for T1586.003 including response playbook, investigation guide, and atomic red team tests.