Skip to content

Commit fd64bc4

Browse files
[New Rule] Azure Storage Blob Retrieval via AzCopy (#5179)
* [New Rule] Azure Storage Blob Retrieval via AzCopy with SAS Token # Pull Request *Issue link(s)*: * #5178 <!-- Add Related Issues / PRs for context. Eg: Related to elastic/repo#999 Resolves #123 If there is no issue link, take extra care to write a clear summary and label the PR just as you would label an issue to give additional context to reviewers. --> ## Summary - What I changed Adds detection capabilities for Azure Storage Blob retrieval via AzCopy with SAS tokens. Related to behavior observed by Storm-0501. Please see related issue for more details. <!-- Summarize your PR. Animated gifs are 💯. Code snippets are ⚡️. Examples & screenshots are 🔥 --> ## How To Test Query can be used in TRADE stack. <!-- Some examples of what you could include here are: * Links to GitHub action results for CI test improvements * Sample data before/after screenshots (or short videos showing how something works) * Copy/pasted commands and output from the testing you did in your local terminal window * If tests run in GitHub, you can 🪁or 🔱, respectively, to indicate tests will run in CI * Query used in your stack to verify the change --> ## Checklist <!-- Delete any items that are not applicable to this PR. --> - [ ] Added a label for the type of pr: `bug`, `enhancement`, `schema`, `maintenance`, `Rule: New`, `Rule: Deprecation`, `Rule: Tuning`, `Hunt: New`, or `Hunt: Tuning` so guidelines can be generated - [ ] Added the `meta:rapid-merge` label if planning to merge within 24 hours - [ ] Secret and sensitive material has been managed correctly - [ ] Automated testing was updated or added to match the most common scenarios - [ ] Documentation and comments were added for features that require explanation ## Contributor checklist - Have you signed the [contributor license agreement](https://www.elastic.co/contributor-agreement)? - Have you followed the [contributor guidelines](https://github.com/elastic/detection-rules/blob/main/CONTRIBUTING.md)? * updating non-ecs * Update rules/integrations/azure/exfiltration_azure_storage_blob_download_azcopy_sas_token.toml * Update rules/integrations/azure/exfiltration_azure_storage_blob_download_azcopy_sas_token.toml
1 parent c724631 commit fd64bc4

File tree

2 files changed

+126
-1
lines changed

2 files changed

+126
-1
lines changed

detection_rules/etc/non-ecs-schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@
222222
"logs-azure.platformlogs-*": {
223223
"azure.platformlogs.identity.claim.upn": "keyword",
224224
"azure.platformlogs.properties.id": "keyword",
225-
"azure.platformlogs.identity.claim.appid": "keyword"
225+
"azure.platformlogs.identity.claim.appid": "keyword",
226+
"azure.platformlogs.identity.type": "keyword",
227+
"azure.platformlogs.properties.userAgentHeader": "keyword",
228+
"azure.platformlogs.statusCode": "keyword",
229+
"azure.platformlogs.properties.accountName": "keyword"
226230
},
227231
"logs-o365.audit-*": {
228232
"o365.audit.ExtendedProperties.RequestType": "keyword",
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
[metadata]
2+
creation_date = "2025/10/02"
3+
integration = ["azure"]
4+
maturity = "production"
5+
updated_date = "2025/10/02"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Identifies successful GetBlob operations on Azure Storage Accounts using AzCopy user agent with SAS token
11+
authentication. AzCopy is a command-line utility for copying data to and from Azure Storage. While legitimate for data
12+
migration, adversaries may abuse AzCopy with compromised SAS tokens to exfiltrate data from Azure Storage Accounts. This
13+
rule detects the first occurrence of GetBlob operations from a specific storage account using this pattern.
14+
"""
15+
false_positives = [
16+
"Legitimate data migration or backup operations using AzCopy with SAS tokens may trigger this rule.",
17+
"Automated scripts or processes that use AzCopy for routine data transfers from Azure Storage Accounts.",
18+
"DevOps or IT teams performing authorized data transfers or downloads from Azure Storage using AzCopy.",
19+
]
20+
from = "now-9m"
21+
index = ["logs-azure.platformlogs-*"]
22+
language = "kuery"
23+
license = "Elastic License v2"
24+
name = "Azure Storage Blob Retrieval via AzCopy"
25+
note = """## Triage and analysis
26+
27+
### Investigating Azure Storage Blob Retrieval via AzCopy
28+
29+
Azure Storage Accounts provide cloud storage services for blobs, files, queues, and tables. Shared Access Signatures (SAS) tokens provide delegated access to resources in a storage account with specific permissions and time constraints. AzCopy is a Microsoft command-line utility designed for efficient data transfers to and from Azure Storage. While AzCopy is a legitimate tool, adversaries may abuse it with compromised SAS tokens to exfiltrate data from Azure Storage Accounts.
30+
31+
### Possible investigation steps
32+
- Review the `azure.platformlogs.properties.accountName` field to identify which storage account is being accessed and assess the sensitivity of data stored in that account.
33+
- Examine the `azure.platformlogs.properties.objectKey` field to identify the specific blob(s) being retrieved. Determine if the accessed files contain sensitive or confidential data.
34+
- Check the `source.address` field to identify the source IP address of the request. Investigate if this IP is unusual, unexpected, or originates from an unexpected network or geographic location.
35+
- Review the `azure.platformlogs.uri` field to examine the SAS token parameters, including:
36+
- `se` (expiry time): Check when the SAS token expires
37+
- `sp` (permissions): Verify what permissions were granted (e.g., "rl" for read and list)
38+
- `sv` (API version): Note the storage service version being used
39+
- Examine the `azure.platformlogs.identity.tokenHash` field to identify the specific SAS token signature being used. Correlate this with SAS token generation logs to determine when and how the token was created.
40+
- Check the `azure.platformlogs.properties.responseBodySize` field to assess the volume of data being downloaded. Multiple GetBlob operations with large response sizes may indicate bulk data exfiltration.
41+
- Search for related GetBlob operations from the same `source.address` or with the same `azure.platformlogs.identity.tokenHash` to identify patterns of systematic data retrieval.
42+
- Review Azure Activity Logs for recent SAS token generation events or storage account key access operations that may indicate how the adversary obtained the credentials.
43+
- Correlate this activity with ListBlobs or ListContainers operations from the same source, as adversaries often enumerate storage contents before exfiltration.
44+
- Investigate the `azure.resource.group` field to understand which resource group the storage account belongs to and check for any recent security events or configuration changes in that resource group.
45+
46+
### False positive analysis
47+
- Routine data migration or backup operations using AzCopy with SAS tokens are common in enterprise environments. If this is expected behavior for the storage account, consider adding exceptions for specific accounts or IP ranges.
48+
- DevOps pipelines or automated workflows may use AzCopy with SAS tokens for legitimate data transfers. Review the automation configuration and add exceptions if appropriate.
49+
- Third-party services or partners may have authorized access to storage accounts using AzCopy and SAS tokens. Verify these relationships and create exceptions for known authorized sources.
50+
51+
### Response and remediation
52+
- If unauthorized access is confirmed, immediately revoke the compromised SAS token to prevent further data exfiltration.
53+
- Review and rotate any additional SAS tokens that may have been compromised through the same attack vector.
54+
- Assess the scope of data accessed or exfiltrated during the unauthorized GetBlob operations and determine if sensitive data was compromised.
55+
- Implement additional monitoring and alerting for the affected storage account to detect any further suspicious activity.
56+
- Review and strengthen SAS token generation policies, including implementing shorter expiration times and more restrictive permissions.
57+
- Consider implementing Azure Storage firewall rules or private endpoints to restrict access to storage accounts from trusted networks only.
58+
- Investigate how the SAS token was compromised and remediate the initial access vector to prevent future incidents.
59+
- Document the incident and update security procedures to prevent similar compromises in the future.
60+
"""
61+
references = [
62+
"https://www.microsoft.com/en-us/security/blog/2025/08/27/storm-0501s-evolving-techniques-lead-to-cloud-based-ransomware/",
63+
"https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10",
64+
"https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview",
65+
]
66+
risk_score = 47
67+
rule_id = "a8b3c4d5-e6f7-8901-a2b3-c4d5e6f78901"
68+
setup = """#### Required Azure Storage Diagnostic Logs
69+
70+
To ensure this rule functions correctly, the following diagnostic logs must be enabled for Azure Storage Accounts:
71+
- StorageRead: This log captures all read operations performed on blobs in the storage account, including GetBlob operations. These logs should be streamed to the Event Hub used for the Azure integration configuration.
72+
"""
73+
severity = "medium"
74+
tags = [
75+
"Domain: Cloud",
76+
"Domain: Storage",
77+
"Data Source: Azure",
78+
"Data Source: Azure Platform Logs",
79+
"Data Source: Azure Storage",
80+
"Use Case: Threat Detection",
81+
"Tactic: Exfiltration",
82+
"Resources: Investigation Guide",
83+
]
84+
timestamp_override = "event.ingested"
85+
type = "new_terms"
86+
87+
query = '''
88+
event.dataset: azure.platformlogs and
89+
event.action: GetBlob and
90+
azure.platformlogs.identity.type: SAS and
91+
azure.platformlogs.properties.userAgentHeader: AzCopy* and
92+
azure.platformlogs.statusCode: 200
93+
'''
94+
95+
96+
[[rule.threat]]
97+
framework = "MITRE ATT&CK"
98+
[[rule.threat.technique]]
99+
id = "T1567"
100+
name = "Exfiltration Over Web Service"
101+
reference = "https://attack.mitre.org/techniques/T1567/"
102+
[[rule.threat.technique.subtechnique]]
103+
id = "T1567.002"
104+
name = "Exfiltration to Cloud Storage"
105+
reference = "https://attack.mitre.org/techniques/T1567/002/"
106+
107+
108+
109+
[rule.threat.tactic]
110+
id = "TA0010"
111+
name = "Exfiltration"
112+
reference = "https://attack.mitre.org/tactics/TA0010/"
113+
114+
[rule.new_terms]
115+
field = "new_terms_fields"
116+
value = ["azure.platformlogs.properties.accountName"]
117+
[[rule.new_terms.history_window_start]]
118+
field = "history_window_start"
119+
value = "now-7d"
120+
121+

0 commit comments

Comments
 (0)