Detection rules › Kusto

BTP - Mass user deletion in SAP Cloud Identity Service

Status
available
Severity
medium
Time window
1h
Group by
SpaceId, Tenant, UserName
Source
github.com/Azure/Azure-Sentinel

Identifies mass user deletion activity in SAP Cloud Identity Service where the amount of deleted users exceeds a predefined threshold.

MITRE ATT&CK coverage

Rule body kusto

id: a3b8e7c4-5f2d-4a1e-9c6b-8d7f3e2a1b0c
kind: Scheduled
name: BTP - Mass user deletion in SAP Cloud Identity Service
description: Identifies mass user deletion activity in SAP Cloud Identity Service
  where the amount of deleted users exceeds a predefined threshold.
severity: Medium
status: Available
requiredDataConnectors:
  - connectorId: SAPBTPAuditEvents
    dataTypes:
      - SAPBTPAuditLog_CL
queryFrequency: 1h
queryPeriod: 1h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Impact
relevantTechniques:
  - T1531
  - T1485
  - T1489
  - T0813
  - T0826
  - T0827
query: |
  let bulk_delete_threshold = 10;
  SAPBTPAuditLog_CL
  | extend data_s = tostring(Message.data)
  | extend action = extract(@"action=""([^""]+)""", 1, data_s),
           objectType = extract(@"objectType=""([^""]+)""", 1, data_s),
           impactedUser = extract(@"serviceProviderName=""([^""]+)""", 1, data_s)
  | where action == "delete"
  | where objectType == "authorization"
  | where isnotempty(impactedUser)
  | summarize
      Start = min(UpdatedOn),
      End = max(UpdatedOn),
      DeleteCount = count(),
      DeletedUsers = make_set(impactedUser, 100)
      by UserName, Tenant, SpaceId
  | where array_length(DeletedUsers) > bulk_delete_threshold
  | project Start, End, UserName, DeletedUsers, DeleteCount, Tenant, SpaceId, CloudApp = "SAP BTP"
  | extend AccountName = split(UserName, "@")[0], UPNSuffix = split(UserName, "@")[1]
eventGroupingSettings:
  aggregationKind: SingleAlert
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: Name
        columnName: AccountName
      - identifier: UPNSuffix
        columnName: UPNSuffix
  - entityType: CloudApplication
    fieldMappings:
      - identifier: Name
        columnName: CloudApp
version: 3.0.0

Stages and Predicates

Parameters

let bulk_delete_threshold = 10;

Stage 1: source

SAPBTPAuditLog_CL

Stage 2: extend

| extend data_s = tostring(Message.data)

Stage 3: extend

| extend action = extract(@"action=""([^""]+)""", 1, data_s),
         objectType = extract(@"objectType=""([^""]+)""", 1, data_s),
         impactedUser = extract(@"serviceProviderName=""([^""]+)""", 1, data_s)

Stage 4: where

| where action == "delete"

Stage 5: where

| where objectType == "authorization"

Stage 6: where

| where isnotempty(impactedUser)

Stage 7: summarize

| summarize
    Start = min(UpdatedOn),
    End = max(UpdatedOn),
    DeleteCount = count(),
    DeletedUsers = make_set(impactedUser, 100)
    by UserName, Tenant, SpaceId
Threshold
gt 10

Stage 8: where

| where array_length(DeletedUsers) > bulk_delete_threshold

Stage 9: project

| project Start, End, UserName, DeletedUsers, DeleteCount, Tenant, SpaceId, CloudApp = "SAP BTP"

Stage 10: extend

| extend AccountName = split(UserName, "@")[0], UPNSuffix = split(UserName, "@")[1]

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
DeletedUsersgt
  • 10 transforms: array_length
actioneq
  • delete transforms: cased
impactedUseris_not_null
  • (no value, null check)
objectTypeeq
  • authorization transforms: cased

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
CloudAppproject
DeleteCountproject
DeletedUsersproject
Endproject
SpaceIdproject
Startproject
Tenantproject
UserNameproject
AccountNameextend
UPNSuffixextend