Rule : Cloud Object Read/Download Bursts
Collection Cloud App Object Download Burst
Query
let ReadKeywords=dynamic(["download","fileaccessed","filedownloaded","read","getfile"]);
CloudAppEvents
| where Timestamp > ago(24h)
| where ActionType has_any (ReadKeywords) or ActivityType has_any (ReadKeywords)
| summarize Events=count(), UniqueObjects=dcount(ObjectId), SampleNames=make_set(ObjectName,10), Actions=make_set(ActionType,8) by AccountId, Application, IPAddress, bin(Timestamp,15m)
| where Events >= 100 and UniqueObjects >= 50
| order by UniqueObjects descAbout this query
Explanation
This query is designed to detect suspicious activity in cloud environments, specifically focusing on identifying when a single account or IP address reads or downloads a large number of unique cloud objects in a short period. Here's a simplified breakdown:
-
Purpose: The query aims to identify potential data exfiltration by detecting when an account or IP accesses or downloads many unique files within a 15-minute window. This behavior might indicate that an agent has found accessible data and is attempting to download it in bulk.
-
Data Source: It analyzes events from the
CloudAppEventstable, which logs actions related to cloud applications. -
Detection Criteria:
- The query looks for events where the action type involves reading or downloading files (keywords like "download", "fileaccessed", etc.).
- It triggers an alert if there are 100 or more such events involving at least 50 unique objects within a 15-minute timeframe.
-
Output: The query summarizes the number of events, the count of unique objects accessed, a sample of object names, and the types of actions performed, grouped by account ID, application, IP address, and time.
-
False Positives: It suggests excluding known backup and sync operations to reduce false positives, as these activities might naturally involve accessing many files.
-
Triage: If an alert is triggered, the next steps involve reviewing the accessed file names for sensitive data and checking if there was a prior pattern of rapid data discovery by the same account.
-
Customization: The query includes placeholders for tuning based on specific tenant or provider schemas and suggests running it as a hunt to refine thresholds before setting up alerts.
Overall, this query is part of a security monitoring strategy to detect potential unauthorized data access or exfiltration in cloud environments.