Detect Cloud Accounts in CrowdStrike LogScale
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/
LogScale Detection Query
// T1586.003 — Compromised Cloud Account Usage
// Requires Azure AD sign-in logs ingested into CrowdStrike LogScale via Azure Event Hub integration
event_source="AzureActiveDirectory" event_type="SignIn" result_type="0"
| risk_level := lower(riskLevelDuringSignIn)
| risk_state := lower(riskState)
| risk_events := lower(riskEventTypes_v2)
| auth_req := lower(authenticationRequirement)
| is_high_risk := if(
in(field=risk_level, values=["high", "medium"]) or
in(field=risk_state, values=["atrisk", "confirmedcompromised"]),
"true", "false")
| has_risky_event := if(
regex(
"(impossibletravel|anonymizedipaddress|maliciousipaddress|unfamiliarfeatures|passwordspray|leakedcredentials|nationstateip|riskyipaddress|investigationsthreatintelligence)",
field=risk_events
),
"true", "false")
| cross_tenant_mfa := if(
auth_req = "singlefactorauthentication" and
isNotNull(homeTenantId) and
homeTenantId != "" and
homeTenantId != resourceTenantId,
"true", "false")
| is_high_risk = "true" or has_risky_event = "true" or cross_tenant_mfa = "true"
| threat_score := (if(is_high_risk = "true", 1, 0) + if(has_risky_event = "true", 1, 0) + if(cross_tenant_mfa = "true", 1, 0))
| table(
[timestamp, userPrincipalName, ipAddress, appDisplayName,
riskLevelDuringSignIn, riskState, riskEventTypes_v2,
authenticationRequirement, homeTenantId, resourceTenantId,
is_high_risk, has_risky_event, cross_tenant_mfa, threat_score],
limit=1000
)
| sort(threat_score, order=desc) Detects compromised Azure cloud account usage in CrowdStrike LogScale by processing Azure Active Directory sign-in events ingested via the LogScale Azure Event Hub integration. Derives normalised lower-case fields for consistent comparison, evaluates Identity Protection risk levels, compromise state strings, risky event category patterns via regex, and cross-tenant single-factor authentication bypass. Computes a composite threat_score (0-3) per event for analyst prioritisation and sorts highest-risk events first.
Data Sources
Required Tables
False Positives & Tuning
- Cloud-native CI/CD automation pipelines (GitHub Actions, Azure DevOps) using service principals for cross-tenant deployments that authenticate with singleFactorAuthentication because device compliance satisfies the Conditional Access requirement without triggering a second factor at the resource tenant
- Corporate outbound proxy infrastructure with egress through anonymisation or privacy-enhancing proxy tiers causing all user sign-ins to appear as anonymizedIPAddress regardless of the actual user location or legitimacy
- LogScale Azure integration field name drift following Microsoft Graph API or Azure Monitor schema versioning updates, where riskEventTypes_v2 changes format (e.g. from comma-delimited string to JSON array), causing regex matches to fail silently until the field extraction is corrected
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.