Skip to content

Commit a34a26d

Browse files
[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
1 parent 0cd7de6 commit a34a26d

File tree

1 file changed

+35
-24
lines changed

1 file changed

+35
-24
lines changed

rules/integrations/azure/defense_evasion_azure_service_principal_addition.toml renamed to rules/integrations/azure/persistence_entra_service_principal_created.toml

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
creation_date = "2020/12/14"
33
integration = ["azure"]
44
maturity = "production"
5-
updated_date = "2024/05/21"
5+
updated_date = "2025/05/05"
66

77
[rule]
88
author = ["Elastic"]
99
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.
1414
"""
1515
false_positives = [
1616
"""
@@ -19,14 +19,14 @@ false_positives = [
1919
or hosts should be investigated. If known behavior is causing false positives, it can be exempted from the rule.
2020
""",
2121
]
22-
from = "now-25m"
23-
index = ["filebeat-*", "logs-azure*"]
22+
from = "now-9m"
23+
index = ["filebeat-*", "logs-azure.auditlogs-*"]
2424
language = "kuery"
2525
license = "Elastic License v2"
26-
name = "Azure Service Principal Addition"
26+
name = "Microsoft Entra ID Service Principal Created"
2727
note = """## Triage and analysis
2828
29-
### Investigating Azure Service Principal Addition
29+
### Investigating Microsoft Entra ID Service Principal Created
3030
3131
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.
3232
@@ -63,47 +63,58 @@ If this rule is noisy in your environment due to expected activity, consider add
6363
- Follow security best practices [outlined](https://docs.microsoft.com/en-us/azure/security/fundamentals/identity-management-best-practices) by Microsoft.
6464
- Determine the initial vector abused by the attacker and take action to prevent reinfection via the same vector.
6565
- 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."""
66+
"""
7067
references = [
7168
"https://msrc-blog.microsoft.com/2020/12/13/customer-guidance-on-recent-nation-state-cyber-attacks/",
7269
"https://docs.microsoft.com/en-us/azure/active-directory/develop/howto-create-service-principal-portal",
7370
]
7471
risk_score = 21
7572
rule_id = "60b6b72f-0fbc-47e7-9895-9ba7627a8b50"
73+
setup = """### Microsft Entra ID Audit Logs
74+
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+
"""
7676
severity = "low"
7777
tags = [
7878
"Domain: Cloud",
7979
"Data Source: Azure",
80+
"Data Source: Microsoft Entra ID",
81+
"Data Source: Microsoft Entra ID Audit Logs",
8082
"Use Case: Identity and Access Audit",
8183
"Resources: Investigation Guide",
82-
"Tactic: Defense Evasion",
84+
"Tactic: Persistence",
8385
]
8486
timestamp_override = "event.ingested"
8587
type = "query"
8688

8789
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
97+
"AAD App Management" or
98+
"Power Virtual Agents Service"
99+
)
89100
'''
90101

91102

92103
[[rule.threat]]
93104
framework = "MITRE ATT&CK"
94105
[[rule.threat.technique]]
95-
id = "T1550"
96-
name = "Use Alternate Authentication Material"
97-
reference = "https://attack.mitre.org/techniques/T1550/"
106+
id = "T1136"
107+
name = "Create Account"
108+
reference = "https://attack.mitre.org/techniques/T1136/"
98109
[[rule.threat.technique.subtechnique]]
99-
id = "T1550.001"
100-
name = "Application Access Token"
101-
reference = "https://attack.mitre.org/techniques/T1550/001/"
110+
id = "T1136.003"
111+
name = "Cloud Account"
112+
reference = "https://attack.mitre.org/techniques/T1136/003/"
102113

103114

104115

105116
[rule.threat.tactic]
106-
id = "TA0005"
107-
name = "Defense Evasion"
108-
reference = "https://attack.mitre.org/tactics/TA0005/"
117+
id = "TA0003"
118+
name = "Persistence"
119+
reference = "https://attack.mitre.org/tactics/TA0003/"
109120

0 commit comments

Comments
 (0)