Detection rules › Panther
Azure Invite External Users
This detection looks for a Azure users inviting external users
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Initial Access | T1078 Valid Accounts |
Rule body yaml
AnalysisType: rule
Filename: azure_invite_external_users.py
RuleID: "Azure.Audit.InviteExternalUsers"
DisplayName: "Azure Invite External Users"
Enabled: true
LogTypes:
- Azure.Audit
Severity: Low
Description: >
This detection looks for a Azure users inviting external users
Reports:
MITRE ATT&CK:
- TA0001:T1078
Runbook: >
Verify the user permissions and investigate the external user details. If unauthorized, revoke access and block further invites. Update security policies.
Reference: https://learn.microsoft.com/en-us/entra/identity/authentication/overview-authentication
SummaryAttributes:
- properties:ServicePrincipalName
- properties:UserPrincipalName
- properties:initiatedBy:user:ipAddress
Tests:
- Name: Successful Invite external user
ExpectedResult: true
Log:
{
"callerIpAddress": "1.1.1.1",
"category": "AuditLogs",
"correlationId": "123456789",
"durationMs": 0,
"Level": "4",
"operationName": "Invite external user",
"operationVersion": "1.0",
"properties": {
"activityDateTime": "2024-09-23 14:33:09.049661100",
"activityDisplayName": "Invite external user",
"additionalDetails": [
{
"key": "oid",
"value": "123456789"
},
{
"key": "tid",
"value": "0123456789"
},
{
"key": "ipaddr",
"value": "1.2.3.4"
},
{
"key": "wids",
"value": "123456789"
},
{
"key": "InvitationId",
"value": "123456789"
},
{
"key": "invitedUserEmailAddress",
"value": "john@justice.org"
}
],
"category": "UserManagement",
"correlationId": "123456789",
"id": "Invited Users_123456789",
"initiatedBy": {
"user": {
"id": "123456789",
"ipAddress": "1.2.3.4",
"roles": [],
"userPrincipalName": "denethor@lotr.com"
}
},
"loggedByService": "Invited Users",
"operationType": "Add",
"result": "success",
"targetResources": [
{
"administrativeUnits": [],
"displayName": "Zeus.Theboss",
"id": "123456789",
"type": "User"
}
]
},
"resourceId": "/tenants/123456789/providers/Microsoft.aadiam",
"resultSignature": "None",
"tenantId": "123456789",
"time": "2024-12-10 14:33:09.049661100"
}
- Name: Same org successful invite
ExpectedResult: false
Log:
{
"callerIpAddress": "1.1.1.1",
"category": "AuditLogs",
"correlationId": "123456789",
"durationMs": 0,
"Level": "4",
"operationName": "Invite external user",
"operationVersion": "1.0",
"properties": {
"activityDateTime": "2024-09-23 14:33:09.049661100",
"activityDisplayName": "Invite external user",
"additionalDetails": [
{
"key": "oid",
"value": "123456789"
},
{
"key": "tid",
"value": "0123456789"
},
{
"key": "ipaddr",
"value": "1.2.3.4"
},
{
"key": "wids",
"value": "123456789"
},
{
"key": "InvitationId",
"value": "123456789"
},
{
"key": "invitedUserEmailAddress",
"value": "aragorn@lotr.com"
}
],
"category": "UserManagement",
"correlationId": "123456789",
"id": "Invited Users_123456789",
"initiatedBy": {
"user": {
"id": "123456789",
"ipAddress": "1.2.3.4",
"roles": [],
"userPrincipalName": "denethor@lotr.com"
}
},
"loggedByService": "Invited Users",
"operationType": "Add",
"result": "success",
"targetResources": [
{
"administrativeUnits": [],
"displayName": "Zeus.Theboss",
"id": "123456789",
"type": "User"
}
]
},
"resourceId": "/tenants/123456789/providers/Microsoft.aadiam",
"resultSignature": "None",
"tenantId": "123456789",
"time": "2024-12-10 14:33:09.049661100"
}
- Name: Unsuccessful invite
ExpectedResult: false
Log:
{
"callerIpAddress": "1.1.1.1",
"category": "AuditLogs",
"correlationId": "123456789",
"durationMs": 0,
"Level": "4",
"operationName": "Invite external user",
"operationVersion": "1.0",
"properties": {
"activityDateTime": "2024-09-23 14:33:09.049661100",
"activityDisplayName": "Invite external user",
"additionalDetails": [
{
"key": "oid",
"value": "123456789"
},
{
"key": "tid",
"value": "0123456789"
},
{
"key": "ipaddr",
"value": "1.2.3.4"
},
{
"key": "wids",
"value": "123456789"
},
{
"key": "InvitationId",
"value": "123456789"
},
{
"key": "invitedUserEmailAddress",
"value": "aragorn@lotr.com"
}
],
"category": "UserManagement",
"correlationId": "123456789",
"id": "Invited Users_123456789",
"initiatedBy": {
"user": {
"id": "123456789",
"ipAddress": "1.2.3.4",
"roles": [],
"userPrincipalName": "denethor@lotr.com"
}
},
"loggedByService": "Invited Users",
"operationType": "Add",
"result": "failed",
"targetResources": [
{
"administrativeUnits": [],
"displayName": "Zeus.Theboss",
"id": "123456789",
"type": "User"
}
]
},
"resourceId": "/tenants/123456789/providers/Microsoft.aadiam",
"resultSignature": "None",
"tenantId": "123456789",
"time": "2024-12-10 14:33:09.049661100"
}
- Name: Not external invite
ExpectedResult: false
Log:
{
"callerIpAddress": "1.1.1.1",
"category": "AuditLogs",
"correlationId": "123456789",
"durationMs": 0,
"Level": "4",
"operationName": "Invite Internal User",
"operationVersion": "1.0",
"properties": {
"activityDateTime": "2024-09-23 14:33:09.049661100",
"activityDisplayName": "Invite external user",
"additionalDetails": [
{
"key": "oid",
"value": "123456789"
},
{
"key": "tid",
"value": "0123456789"
},
{
"key": "ipaddr",
"value": "1.2.3.4"
},
{
"key": "wids",
"value": "123456789"
},
{
"key": "InvitationId",
"value": "123456789"
},
{
"key": "invitedUserEmailAddress",
"value": "Kratos@mtolympus.com"
}
],
"category": "UserManagement",
"correlationId": "123456789",
"id": "Invited Users_123456789",
"initiatedBy": {
"user": {
"id": "123456789",
"ipAddress": "1.2.3.4",
"roles": [],
"userPrincipalName": "Zeus@mtolympus.com"
}
},
"loggedByService": "Invited Users",
"operationType": "Add",
"result": "success",
"targetResources": [
{
"administrativeUnits": [],
"displayName": "Zeus.Theboss",
"id": "123456789",
"type": "User"
}
]
},
"resourceId": "/tenants/123456789/providers/Microsoft.aadiam",
"resultSignature": "None",
"tenantId": "123456789",
"time": "2024-12-10 14:33:09.049661100"
}
Detection logic
Condition
not (properties.result ne "success" or operationName ne "Invite external user")
This rule also runs imperative logic the parser cannot express as a filter; the conditions above are the structured part it could extract.
Exclusions
Top-level NOT(...) conjuncts: predicates this rule actively suppresses.
| Field | Kind | Excluded values |
|---|---|---|
operationName | ne | Invite external user |
properties.result | ne | success |
Output fields
Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.
| Field | Source |
|---|---|
operationName | |
category | properties.category |
actor_id | properties.initiatedBy.user.id |
actor_upn | properties.initiatedBy.user.userPrincipalName |
source_ip_address | properties.initiatedBy.user.ipAddress |
target_id | properties.targetResources.id |
target_name | properties.targetResources.displayName |
value | properties.additionalDetails.value |