Skip to content

Commit

Permalink
O365 - parse email for external users
Browse files Browse the repository at this point in the history
  • Loading branch information
lvoloshyn-sekoia committed Dec 11, 2024
1 parent 27fe310 commit 2fd4878
Show file tree
Hide file tree
Showing 56 changed files with 64 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Office 365/o365/_meta/fields.yml
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,11 @@ office365.user_type.code:
name: office365.user_type.code
type: long

office365.user_type.is_external:
description: Whether user is external
name: office365.user_type.is_external
type: boolean

office365.user_type.name:
description: The translated type of the user that performed the operation
name: office365.user_type.name
Expand Down
7 changes: 5 additions & 2 deletions Office 365/o365/ingest/parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ stages:
event.action: "{{json_event.message.Operation}}"
event.code: "{{json_event.message.RecordType | string}}"
event.reason: "{{json_event.message.ActionName}}"
user.name: "{{json_event.message.UserId}}"
user.name: "{{json_event.message.UserId.removeprefix('urn:spo:guest#')}}"
user.id: "{{json_event.message.UserKey}}"
organization.id: "{{json_event.message.OrganizationId}}"
action.id: "{{json_event.message.RecordType}}"
Expand All @@ -89,9 +89,12 @@ stages:
filter: "{{parse_client_ip.result.ip | is_ipaddress}}"

- set:
user.email: "{{json_event.message.UserId}}"
user.email: "{{json_event.message.UserId.removeprefix('urn:spo:guest#')}}"
filter: '{{"@" in json_event.message.UserId}}'

- set:
office365.user_type.is_external: "{{'urn:spo:guest#' in json_event.message.UserId}}"

- set:
source.ip: "{{parse_client_ip_address.result.ip}}"
source.port: "{{parse_client_ip_address.result.port}}"
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/ad.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/ad_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"result_status": "Success",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/add_member_to_role.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"result_status": "Success",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"record_type": 64,
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"record_type": 64,
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
"record_type": 64,
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"record_type": 64,
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"record_type": 64,
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/browser_log.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"record_type": 36,
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/clientipadress.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 5,
"is_external": false,
"name": "Application"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/compliancemanager-scorechange.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"result_status": "Successful",
"user_type": {
"code": 2,
"is_external": false,
"name": "Admin"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/email_reported.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/exchange_event1.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/exchange_item_aggregated.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/exchange_item_group.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/exchange_item_group_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/exchange_item_update.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/file_previewed.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"record_type": 6,
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/file_size.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"record_type": 6,
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/file_sync_download_full.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"record_type": 6,
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/file_visited.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"result_status": "TRUE",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/form_log.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
},
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/inbox_rule.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"result_status": "True",
"user_type": {
"code": 2,
"is_external": false,
"name": "Admin"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/managed_sync.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"record_type": 4,
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/mass_download.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/mcas_alert.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"result_status": "New",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"record_type": 47,
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"record_type": 28,
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"record_type": 41,
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/operation_properties_01.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/operation_properties_02.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/power_bi.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"record_type": 20,
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/remove_member_from_role.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"result_status": "Success",
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/security_compliance_alert.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/security_compliance_alert_2.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/security_compliance_alert_3.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/security_compliance_alert_4.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/security_compliance_alert_5.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/security_compliance_alert_7.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"result_status": "Succeeded",
"user_type": {
"code": 4,
"is_external": false,
"name": "System"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/source_log.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"record_type": 14,
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/targetusername.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"record_type": 14,
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/teams_message_has_link.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
},
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
1 change: 1 addition & 0 deletions Office 365/o365/tests/teams_with_foreign_tenant_users.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
},
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
},
"user_type": {
"code": 0,
"is_external": false,
"name": "Regular"
}
},
Expand Down
Loading

0 comments on commit 2fd4878

Please sign in to comment.