Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Box - Inactive user login

Back
Idedbf38d7-e170-4af2-ad50-1a05b374611b
RulenameBox - Inactive user login
DescriptionDetects user login after long inactivity period.
SeverityMedium
TacticsInitialAccess
TechniquesT1078
Required data connectorsBoxDataConnector
KindScheduled
Query frequency1h
Query period14d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Box/Analytic Rules/BoxInactiveUserLogin.yaml
Version1.0.0
Arm templateedbf38d7-e170-4af2-ad50-1a05b374611b.json
Deploy To Azure
let lbperiod_start = 14d;
let lbperiod_end = 7d;
let lbtime = 1h;
let active_users = BoxEvents
| where TimeGenerated between (ago(lbperiod_end) .. ago(lbtime))
| where EventType =~ 'LOGIN'
| summarize makeset(SourceName);
let inactive_users = BoxEvents
| where TimeGenerated 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
status: Available
id: edbf38d7-e170-4af2-ad50-1a05b374611b
name: Box - Inactive user login
requiredDataConnectors:
- connectorId: BoxDataConnector
  dataTypes:
  - BoxEvents_CL
severity: Medium
triggerThreshold: 0
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Box/Analytic Rules/BoxInactiveUserLogin.yaml
kind: Scheduled
description: |
    'Detects user login after long inactivity period.'
relevantTechniques:
- T1078
queryPeriod: 14d
triggerOperator: gt
queryFrequency: 1h
query: |
  let lbperiod_start = 14d;
  let lbperiod_end = 7d;
  let lbtime = 1h;
  let active_users = BoxEvents
  | where TimeGenerated between (ago(lbperiod_end) .. ago(lbtime))
  | where EventType =~ 'LOGIN'
  | summarize makeset(SourceName);
  let inactive_users = BoxEvents
  | where TimeGenerated 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  
version: 1.0.0
tactics:
- InitialAccess
entityMappings:
- fieldMappings:
  - identifier: FullName
    columnName: AccountCustomEntity
  entityType: Account
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2023-02-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/edbf38d7-e170-4af2-ad50-1a05b374611b')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/edbf38d7-e170-4af2-ad50-1a05b374611b')]",
      "properties": {
        "alertRuleTemplateName": "edbf38d7-e170-4af2-ad50-1a05b374611b",
        "customDetails": null,
        "description": "'Detects user login after long inactivity period.'\n",
        "displayName": "Box - Inactive user login",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "AccountCustomEntity",
                "identifier": "FullName"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Box/Analytic Rules/BoxInactiveUserLogin.yaml",
        "query": "let lbperiod_start = 14d;\nlet lbperiod_end = 7d;\nlet lbtime = 1h;\nlet active_users = BoxEvents\n| where TimeGenerated between (ago(lbperiod_end) .. ago(lbtime))\n| where EventType =~ 'LOGIN'\n| summarize makeset(SourceName);\nlet inactive_users = BoxEvents\n| where TimeGenerated between (ago(lbperiod_start) .. ago(lbperiod_end))\n| where EventType =~ 'LOGIN'\n| where SourceName !in (active_users)\n| summarize makeset(SourceName);\nBoxEvents\n| where EventType == 'LOGIN'\n| where SourceName in (inactive_users)\n| extend AccountCustomEntity = SourceName\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "P14D",
        "severity": "Medium",
        "status": "Available",
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "InitialAccess"
        ],
        "techniques": [
          "T1078"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}