Box - New external user
| Id | fd36ac88-cd92-4137-aa23-37a3648621fa | 
| Rulename | Box - New external user | 
| Description | Detects when new user created with SourceLogin containing non-corporate domain. | 
| Severity | Medium | 
| Tactics | InitialAccess Persistence  | 
| Techniques | T1078 | 
| Required data connectors | BoxDataConnector | 
| Kind | Scheduled | 
| Query frequency | 1h | 
| Query period | 1h | 
| Trigger threshold | 0 | 
| Trigger operator | gt | 
| Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Box/Analytic Rules/BoxNewExternalUser.yaml | 
| Version | 1.0.0 | 
| Arm template | fd36ac88-cd92-4137-aa23-37a3648621fa.json | 
BoxEvents
| where EventType =~ 'NEW_USER'
| extend corp_domain = extract(@'@(.*)', 1, SourceLogin)
| extend new_domain = tolower(extract(@'@(.*)', 1, SourceLogin))
| where corp_domain != new_domain
| extend AccountCustomEntity = SourceLogin
| extend IPCustomEntity = SrcIpAddr
kind: Scheduled
entityMappings:
- entityType: Account
  fieldMappings:
  - columnName: AccountCustomEntity
    identifier: FullName
- entityType: IP
  fieldMappings:
  - columnName: IPCustomEntity
    identifier: Address
description: |
    'Detects when new user created with SourceLogin containing non-corporate domain.'
severity: Medium
queryFrequency: 1h
triggerThreshold: 0
relevantTechniques:
- T1078
status: Available
tactics:
- InitialAccess
- Persistence
name: Box - New external user
id: fd36ac88-cd92-4137-aa23-37a3648621fa
query: |
  BoxEvents
  | where EventType =~ 'NEW_USER'
  | extend corp_domain = extract(@'@(.*)', 1, SourceLogin)
  | extend new_domain = tolower(extract(@'@(.*)', 1, SourceLogin))
  | where corp_domain != new_domain
  | extend AccountCustomEntity = SourceLogin
  | extend IPCustomEntity = SrcIpAddr  
requiredDataConnectors:
- dataTypes:
  - BoxEvents_CL
  connectorId: BoxDataConnector
version: 1.0.0
triggerOperator: gt
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Box/Analytic Rules/BoxNewExternalUser.yaml
queryPeriod: 1h
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2024-01-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/fd36ac88-cd92-4137-aa23-37a3648621fa')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/fd36ac88-cd92-4137-aa23-37a3648621fa')]",
      "properties": {
        "alertRuleTemplateName": "fd36ac88-cd92-4137-aa23-37a3648621fa",
        "customDetails": null,
        "description": "'Detects when new user created with SourceLogin containing non-corporate domain.'\n",
        "displayName": "Box - New external user",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "AccountCustomEntity",
                "identifier": "FullName"
              }
            ]
          },
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "IPCustomEntity",
                "identifier": "Address"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Box/Analytic Rules/BoxNewExternalUser.yaml",
        "query": "BoxEvents\n| where EventType =~ 'NEW_USER'\n| extend corp_domain = extract(@'@(.*)', 1, SourceLogin)\n| extend new_domain = tolower(extract(@'@(.*)', 1, SourceLogin))\n| where corp_domain != new_domain\n| extend AccountCustomEntity = SourceLogin\n| extend IPCustomEntity = SrcIpAddr\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "PT1H",
        "severity": "Medium",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "InitialAccess",
          "Persistence"
        ],
        "techniques": [
          "T1078"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}