Skip to content

Commit 6ce4e33

Browse files
Update latest docs (#6849)
1 parent 39a5680 commit 6ce4e33

File tree

23 files changed

+2001
-52
lines changed

23 files changed

+2001
-52
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
[[prebuilt-rule-8-16-14-backup-deletion-with-wbadmin]]
2+
=== Backup Deletion with Wbadmin
3+
4+
Detects use of wbadmin.exe to delete backup catalogs, system state backups, or other backup data. Ransomware and other malware may do this to prevent system recovery.
5+
6+
*Rule type*: eql
7+
8+
*Rule indices*:
9+
10+
* endgame-*
11+
* logs-crowdstrike.fdr*
12+
* logs-endpoint.events.process-*
13+
* logs-m365_defender.event-*
14+
* logs-sentinel_one_cloud_funnel.*
15+
* logs-system.security*
16+
* logs-windows.forwarded*
17+
* logs-windows.sysmon_operational-*
18+
* winlogbeat-*
19+
20+
*Severity*: low
21+
22+
*Risk score*: 21
23+
24+
*Runs every*: 5m
25+
26+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
27+
28+
*Maximum alerts per execution*: 100
29+
30+
*References*: None
31+
32+
*Tags*:
33+
34+
* Domain: Endpoint
35+
* OS: Windows
36+
* Use Case: Threat Detection
37+
* Tactic: Impact
38+
* Resources: Investigation Guide
39+
* Data Source: Elastic Endgame
40+
* Data Source: Elastic Defend
41+
* Data Source: Windows Security Event Logs
42+
* Data Source: Microsoft Defender for Endpoint
43+
* Data Source: Sysmon
44+
* Data Source: SentinelOne
45+
* Data Source: Crowdstrike
46+
47+
*Version*: 318
48+
49+
*Rule authors*:
50+
51+
* Elastic
52+
53+
*Rule license*: Elastic License v2
54+
55+
56+
==== Investigation guide
57+
58+
59+
60+
*Triage and analysis*
61+
62+
63+
64+
*Investigating Backup Deletion with Wbadmin*
65+
66+
67+
Windows Server Backup stores the details about your backups (what volumes are backed up and where the backups are located) in a file called a backup catalog, which ransomware victims can use to recover corrupted backup files. Deleting these files is a common step in threat actor playbooks.
68+
69+
This rule identifies the deletion of the backup catalog using the `wbadmin.exe` utility.
70+
71+
72+
*Possible investigation steps*
73+
74+
75+
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
76+
- Identify the user account that performed the action and whether it should perform this kind of action.
77+
- Contact the account owner and confirm whether they are aware of this activity.
78+
- Investigate other alerts associated with the user/host during the past 48 hours.
79+
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
80+
- Check if any files on the host machine have been encrypted.
81+
82+
83+
*False positive analysis*
84+
85+
86+
- Administrators can use this command to delete corrupted catalogs, but overall the activity is unlikely to be legitimate.
87+
88+
89+
*Related rules*
90+
91+
92+
- Third-party Backup Files Deleted via Unexpected Process - 11ea6bec-ebde-4d71-a8e9-784948f8e3e9
93+
- Volume Shadow Copy Deleted or Resized via VssAdmin - b5ea4bfe-a1b2-421f-9d47-22a75a6f2921
94+
- Volume Shadow Copy Deletion via PowerShell - d99a037b-c8e2-47a5-97b9-170d076827c4
95+
- Volume Shadow Copy Deletion via WMIC - dc9c1f74-dac3-48e3-b47f-eb79db358f57
96+
97+
98+
*Response and remediation*
99+
100+
101+
- Initiate the incident response process based on the outcome of the triage.
102+
- Consider isolating the involved host to prevent destructive behavior, which is commonly associated with this activity.
103+
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
104+
- If any other destructive action was identified on the host, it is recommended to prioritize the investigation and look for ransomware preparation and execution activities.
105+
- If any backups were affected:
106+
- Perform data recovery locally or restore the backups from replicated copies (cloud, other servers, etc.).
107+
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
108+
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
109+
110+
111+
==== Rule query
112+
113+
114+
[source, js]
115+
----------------------------------
116+
process where host.os.type == "windows" and event.type == "start" and
117+
(process.name : "wbadmin.exe" or ?process.pe.original_file_name == "WBADMIN.EXE") and
118+
process.args : ("catalog", "backup", "systemstatebackup") and process.args : "delete"
119+
120+
----------------------------------
121+
122+
*Framework*: MITRE ATT&CK^TM^
123+
124+
* Tactic:
125+
** Name: Impact
126+
** ID: TA0040
127+
** Reference URL: https://attack.mitre.org/tactics/TA0040/
128+
* Technique:
129+
** Name: Data Destruction
130+
** ID: T1485
131+
** Reference URL: https://attack.mitre.org/techniques/T1485/
132+
* Technique:
133+
** Name: Inhibit System Recovery
134+
** ID: T1490
135+
** Reference URL: https://attack.mitre.org/techniques/T1490/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
[[prebuilt-rule-8-16-14-microsoft-entra-id-sharepoint-access-for-user-principal-via-auth-broker]]
2+
=== Microsoft Entra ID SharePoint Access for User Principal via Auth Broker
3+
4+
This rule detects non-interactive authentication activity against SharePoint Online (`Office 365 SharePoint Online`) by a user principal via the `Microsoft Authentication Broker` application. The session leverages a refresh token or Primary Refresh Token (PRT) without interactive sign-in, often used in OAuth phishing or token replay scenarios.
5+
6+
*Rule type*: new_terms
7+
8+
*Rule indices*:
9+
10+
* logs-azure.signinlogs-*
11+
12+
*Severity*: high
13+
14+
*Risk score*: 73
15+
16+
*Runs every*: 5m
17+
18+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
19+
20+
*Maximum alerts per execution*: 100
21+
22+
*References*:
23+
24+
* https://www.volexity.com/blog/2025/04/22/phishing-for-codes-russian-threat-actors-target-microsoft-365-oauth-workflows/
25+
* https://github.com/dirkjanm/ROADtools
26+
* https://dirkjanm.io/phishing-for-microsoft-entra-primary-refresh-tokens/
27+
28+
*Tags*:
29+
30+
* Domain: Cloud
31+
* Use Case: Identity and Access Audit
32+
* Tactic: Collection
33+
* Data Source: Azure
34+
* Data Source: Microsoft Entra ID
35+
* Data Source: Microsoft Entra ID Sign-in Logs
36+
* Resources: Investigation Guide
37+
38+
*Version*: 2
39+
40+
*Rule authors*:
41+
42+
* Elastic
43+
44+
*Rule license*: Elastic License v2
45+
46+
47+
==== Investigation guide
48+
49+
50+
51+
*Triage and analysis*
52+
53+
54+
55+
*Investigating Microsoft Entra ID SharePoint Access for User Principal via Auth Broker*
56+
57+
58+
This rule identifies non-interactive sign-ins to SharePoint Online via the Microsoft Authentication Broker application using a refresh token or Primary Refresh Token (PRT). This type of activity may indicate token replay attacks, OAuth abuse, or automated access from previously consented apps or stolen sessions.
59+
60+
This is a https://www.elastic.co/guide/en/security/current/rules-ui-create.html#create-new-terms-rule[New Terms rule] that detects the first occurrence of a user principal name accessing SharePoint Online via the Microsoft Authentication Broker application in the last 14 days.
61+
62+
63+
*Possible Investigation Steps:*
64+
65+
66+
- `azure.signinlogs.properties.user_principal_name`: Identify the user involved. Investigate whether this user typically accesses SharePoint or if this is an anomaly.
67+
- `azure.signinlogs.properties.app_display_name`: Verify the application used (e.g., Authentication Broker). Determine if the app is expected for SharePoint access in your environment.
68+
- `azure.signinlogs.properties.resource_display_name`: Review the resource being accessed. SharePoint activity should be aligned with job roles or historical usage.
69+
- `azure.signinlogs.properties.incoming_token_type`: Indicates the token type used. Look for `refreshToken` or `primaryRefreshToken`, which may point to token replay or silent access.
70+
- `azure.signinlogs.properties.is_interactive`: If false, indicates the sign-in was non-interactive. Correlate with recent sign-ins to understand if a prior session may have been reused.
71+
- `user_agent.original`: Analyze the user agent string for automation indicators (e.g., scripts, unusual clients). Compare with what’s typical for the user or device.
72+
- `source.ip`: Check the originating IP address. Investigate if the IP is associated with data centers, VPNs, anonymizers, or is geographically unusual for the user.
73+
- `source.geo.*`: Evaluate sign-in location details. Determine if the sign-in location aligns with expected travel or usage behavior.
74+
- `azure.signinlogs.properties.applied_conditional_access_policies`: Review whether Conditional Access policies were triggered or bypassed. Investigate if required controls (like MFA) were applied.
75+
- `azure.signinlogs.properties.authentication_processing_details`: Review any details about the authentication, such as token type or scopes. This may indicate delegated access or automation patterns.
76+
77+
78+
*False Positive Analysis*
79+
80+
81+
- Certain MDM or mobile app scenarios may use refresh tokens legitimately via brokered apps.
82+
- Automated processes using authorized, scripted clients could trigger this activity, especially in developer or operations environments.
83+
- If Conditional Access policies are configured in “report-only” mode or exempted for trusted apps, activity may appear unusual but be authorized.
84+
85+
86+
*Response and Remediation*
87+
88+
89+
- If activity appears unauthorized:
90+
- Investigate and revoke active sessions or refresh tokens.
91+
- Notify the user and validate expected activity.
92+
- Review and audit app consent permissions and remove unused or high-risk delegated access.
93+
- Harden Conditional Access policies to limit non-interactive access to sensitive resources.
94+
- Monitor for repeated use of the same user agent, IP, or token type across other users to identify broader campaigns.
95+
- Consider alerting on unusual patterns in sign-in frequency, geography, and application usage for SharePoint and other key services.
96+
97+
98+
99+
==== Setup
100+
101+
102+
103+
*Required Microsoft Entra ID Sign-In Logs*
104+
105+
To use this rule, ensure that Microsoft Entra ID Sign-In Logs are being collected and streamed into the Elastic Stack via the Azure integration.
106+
107+
108+
==== Rule query
109+
110+
111+
[source, js]
112+
----------------------------------
113+
event.dataset: "azure.signinlogs"
114+
and azure.signinlogs.properties.app_id: "29d9ed98-a469-4536-ade2-f981bc1d605e"
115+
and azure.signinlogs.properties.resource_id: "00000003-0000-0ff1-ce00-000000000000"
116+
and azure.signinlogs.identity: *
117+
and azure.signinlogs.properties.user_principal_name: *
118+
and azure.signinlogs.properties.incoming_token_type: ("refreshToken" or "primaryRefreshToken")
119+
and azure.signinlogs.properties.is_interactive: false
120+
121+
----------------------------------
122+
123+
*Framework*: MITRE ATT&CK^TM^
124+
125+
* Tactic:
126+
** Name: Collection
127+
** ID: TA0009
128+
** Reference URL: https://attack.mitre.org/tactics/TA0009/
129+
* Technique:
130+
** Name: Data from Information Repositories
131+
** ID: T1213
132+
** Reference URL: https://attack.mitre.org/techniques/T1213/
133+
* Sub-technique:
134+
** Name: Sharepoint
135+
** ID: T1213.002
136+
** Reference URL: https://attack.mitre.org/techniques/T1213/002/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
[[prebuilt-rule-8-16-14-microsoft-graph-first-occurrence-of-client-request]]
2+
=== Microsoft Graph First Occurrence of Client Request
3+
4+
This New Terms rule focuses on the first occurrence of a client application ID (azure.graphactivitylogs.properties.app_id) making a request to Microsoft Graph API for a specific tenant ID (azure.tenant_id) and user principal object ID (azure.graphactivitylogs.properties.user_principal_object_id). This rule may helps identify unauthorized access or actions performed by compromised accounts. Advesaries may succesfully compromise a user's credentials and use the Microsoft Graph API to access resources or perform actions on behalf of the user.
5+
6+
*Rule type*: new_terms
7+
8+
*Rule indices*:
9+
10+
* filebeat-*
11+
* logs-azure.graphactivitylogs-*
12+
13+
*Severity*: low
14+
15+
*Risk score*: 21
16+
17+
*Runs every*: 5m
18+
19+
*Searches indices from*: now-9m ({ref}/common-options.html#date-math[Date Math format], see also <<rule-schedule, `Additional look-back time`>>)
20+
21+
*Maximum alerts per execution*: 100
22+
23+
*References*:
24+
25+
* https://www.volexity.com/blog/2025/04/22/phishing-for-codes-russian-threat-actors-target-microsoft-365-oauth-workflows/
26+
27+
*Tags*:
28+
29+
* Domain: Cloud
30+
* Data Source: Azure
31+
* Data Source: Microsoft Graph
32+
* Data Source: Microsoft Graph Activity Logs
33+
* Resources: Investigation Guide
34+
* Use Case: Identity and Access Audit
35+
* Tactic: Initial Access
36+
37+
*Version*: 2
38+
39+
*Rule authors*:
40+
41+
* Elastic
42+
43+
*Rule license*: Elastic License v2
44+
45+
46+
==== Investigation guide
47+
48+
49+
50+
*Triage and analysis*
51+
52+
53+
54+
*Investigating Microsoft Graph First Occurrence of Client Request*
55+
56+
57+
This rule detects the first observed occurrence of a Microsoft Graph API request by a specific client application ID (`azure.graphactivitylogs.properties.app_id`) in combination with a user principal object ID (`azure.graphactivitylogs.properties.user_principal_object_id`) and tenant ID (`azure.tenant_id`) within the last 14 days. This may indicate unauthorized access following a successful phishing attempt, token theft, or abuse of OAuth workflows.
58+
59+
Adversaries frequently exploit legitimate Microsoft or third-party application IDs to avoid raising suspicion during initial access. By using pre-consented or trusted apps to interact with Microsoft Graph, attackers can perform actions on behalf of users without triggering conventional authentication alerts or requiring additional user interaction.
60+
61+
62+
*Possible investigation steps*
63+
64+
65+
- Review `azure.graphactivitylogs.properties.user_principal_object_id` and correlate with recent sign-in logs for the associated user.
66+
- Determine whether `azure.graphactivitylogs.properties.app_id` is a known and approved application in your environment.
67+
- Investigate the `user_agent.original` field for signs of scripted access (e.g., automation tools or libraries).
68+
- Check the source IP address (`source.ip`) and geolocation data (`source.geo.*`) for unfamiliar origins.
69+
- Inspect `azure.graphactivitylogs.properties.scopes` to understand the level of access being requested by the app.
70+
- Examine any follow-up Graph API activity from the same `app_id` or `user_principal_object_id` for signs of data access or exfiltration.
71+
- Correlate with device or session ID fields (`azure.graphactivitylogs.properties.c_sid`, if present) to detect persistent or repeat activity.
72+
73+
74+
*False positive analysis*
75+
76+
77+
- First-time use of a legitimate Microsoft or enterprise-approved application.
78+
- Developer or automation workflows initiating new Graph API requests.
79+
- Valid end-user activity following device reconfiguration or new client installation.
80+
- Maintain an allowlist of expected `app_id` values and known developer tools.
81+
- Suppress detections from known good `user_agent.original` strings or approved source IP ranges.
82+
- Use device and identity telemetry to distinguish trusted vs. unknown activity sources.
83+
- Combine with session risk or sign-in anomaly signals where available.
84+
85+
86+
*Response and remediation*
87+
88+
89+
- Reach out to the user and verify whether they authorized the application access.
90+
- Revoke active OAuth tokens and reset credentials if unauthorized use is confirmed.
91+
- Search for additional Graph API calls made by the same `app_id` or `user_principal_object_id`.
92+
- Investigate whether sensitive resources (mail, files, Teams, contacts) were accessed.
93+
- Apply Conditional Access policies to limit Graph API access by app type, IP, or device state.
94+
- Restrict user consent for third-party apps and enforce admin approval workflows.
95+
- Monitor usage of new or uncommon `app_id` values across your tenant.
96+
- Provide user education on OAuth phishing tactics and reporting suspicious prompts.
97+
98+
99+
==== Rule query
100+
101+
102+
[source, js]
103+
----------------------------------
104+
event.dataset: "azure.graphactivitylogs"
105+
and event.type: "access"
106+
and azure.graphactivitylogs.properties.c_idtyp: "user"
107+
and azure.graphactivitylogs.properties.client_auth_method: 0
108+
and http.response.status_code: 200
109+
and url.domain: "graph.microsoft.com"
110+
111+
----------------------------------
112+
113+
*Framework*: MITRE ATT&CK^TM^
114+
115+
* Tactic:
116+
** Name: Initial Access
117+
** ID: TA0001
118+
** Reference URL: https://attack.mitre.org/tactics/TA0001/
119+
* Technique:
120+
** Name: Valid Accounts
121+
** ID: T1078
122+
** Reference URL: https://attack.mitre.org/techniques/T1078/
123+
* Sub-technique:
124+
** Name: Cloud Accounts
125+
** ID: T1078.004
126+
** Reference URL: https://attack.mitre.org/techniques/T1078/004/

0 commit comments

Comments
 (0)