Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 26 additions & 31 deletions Solutions/Box/Analytic Rules/BoxAbnormalUserActivity.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
id: 1139230c-cf10-45db-b616-fed0d1415c05
name: Box - Abmormal user activity
name: Box - Abnormal user activity
description: |
'Detects spikes (deviations from avarage) in user activity.'
'Identifies users whose Box activity in the last hour is well above their own hourly average over the previous 14 days.'
severity: Medium
status: Available
requiredDataConnectors:
Expand All @@ -17,38 +17,33 @@ tactics:
relevantTechniques:
- T1530
query: |
let lbperiod_start = 14d;
let lbperiod_end = 24h;
let user_actions_1 = BoxEvents
| where EventEndTime between (ago(lbperiod_start) .. ago(lbperiod_end))
| summarize TotalEvents = count() by SourceName
| project TotalEvents, User = SourceName;
let user_actions_2 = BoxEvents
| where EventEndTime between (ago(lbperiod_start) .. ago(lbperiod_end))
| summarize TotalEvents = count() by SrcUserName
| project TotalEvents, User = SrcUserName;
let TotalActions = (union user_actions_1, user_actions_2)
| summarize TotalEvents = count() by User
| extend EventsPerDay = TotalEvents / 29
| extend k = 1;
let actions1_last_h = BoxEvents
| summarize TotalEventsH = count() by SourceName
| project TotalEventsH, User = SourceName;
let actions2_last_h = BoxEvents
| summarize TotalEventsH = count() by SourceName
| project TotalEventsH, User = SourceName;
let TotalActionsLastHour = (union actions1_last_h, actions2_last_h)
| summarize TotalEventsH = sum(TotalEventsH) by User
| extend k = 1;
TotalActions
| join (TotalActionsLastHour) on k
| where EventsPerDay > TotalEventsH
| project User
| extend AccountCustomEntity = User
let lookback = 14d;
let recent = 1h;
let min_events = 50;
let stdev_factor = 3;
BoxEvents
| where EventEndTime between (ago(lookback) .. now())
| where isnotempty(SrcUserUpn)
// hourly buckets are aligned to the run time, so the newest bucket is the last hour
| summarize Events = count(), SrcUserName = take_any(SrcUserName) by SrcUserUpn, Hour = bin_at(EventEndTime, recent, now())
| extend IsLastHour = Hour >= ago(recent)
// the baseline is the average over the earlier hours in which the user was active
| summarize EventsLastHour = sumif(Events, IsLastHour),
BaselineHours = countif(not(IsLastHour)),
BaselineAvg = avgif(Events, not(IsLastHour)),
BaselineStdev = stdevif(Events, not(IsLastHour)),
SrcUserName = take_any(SrcUserName)
by SrcUserUpn
// no earlier activity means no baseline, and one earlier hour has no spread, so use zero for both
| extend BaselineAvg = iff(BaselineHours == 0, 0.0, BaselineAvg),
BaselineStdev = iff(BaselineHours < 2, 0.0, BaselineStdev)
| where EventsLastHour >= min_events and EventsLastHour > BaselineAvg + stdev_factor * BaselineStdev
| project SrcUserUpn, SrcUserName, EventsLastHour, BaselineAvg = round(BaselineAvg, 2), BaselineStdev = round(BaselineStdev, 2), BaselineHours
| extend AccountCustomEntity = SrcUserUpn
entityMappings:
- entityType: Account
fieldMappings:
- identifier: FullName
columnName: AccountCustomEntity
version: 1.0.1
version: 1.0.2
kind: Scheduled
127 changes: 85 additions & 42 deletions Solutions/Box/Data Connectors/BoxEvents_ccp/BoxEvents_table.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,174 +7,217 @@
"properties": {
"schema": {
"name": "BoxEventsV2_CL",
"description": "Box enterprise events (admin_logs stream) collected from the Box Events API by the Box Events (via Codeless Connector Framework) data connector.",
"columns": [
{
"name": "additional_details",
"type": "dynamic"
"type": "dynamic",
"description": "Additional details about the event when Box provides them, such as how the user performed the action. Content depends on the event type."
},
{
"name": "created_at",
"type": "datetime"
"type": "datetime",
"description": "Date and time when Box created the event object."
},
{
"name": "recorded_at",
"type": "datetime"
"type": "datetime",
"description": "Date and time when Box recorded the event in its database."
},
{
"name": "event_id",
"type": "string"
"type": "string",
"description": "Unique ID of the Box event. Can be used to detect duplicate events."
},
{
"name": "event_type",
"type": "string"
"type": "string",
"description": "Box event type, for example LOGIN, UPLOAD, DOWNLOAD or COLLABORATION_INVITE."
},
{
"name": "ip_address",
"type": "string"
"type": "string",
"description": "IP address that Box recorded for the event."
},
{
"name": "session_id",
"type": "dynamic"
"type": "dynamic",
"description": "Session of the user who performed the action. Not set on every event."
},
{
"name": "TimeGenerated",
"type": "datetime"
"type": "datetime",
"description": "Time of the event, set from created_at by the data collection rule."
},
{
"name": "event_category",
"type": "string"
"type": "string",
"description": "Object type of the Box event record (the event's type field), normally event."
},
{
"name": "source_user_email",
"type": "string"
"type": "string",
"description": "User email address from the event source (source.user_email), when present."
},
{
"name": "source_file_id",
"type": "string"
"type": "string",
"description": "ID of the file from the event source (source.file_id), when present."
},
{
"name": "source_file_name",
"type": "string"
"type": "string",
"description": "Name of the file from the event source (source.file_name), when present."
},
{
"name": "source_parent_name",
"type": "string"
"type": "string",
"description": "Name of the parent folder of the item that triggered the event (source.parent.name)."
},
{
"name": "source_item_type",
"type": "string"
"type": "string",
"description": "Type of the item that triggered the event, for example file or folder (source.item_type)."
},
{
"name": "source_item_id",
"type": "string"
"type": "string",
"description": "ID of the item that triggered the event (source.item_id)."
},
{
"name": "source_item_name",
"type": "string"
"type": "string",
"description": "Name of the item that triggered the event (source.item_name)."
},
{
"name": "source_parent_type",
"type": "string"
"type": "string",
"description": "Type of the parent of the item that triggered the event, usually folder (source.parent.type)."
},
{
"name": "source_parent_id",
"type": "string"
"type": "string",
"description": "ID of the parent folder of the item that triggered the event (source.parent.id)."
},
{
"name": "source_owned_by_type",
"type": "string"
"type": "string",
"description": "Type of the owner of the item that triggered the event, usually user (source.owned_by.type)."
},
{
"name": "source_owned_by_id",
"type": "string"
"type": "string",
"description": "Box user ID of the owner of the item that triggered the event (source.owned_by.id)."
},
{
"name": "source_owned_by_name",
"type": "string"
"type": "string",
"description": "Display name of the owner of the item that triggered the event (source.owned_by.name)."
},
{
"name": "source_owned_by_login",
"type": "string"
"type": "string",
"description": "Login (email address) of the owner of the item that triggered the event (source.owned_by.login)."
},
{
"name": "created_by_type",
"type": "string"
"type": "string",
"description": "Type of the actor who performed the action, usually user (created_by.type)."
},
{
"name": "created_by_id",
"type": "string"
"type": "string",
"description": "Box user ID of the user who performed the action (created_by.id). Box uses ID 2 for users who were not logged in."
},
{
"name": "created_by_name",
"type": "string"
"type": "string",
"description": "Display name of the user who performed the action (created_by.name)."
},
{
"name": "created_by_login",
"type": "string"
"type": "string",
"description": "Login (email address) of the user who performed the action (created_by.login)."
},
{
"name": "source_type",
"type": "string"
"type": "string",
"description": "Type of the object that triggered the event when the source is a Box object such as a user (source.type)."
},
{
"name": "source_id",
"type": "string"
"type": "string",
"description": "ID of the object that triggered the event (source.id)."
},
{
"name": "source_name",
"type": "string"
"type": "string",
"description": "Name of the object that triggered the event (source.name)."
},
{
"name": "source_login",
"type": "string"
"type": "string",
"description": "Login (email address) of the user that triggered the event when the source is a user (source.login)."
},
{
"name": "source_folder_id",
"type": "string"
"type": "string",
"description": "ID of the folder from the event source (source.folder_id), when present."
},
{
"name": "source_folder_name",
"type": "string"
"type": "string",
"description": "Name of the folder from the event source (source.folder_name), when present."
},
{
"name": "source_user_id",
"type": "string"
"type": "string",
"description": "User ID from the event source (source.user_id), when present."
},
{
"name": "source_user_name",
"type": "string"
"type": "string",
"description": "User name from the event source (source.user_name), when present."
},
{
"name": "accessible_by_type",
"type": "string"
"type": "string",
"description": "Type of the user or group that the event's access applies to, for example an invited collaborator (accessible_by.type)."
},
{
"name": "accessible_by_id",
"type": "string"
"type": "string",
"description": "ID of the user or group that the event's access applies to (accessible_by.id)."
},
{
"name": "accessible_by_name",
"type": "string"
"type": "string",
"description": "Name of the user or group that the event's access applies to (accessible_by.name)."
},
{
"name": "accessible_by_login",
"type": "string"
"type": "string",
"description": "Login (email address) of the user that the event's access applies to (accessible_by.login)."
},
{
"name": "source_classification_name",
"type": "string"
"type": "string",
"description": "Name of the classification label applied to the item that triggered the event (source.classification.name)."
},
{
"name": "source_classification_color",
"type": "string"
"type": "string",
"description": "Color of the classification label applied to the item that triggered the event (source.classification.color)."
},
{
"name": "source_classification_definition",
"type": "string"
"type": "string",
"description": "Definition text of the classification label applied to the item that triggered the event (source.classification.definition)."
},
{
"name": "action_by",
"type": "dynamic"
"type": "dynamic",
"description": "User object from the action_by field of the Box event, when Box includes it. Kept as dynamic."
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion Solutions/Box/Data/Solution_Box.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"Analytic Rules/BoxUserRoleChangedToOwner.yaml"
],
"BasePath": "C:\\GitHub\\Azure-Sentinel\\Solutions\\Box",
"Version": "3.1.7",
"Version": "3.1.8",
"Metadata": "SolutionMetadata.json",
"TemplateSpec": true,
"Is1PConnector": false
Expand Down
Binary file added Solutions/Box/Package/3.1.8.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions Solutions/Box/Package/createUiDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,13 @@
{
"name": "analytic1",
"type": "Microsoft.Common.Section",
"label": "Box - Abmormal user activity",
"label": "Box - Abnormal user activity",
"elements": [
{
"name": "analytic1-text",
"type": "Microsoft.Common.TextBlock",
"options": {
"text": "Detects spikes (deviations from avarage) in user activity."
"text": "Identifies users whose Box activity in the last hour is well above their own hourly average over the previous 14 days."
}
}
]
Expand Down
Loading
Loading