Skip to content

Commit f7204d0

Browse files
authored
Merge branch 'main' into web-server-rule-tuning
2 parents 88eae44 + fcb6c3c commit f7204d0

File tree

124 files changed

+365
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+365
-330
lines changed

.github/stale.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ onlyLabels: []
1212
exemptLabels:
1313
- bug
1414
- backlog
15+
- "Rule: Tuning"
16+
- "Rule: New"
1517

1618
# Set to true to ignore issues in a project (defaults to false)
1719
exemptProjects: false

rules/cross-platform/defense_evasion_whitespace_padding_command_line.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/06/30"
33
integration = ["endpoint", "system", "windows", "auditd_manager", "m365_defender", "crowdstrike", "sentinel_one_cloud_funnel"]
44
maturity = "production"
5-
updated_date = "2025/06/30"
5+
updated_date = "2025/12/09"
66

77
[rule]
88
author = ["Elastic"]
@@ -90,7 +90,7 @@ FROM logs-* metadata _id, _version, _index
9090
// more than 100 spaces in process.command_line
9191
| eval multi_spaces = LOCATE(process.command_line, space(100))
9292
| where multi_spaces > 0
93-
| keep user.name, host.id, host.name, process.command_line, process.executable, process.parent.executable
93+
| keep user.name, host.id, host.name, process.command_line, process.executable, process.parent.executable, _id, _version, _index
9494
'''
9595

9696

rules/cross-platform/initial_access_azure_o365_with_network_alert.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
creation_date = "2025/04/29"
33
integration = ["azure", "o365"]
44
maturity = "production"
5-
updated_date = "2025/07/30"
5+
updated_date = "2025/12/10"
66

77
[rule]
88
author = ["Elastic"]
99
description = """
10-
This rule correlate Azure or Office 356 mail successful sign-in events with network security alerts by source.ip.
10+
This rule correlate Entra-ID or Microsoft 365 mail successful sign-in events with network security alerts by source address.
1111
Adversaries may trigger some network security alerts such as reputation or other anomalies before accessing cloud
1212
resources.
1313
"""
@@ -19,10 +19,10 @@ false_positives = [
1919
from = "now-60m"
2020
language = "esql"
2121
license = "Elastic License v2"
22-
name = "Microsoft 365 or Entra ID Sign-in from a Suspicious Source"
22+
name = "M365 or Entra ID Identity Sign-in from a Suspicious Source"
2323
note = """## Triage and analysis
2424
25-
### Investigating Microsoft 365 or Entra ID Sign-in from a Suspicious Source
25+
### Investigating M365 or Entra ID Identity Sign-in from a Suspicious Source
2626
2727
#### Possible investigation steps
2828
@@ -82,7 +82,7 @@ from logs-o365.audit-*, logs-azure.signinlogs-*, .alerts-security.*
8282
| where @timestamp > now() - 8 hours
8383
// filter for azure or m365 sign-in and external alerts with source.ip not null
8484
| where to_ip(source.ip) is not null
85-
and (event.dataset in ("o365.audit", "azure.signinlogs") or kibana.alert.rule.name == "External Alerts")
85+
and (event.dataset in ("o365.audit", "azure.signinlogs") or kibana.alert.rule.rule_id == "eb079c62-4481-4d6e-9643-3ca499df7aaa")
8686
and not cidr_match(
8787
to_ip(source.ip),
8888
"10.0.0.0/8", "127.0.0.0/8", "169.254.0.0/16", "172.16.0.0/12", "192.0.0.0/24", "192.0.0.0/29",
@@ -93,13 +93,13 @@ from logs-o365.audit-*, logs-azure.signinlogs-*, .alerts-security.*
9393
)
9494
9595
// capture relevant raw fields
96-
| keep source.ip, event.action, event.outcome, event.dataset, kibana.alert.rule.name, event.category
96+
| keep source.ip, event.action, event.outcome, event.dataset, kibana.alert.rule.rule_id, event.category
9797
9898
// classify each source ip based on alert type
9999
| eval
100100
Esql.source_ip_mail_access_case = case(event.dataset == "o365.audit" and event.action == "MailItemsAccessed" and event.outcome == "success", to_ip(source.ip), null),
101101
Esql.source_ip_azure_signin_case = case(event.dataset == "azure.signinlogs" and event.outcome == "success", to_ip(source.ip), null),
102-
Esql.source_ip_network_alert_case = case(kibana.alert.rule.name == "external alerts" and not event.dataset in ("o365.audit", "azure.signinlogs"), to_ip(source.ip), null)
102+
Esql.source_ip_network_alert_case = case(kibana.alert.rule.rule_id == "eb079c62-4481-4d6e-9643-3ca499df7aaa" and not event.dataset in ("o365.audit", "azure.signinlogs"), to_ip(source.ip), null)
103103
104104
// aggregate by source ip
105105
| stats
@@ -109,7 +109,7 @@ from logs-o365.audit-*, logs-azure.signinlogs-*, .alerts-security.*
109109
Esql.source_ip_network_alert_case_count_distinct = count_distinct(Esql.source_ip_network_alert_case),
110110
Esql.event_dataset_count_distinct = count_distinct(event.dataset),
111111
Esql.event_dataset_values = values(event.dataset),
112-
Esql.kibana_alert_rule_name_values = values(kibana.alert.rule.name),
112+
Esql.kibana_alert_rule_id_values = values(kibana.alert.rule.rule_id),
113113
Esql.event_category_values = values(event.category)
114114
by Esql.source_ip = to_ip(source.ip)
115115

rules/cross-platform/initial_access_execution_susp_react_serv_child.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/12/04"
33
integration = ["endpoint", "windows", "auditd_manager", "sentinel_one_cloud_funnel"]
44
maturity = "production"
5-
updated_date = "2025/12/08"
5+
updated_date = "2025/12/10"
66

77
[rule]
88
author = ["Elastic"]
@@ -101,12 +101,11 @@ process where event.type == "start" and event.action in ("exec", "executed", "st
101101
)
102102
and (
103103
?process.working_directory : (
104-
"*react-dom*", "*.next*", "*node_modules/next*", "*react-server*", "*bin/next*", "*--experimental-https*", "*app/server*",
105-
"*.pnpm/next*", "*/app/*", "*next/dist/server*", "*react-scripts*") or
104+
"*react-dom*", "*.next*", "*node_modules/next*", "*react-server*", "*bin/next*", "*.pnpm/next*", "*next/dist/server*", "*react-scripts*") or
106105
(
107106
process.parent.name in ("node", "bun", "node.exe", "bun.exe") and
108107
process.parent.command_line : (
109-
"*react-dom*", "*.next*", "*node_modules/next*", "*react-server*", "*next-server*", "*server.js*", "*bin/next*",
108+
"*react-dom*", "*.next*", "*node_modules/next*", "*react-server*", "*next-server*", "* server.js*", "*start-server.js*", "*bin/next*",
110109
"*--experimental-https*", "*app/server*", "*.pnpm/next*", "*next start*", "*next dev*", "*react-scripts start*", "*next/dist/server*"
111110
)
112111
)

rules/integrations/aws/impact_s3_object_encryption_with_external_key.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2024/07/02"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2025/12/02"
5+
updated_date = "2025/12/09"
66

77
[rule]
88
author = ["Elastic"]
@@ -201,7 +201,10 @@ from logs-aws.cloudtrail-* metadata _id, _version, _index
201201
Esql.aws_cloudtrail_request_parameters_target_bucket_name,
202202
Esql.aws_cloudtrail_request_parameters_target_object_key,
203203
Esql.aws_cloudtrail_request_parameters_kms_key_account_id,
204-
Esql.aws_cloudtrail_request_parameters_kms_key_id
204+
Esql.aws_cloudtrail_request_parameters_kms_key_id,
205+
_id,
206+
_version,
207+
_index
205208
'''
206209

207210

rules/integrations/aws/impact_s3_static_site_js_file_uploaded.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/04/15"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2025/10/28"
5+
updated_date = "2025/12/09"
66

77
[rule]
88
author = ["Elastic"]
@@ -113,7 +113,10 @@ from logs-aws.cloudtrail* metadata _id, _version, _index
113113
user_agent.original,
114114
source.ip,
115115
event.action,
116-
@timestamp
116+
@timestamp,
117+
_id,
118+
_version,
119+
_index
117120
'''
118121

119122

rules/integrations/aws/persistence_iam_user_created_access_keys_for_another_user.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2024/06/13"
33
integration = ["aws"]
44
maturity = "production"
5-
updated_date = "2025/10/13"
5+
updated_date = "2025/12/09"
66

77
[rule]
88
author = ["Elastic"]
@@ -156,7 +156,10 @@ from logs-aws.cloudtrail-* metadata _id, _version, _index
156156
aws.cloudtrail.user_identity.arn,
157157
aws.cloudtrail.user_identity.type,
158158
aws.cloudtrail.user_identity.access_key_id,
159-
source.geo.*
159+
source.geo.*,
160+
_id,
161+
_version,
162+
_index
160163
'''
161164

162165

rules/integrations/azure/collection_entra_auth_broker_sharepoint_access_for_user_principal.toml renamed to rules/integrations/azure/collection_entra_id_auth_broker_sharepoint_access_for_user_principal.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/05/01"
33
integration = ["azure"]
44
maturity = "production"
5-
updated_date = "2025/05/07"
5+
updated_date = "2025/12/10"
66

77
[rule]
88
author = ["Elastic"]
@@ -30,10 +30,10 @@ from = "now-9m"
3030
index = ["logs-azure.signinlogs-*"]
3131
language = "kuery"
3232
license = "Elastic License v2"
33-
name = "Microsoft Entra ID SharePoint Access for User Principal via Auth Broker"
33+
name = "Entra ID SharePoint Accessed by Unusual User and Microsoft Authentication Broker Client"
3434
note = """## Triage and analysis
3535
36-
### Investigating Microsoft Entra ID SharePoint Access for User Principal via Auth Broker
36+
### Investigating Entra ID SharePoint Accessed by Unusual User and Microsoft Authentication Broker Client
3737
3838
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.
3939

rules/integrations/azure/collection_graph_email_access_by_unusual_public_client_via_graph.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/05/06"
33
integration = ["azure"]
44
maturity = "production"
5-
updated_date = "2025/09/08"
5+
updated_date = "2025/12/10"
66

77
[rule]
88
author = ["Elastic"]
@@ -18,10 +18,10 @@ from = "now-9m"
1818
index = ["logs-azure.graphactivitylogs-*"]
1919
language = "kuery"
2020
license = "Elastic License v2"
21-
name = "Suspicious Email Access by First-Party Application via Microsoft Graph"
21+
name = "Microsoft Graph Request Email Access by Unusual User and Client"
2222
note = """## Triage and analysis
2323
24-
### Investigating Suspicious Email Access by First-Party Application via Microsoft Graph
24+
### Investigating Microsoft Graph Request Email Access by Unusual User and Client
2525
2626
This rule detects instances where a previously unseen or rare Microsoft Graph application client ID accesses email-related APIs, such as `/me/messages`, `/sendMail`, or `/mailFolders/inbox/messages`. These accesses are performed via delegated user credentials using common OAuth scopes like `Mail.Read`, `Mail.ReadWrite`, `Mail.Send`, or `email`. This activity may indicate unauthorized use of a newly consented or compromised application to read or exfiltrate mail content. This is a New Terms rule that only signals if the application ID (`azure.graphactivitylogs.properties.app_id`) and user principal object ID (`azure.graphactivitylogs.properties.user_principal_object_id`) have not been seen doing this activity in the last 14 days.
2727

rules/integrations/azure/credential_access_azure_entra_susp_device_code_signin.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
creation_date = "2025/12/02"
33
integration = ["azure"]
44
maturity = "production"
5-
updated_date = "2025/12/02"
5+
updated_date = "2025/12/10"
66

77
[rule]
88
author = ["Elastic"]
@@ -20,10 +20,10 @@ false_positives = [
2020
from = "now-9m"
2121
language = "esql"
2222
license = "Elastic License v2"
23-
name = "Suspicious Microsoft Entra ID Concurrent Sign-Ins via DeviceCode"
23+
name = "Entra ID OAuth Device Code Flow with Concurrent Sign-ins"
2424
note = """## Triage and analysis
2525
26-
### Investigating Suspicious Microsoft Entra ID Concurrent Sign-Ins via DeviceCode
26+
### Investigating Entra ID OAuth Device Code Flow with Concurrent Sign-ins
2727
2828
### Possible investigation steps
2929

0 commit comments

Comments
 (0)