Entra ID User Created or Deleted by Unusual UPN

Identifies the first time, within a lookback window, a user-initiated principal creates or deletes an Entra ID user ("Add user" / "Delete user"). Adversaries with compromised privileged identities create users for persistence or delete users for impact. This is a New Terms rule keyed on the initiating user principal; app/service-initiated lifecycle events (e.g. HR/SCIM provisioning) are intentionally out of scope.

Elastic rule (View on GitHub)

  1[metadata]
  2creation_date = "2026/11/12"
  3integration = ["azure"]
  4maturity = "production"
  5updated_date = "2026/11/12"
  6
  7[rule]
  8author = ["Elastic"]
  9description = """
 10Identifies 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
 12users for impact. This is a New Terms rule keyed on the initiating user principal; app/service-initiated lifecycle
 13events (e.g. HR/SCIM provisioning) are intentionally out of scope.
 14"""
 15false_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]
 21from = "now-9m"
 22index = ["logs-azure.auditlogs-*"]
 23language = "kuery"
 24license = "Elastic License v2"
 25name = "Entra ID User Created or Deleted by Unusual UPN"
 26note = """## 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
 33Creating 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"""
 49references = [
 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]
 53risk_score = 21
 54rule_id = "0de31097-38c4-48df-9320-c39dc3253bb6"
 55severity = "low"
 56tags = [
 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]
 68timestamp_override = "event.ingested"
 69type = "new_terms"
 70
 71query = '''
 72data_stream.dataset: "azure.auditlogs"
 73    and event.action: ("Add user" or "Delete user")
 74    and event.outcome: "success"
 75'''
 76
 77
 78[[rule.threat]]
 79framework = "MITRE ATT&CK"
 80[[rule.threat.technique]]
 81id = "T1136"
 82name = "Create Account"
 83reference = "https://attack.mitre.org/techniques/T1136/"
 84[[rule.threat.technique.subtechnique]]
 85id = "T1136.003"
 86name = "Cloud Account"
 87reference = "https://attack.mitre.org/techniques/T1136/003/"
 88
 89
 90[rule.threat.tactic]
 91id = "TA0003"
 92name = "Persistence"
 93reference = "https://attack.mitre.org/tactics/TA0003/"
 94
 95[[rule.threat]]
 96framework = "MITRE ATT&CK"
 97[[rule.threat.technique]]
 98id = "T1531"
 99name = "Account Access Removal"
100reference = "https://attack.mitre.org/techniques/T1531/"
101
102[rule.threat.tactic]
103id = "TA0040"
104name = "Impact"
105reference = "https://attack.mitre.org/tactics/TA0040/"
106
107[rule.investigation_fields]
108field_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]
121field = "new_terms_fields"
122value = ["cloud.account.id", "azure.auditlogs.properties.initiated_by.user.userPrincipalName"]
123[[rule.new_terms.history_window_start]]
124field = "history_window_start"
125value = "now-10d"

Triage and analysis

Disclaimer: 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.

Investigating Entra ID User Created or Deleted by Unusual UPN

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.

Possible investigation steps

  • Confirm the initiating principal (azure.auditlogs.properties.initiated_by.user.userPrincipalName) and whether user lifecycle management is expected for it.
  • Review the target user (azure.auditlogs.properties.target_resources.0.user_principal_name) and the modified properties.
  • Correlate with role assignments, credential additions, or sign-ins involving the created account.

False positive analysis

  • Human IT/IGA admins performing routine provisioning; add exceptions by initiator UPN. App/SCIM-initiated events are already excluded (they carry no initiator UPN).

Response and remediation

  • If unauthorized, disable/remove the created account or restore the deleted one, review follow-on activity, and rotate the initiator's credentials.

References

Related rules

to-top