You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Rule Tuning] Excluding Microsoft Entra ID Service Principal Addition Invoked by MSFT Identity (#4700)
* tuning rule to exclude service principals added by MSFT
* added additional exclusions
* updated rule name and file name
* updated investigation guide and mitre
Copy file name to clipboardExpand all lines: rules/integrations/azure/persistence_entra_service_principal_created.toml
+35-24Lines changed: 35 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,15 @@
2
2
creation_date = "2020/12/14"
3
3
integration = ["azure"]
4
4
maturity = "production"
5
-
updated_date = "2024/05/21"
5
+
updated_date = "2025/05/05"
6
6
7
7
[rule]
8
8
author = ["Elastic"]
9
9
description = """
10
-
Identifies when a new service principal is added in Azure. An application, hosted service, or automated tool that
11
-
accesses or modifies resources needs an identity created. This identity is known as a service principal. For security
12
-
reasons, it's always recommended to use service principals with automated tools rather than allowing them to log in with
13
-
a user identity.
10
+
Identifies when a new service principal is added in Microsoft Entra ID. An application, hosted service, or automated
11
+
tool that accesses or modifies resources needs an identity created. This identity is known as a service principal. For
12
+
security reasons, it's always recommended to use service principals with automated tools rather than allowing them to
13
+
log in with a user identity.
14
14
"""
15
15
false_positives = [
16
16
"""
@@ -19,14 +19,14 @@ false_positives = [
19
19
or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
20
20
""",
21
21
]
22
-
from = "now-25m"
23
-
index = ["filebeat-*", "logs-azure*"]
22
+
from = "now-9m"
23
+
index = ["filebeat-*", "logs-azure.auditlogs-*"]
24
24
language = "kuery"
25
25
license = "Elastic License v2"
26
-
name = "Azure Service Principal Addition"
26
+
name = "Microsoft Entra ID Service Principal Created"
27
27
note = """## Triage and analysis
28
28
29
-
### Investigating Azure Service Principal Addition
29
+
### Investigating Microsoft Entra ID Service Principal Created
30
30
31
31
Service Principals are identities used by applications, services, and automation tools to access specific resources. They grant specific access based on the assigned API permissions. Most organizations that work a lot with Azure AD make use of service principals. Whenever an application is registered, it automatically creates an application object and a service principal in an Azure AD tenant.
32
32
@@ -63,47 +63,58 @@ If this rule is noisy in your environment due to expected activity, consider add
63
63
- Follow security best practices [outlined](https://docs.microsoft.com/en-us/azure/security/fundamentals/identity-management-best-practices) by Microsoft.
64
64
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
65
65
- 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).
66
-
67
-
## Setup
68
-
69
-
The Azure Fleet integration, Filebeat module, or similarly structured data is required to be compatible with this rule."""
This rule requires the Azure integration with Microsoft Entra ID Audit Logs data stream ingesting in your Elastic Stack deployment. For more information, refer to the [Microsoft Entra ID Audit Logs integration documentation](https://www.elastic.co/docs/reference/integrations/azure/adlogs).
75
+
"""
76
76
severity = "low"
77
77
tags = [
78
78
"Domain: Cloud",
79
79
"Data Source: Azure",
80
+
"Data Source: Microsoft Entra ID",
81
+
"Data Source: Microsoft Entra ID Audit Logs",
80
82
"Use Case: Identity and Access Audit",
81
83
"Resources: Investigation Guide",
82
-
"Tactic: Defense Evasion",
84
+
"Tactic: Persistence",
83
85
]
84
86
timestamp_override = "event.ingested"
85
87
type = "query"
86
88
87
89
query = '''
88
-
event.dataset:azure.auditlogs and azure.auditlogs.operation_name:"Add service principal" and event.outcome:(success or Success)
90
+
event.dataset:azure.auditlogs
91
+
and azure.auditlogs.operation_name:"Add service principal"
92
+
and event.outcome:(success or Success)
93
+
and not azure.auditlogs.identity: (
94
+
"Managed Service Identity" or
95
+
"Windows Azure Service Management API" or
96
+
"Microsoft Azure AD Internal - Jit Provisioning" or
0 commit comments