let lbperiod_start = 14d;
let lbperiod_end = 7d;
let lbtime = 1h;
let active_users = BoxEvents
| where EventEndTime between (ago(lbperiod_end) .. ago(lbtime))
| where EventType =~ 'LOGIN'
| summarize makeset(SourceName);
let inactive_users = BoxEvents
| where EventEndTime between (ago(lbperiod_start) .. ago(lbperiod_end))
| where EventType =~ 'LOGIN'
| where SourceName !in (active_users)
| summarize makeset(SourceName);
BoxEvents
| where EventType == 'LOGIN'
| where SourceName in (inactive_users)
| extend AccountCustomEntity = SourceName
name: Box - Inactive user login
relevantTechniques:
- T1078
id: edbf38d7-e170-4af2-ad50-1a05b374611b
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Box/Analytic Rules/BoxInactiveUserLogin.yaml
requiredDataConnectors:
- dataTypes:
- BoxEvents_CL
connectorId: BoxDataConnector
version: 1.0.1
severity: Medium
triggerThreshold: 0
queryPeriod: 14d
entityMappings:
- fieldMappings:
- identifier: FullName
columnName: AccountCustomEntity
entityType: Account
queryFrequency: 1h
status: Available
query: |
let lbperiod_start = 14d;
let lbperiod_end = 7d;
let lbtime = 1h;
let active_users = BoxEvents
| where EventEndTime between (ago(lbperiod_end) .. ago(lbtime))
| where EventType =~ 'LOGIN'
| summarize makeset(SourceName);
let inactive_users = BoxEvents
| where EventEndTime between (ago(lbperiod_start) .. ago(lbperiod_end))
| where EventType =~ 'LOGIN'
| where SourceName !in (active_users)
| summarize makeset(SourceName);
BoxEvents
| where EventType == 'LOGIN'
| where SourceName in (inactive_users)
| extend AccountCustomEntity = SourceName
tactics:
- InitialAccess
kind: Scheduled
description: |
'Detects user login after long inactivity period.'
triggerOperator: gt