Skip to content

Commit a55db01

Browse files
[New Rule] Entra ID User Created or Deleted by Rare Identity (#7173)
* [New Rule] Entra ID User Created or Deleted by Rare Identity * Apply batched suggestions from code review Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com> * Update and rename persistence_entra_user_created_or_deleted_by_rare_identity.toml to persistence_entra_user_created_or_deleted_by_unusual_upn.toml * Update persistence_entra_user_created_or_deleted_by_unusual_upn.toml * Add disclaimer to Entra ID user operations guide Added disclaimer about the use of generative AI technology in the investigation guide. --------- Co-authored-by: Terrance DeJesus <99630311+terrancedejesus@users.noreply.github.com>
1 parent 7b1693d commit a55db01

1 file changed

Lines changed: 125 additions & 0 deletions

File tree

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
[metadata]
2+
creation_date = "2026/11/12"
3+
integration = ["azure"]
4+
maturity = "production"
5+
updated_date = "2026/11/12"
6+
7+
[rule]
8+
author = ["Elastic"]
9+
description = """
10+
Identifies the first time, within a lookback window, a user-initiated principal creates or deletes an Entra ID user
11+
("Add user" / "Delete user"). Adversaries with compromised privileged identities create users for persistence or delete
12+
users for impact. This is a New Terms rule keyed on the initiating user principal; app/service-initiated lifecycle
13+
events (e.g. HR/SCIM provisioning) are intentionally out of scope.
14+
"""
15+
false_positives = [
16+
"""
17+
IT administrators and IGA tooling create and delete users as part of normal operations. The New Terms logic baselines
18+
known human initiators; a newly seen initiating user warrants review.
19+
""",
20+
]
21+
from = "now-9m"
22+
index = ["logs-azure.auditlogs-*"]
23+
language = "kuery"
24+
license = "Elastic License v2"
25+
name = "Entra ID User Created or Deleted by Unusual UPN"
26+
note = """## Triage and analysis
27+
28+
> **Disclaimer**:
29+
> This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs.
30+
31+
### Investigating Entra ID User Created or Deleted by Unusual UPN
32+
33+
Creating or deleting directory users are high-impact identity operations: creation supports persistence (backdoor accounts), deletion supports impact/evasion. This rule flags the first time a given user principal performs either in the history window.
34+
35+
### Possible investigation steps
36+
37+
- Confirm the initiating principal (`azure.auditlogs.properties.initiated_by.user.userPrincipalName`) and whether user lifecycle management is expected for it.
38+
- Review the target user (`azure.auditlogs.properties.target_resources.0.user_principal_name`) and the modified properties.
39+
- Correlate with role assignments, credential additions, or sign-ins involving the created account.
40+
41+
### False positive analysis
42+
43+
- Human IT/IGA admins performing routine provisioning; add exceptions by initiator UPN. App/SCIM-initiated events are already excluded (they carry no initiator UPN).
44+
45+
### Response and remediation
46+
47+
- If unauthorized, disable/remove the created account or restore the deleted one, review follow-on activity, and rotate the initiator's credentials.
48+
"""
49+
references = [
50+
"https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1136.003/T1136.003.md",
51+
"https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1531/T1531.md",
52+
]
53+
risk_score = 21
54+
rule_id = "0de31097-38c4-48df-9320-c39dc3253bb6"
55+
severity = "low"
56+
tags = [
57+
"Domain: Cloud",
58+
"Data Source: Azure",
59+
"Data Source: Microsoft Entra ID Audit Logs",
60+
"Domain: Identity",
61+
"Platform: Azure",
62+
"Platform: Entra ID",
63+
"Tactic: Persistence",
64+
"Tactic: Impact",
65+
"Rule Type: New Terms",
66+
"Resources: Investigation Guide"
67+
]
68+
timestamp_override = "event.ingested"
69+
type = "new_terms"
70+
71+
query = '''
72+
data_stream.dataset: "azure.auditlogs"
73+
and event.action: ("Add user" or "Delete user")
74+
and event.outcome: "success"
75+
'''
76+
77+
78+
[[rule.threat]]
79+
framework = "MITRE ATT&CK"
80+
[[rule.threat.technique]]
81+
id = "T1136"
82+
name = "Create Account"
83+
reference = "https://attack.mitre.org/techniques/T1136/"
84+
[[rule.threat.technique.subtechnique]]
85+
id = "T1136.003"
86+
name = "Cloud Account"
87+
reference = "https://attack.mitre.org/techniques/T1136/003/"
88+
89+
90+
[rule.threat.tactic]
91+
id = "TA0003"
92+
name = "Persistence"
93+
reference = "https://attack.mitre.org/tactics/TA0003/"
94+
95+
[[rule.threat]]
96+
framework = "MITRE ATT&CK"
97+
[[rule.threat.technique]]
98+
id = "T1531"
99+
name = "Account Access Removal"
100+
reference = "https://attack.mitre.org/techniques/T1531/"
101+
102+
[rule.threat.tactic]
103+
id = "TA0040"
104+
name = "Impact"
105+
reference = "https://attack.mitre.org/tactics/TA0040/"
106+
107+
[rule.investigation_fields]
108+
field_names = [
109+
"@timestamp",
110+
"azure.auditlogs.properties.initiated_by.user.userPrincipalName",
111+
"azure.auditlogs.identity",
112+
"azure.auditlogs.properties.target_resources.0.user_principal_name",
113+
"event.action",
114+
"event.outcome",
115+
"source.ip",
116+
"source.as.organization.name",
117+
"cloud.account.id",
118+
]
119+
120+
[rule.new_terms]
121+
field = "new_terms_fields"
122+
value = ["cloud.account.id", "azure.auditlogs.properties.initiated_by.user.userPrincipalName"]
123+
[[rule.new_terms.history_window_start]]
124+
field = "history_window_start"
125+
value = "now-10d"

0 commit comments

Comments
 (0)