Back
Id7d4e9f2a-8b1c-4a5d-9e3f-6c2b1a0d8e7f
RulenameSAP BTP - User added to Cloud Identity Service privileged Administrators list
DescriptionIdentifies when a user is granted privileged administrator permissions in SAP Cloud Identity Service. These permissions include managing Identity Providers, Service Providers, Users, Groups, and Access controls.
SeverityHigh
TacticsLateralMovement
PrivilegeEscalation
TechniquesT0859
T1078
Required data connectorsSAPBTPAuditEvents
KindScheduled
Query frequency15m
Query period15m
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/SAP%20BTP/Analytic%20Rules/BTP%20-%20User%20added%20to%20privileged%20Administrators%20list.yaml
Version1.0.1
Arm template7d4e9f2a-8b1c-4a5d-9e3f-6c2b1a0d8e7f.json
Deploy To Azure
let monitored_permissions = dynamic(["ManageIdP", "ManageSP", "ManageUsers", "ReadUsers", "ManageAccess", "ManageGroups"]);
SAPBTPAuditLog_CL
| extend data_s = tostring(Message.data)
| extend action = extract(@"action=""([^""]+)""", 1, data_s),
         state = extract(@"state=""([^""]+)""", 1, data_s),
         changedAttribute = extract(@"changedAttribute=""([^""]+)""", 1, data_s),
         newValue = extract(@"newValue=""([^""]+)""", 1, data_s),
         targetUser = extract(@"userIdentifier=""([^""]+)""", 1, data_s),
         callerMail = extract(@"callerMail=""([^""]+)""", 1, data_s),
         ipAddress = extract(@"ipAddress=""([^""]+)""", 1, data_s)
| where action == "grantPermissions"
| where state == "successful"
| where changedAttribute == "authorizations"
| where isnotempty(newValue)
| mv-expand permission = monitored_permissions
| where newValue contains tostring(permission)
| summarize 
    GrantedPermissions = make_set(newValue, 10),
    MatchedPermissions = make_set(tostring(permission), 10)
    by UpdatedOn, UserName, callerMail, targetUser, Tenant, ipAddress
| project UpdatedOn, UserName, callerMail, targetUser, GrantedPermissions, MatchedPermissions, Tenant, ipAddress, CloudApp = "SAP Cloud Identity Service"
| extend AccountName = split(UserName, "@")[0], UPNSuffix = split(UserName, "@")[1]
entityMappings:
- entityType: Account
  fieldMappings:
  - identifier: Name
    columnName: AccountName
  - identifier: UPNSuffix
    columnName: UPNSuffix
- entityType: CloudApplication
  fieldMappings:
  - identifier: Name
    columnName: CloudApp
- entityType: IP
  fieldMappings:
  - identifier: Address
    columnName: ipAddress
name: SAP BTP - User added to Cloud Identity Service privileged Administrators list
queryFrequency: 15m
triggerOperator: gt
status: Available
queryPeriod: 15m
requiredDataConnectors:
- connectorId: SAPBTPAuditEvents
  dataTypes:
  - SAPBTPAuditLog_CL
tactics:
- LateralMovement
- PrivilegeEscalation
query: |
  let monitored_permissions = dynamic(["ManageIdP", "ManageSP", "ManageUsers", "ReadUsers", "ManageAccess", "ManageGroups"]);
  SAPBTPAuditLog_CL
  | extend data_s = tostring(Message.data)
  | extend action = extract(@"action=""([^""]+)""", 1, data_s),
           state = extract(@"state=""([^""]+)""", 1, data_s),
           changedAttribute = extract(@"changedAttribute=""([^""]+)""", 1, data_s),
           newValue = extract(@"newValue=""([^""]+)""", 1, data_s),
           targetUser = extract(@"userIdentifier=""([^""]+)""", 1, data_s),
           callerMail = extract(@"callerMail=""([^""]+)""", 1, data_s),
           ipAddress = extract(@"ipAddress=""([^""]+)""", 1, data_s)
  | where action == "grantPermissions"
  | where state == "successful"
  | where changedAttribute == "authorizations"
  | where isnotempty(newValue)
  | mv-expand permission = monitored_permissions
  | where newValue contains tostring(permission)
  | summarize 
      GrantedPermissions = make_set(newValue, 10),
      MatchedPermissions = make_set(tostring(permission), 10)
      by UpdatedOn, UserName, callerMail, targetUser, Tenant, ipAddress
  | project UpdatedOn, UserName, callerMail, targetUser, GrantedPermissions, MatchedPermissions, Tenant, ipAddress, CloudApp = "SAP Cloud Identity Service"
  | extend AccountName = split(UserName, "@")[0], UPNSuffix = split(UserName, "@")[1]
description: Identifies when a user is granted privileged administrator permissions in SAP Cloud Identity Service. These permissions include managing Identity Providers, Service Providers, Users, Groups, and Access controls.
severity: High
kind: Scheduled
eventGroupingSettings:
  aggregationKind: SingleAlert
triggerThreshold: 0
id: 7d4e9f2a-8b1c-4a5d-9e3f-6c2b1a0d8e7f
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/SAP%20BTP/Analytic%20Rules/BTP%20-%20User%20added%20to%20privileged%20Administrators%20list.yaml
version: 1.0.1
relevantTechniques:
- T0859
- T1078
{
  "$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/7d4e9f2a-8b1c-4a5d-9e3f-6c2b1a0d8e7f')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/7d4e9f2a-8b1c-4a5d-9e3f-6c2b1a0d8e7f')]",
      "properties": {
        "alertRuleTemplateName": "7d4e9f2a-8b1c-4a5d-9e3f-6c2b1a0d8e7f",
        "customDetails": null,
        "description": "Identifies when a user is granted privileged administrator permissions in SAP Cloud Identity Service. These permissions include managing Identity Providers, Service Providers, Users, Groups, and Access controls.",
        "displayName": "SAP BTP - User added to Cloud Identity Service privileged Administrators list",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "AccountName",
                "identifier": "Name"
              },
              {
                "columnName": "UPNSuffix",
                "identifier": "UPNSuffix"
              }
            ]
          },
          {
            "entityType": "CloudApplication",
            "fieldMappings": [
              {
                "columnName": "CloudApp",
                "identifier": "Name"
              }
            ]
          },
          {
            "entityType": "IP",
            "fieldMappings": [
              {
                "columnName": "ipAddress",
                "identifier": "Address"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "SingleAlert"
        },
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/SAP%20BTP/Analytic%20Rules/BTP%20-%20User%20added%20to%20privileged%20Administrators%20list.yaml",
        "query": "let monitored_permissions = dynamic([\"ManageIdP\", \"ManageSP\", \"ManageUsers\", \"ReadUsers\", \"ManageAccess\", \"ManageGroups\"]);\nSAPBTPAuditLog_CL\n| extend data_s = tostring(Message.data)\n| extend action = extract(@\"action=\"\"([^\"\"]+)\"\"\", 1, data_s),\n         state = extract(@\"state=\"\"([^\"\"]+)\"\"\", 1, data_s),\n         changedAttribute = extract(@\"changedAttribute=\"\"([^\"\"]+)\"\"\", 1, data_s),\n         newValue = extract(@\"newValue=\"\"([^\"\"]+)\"\"\", 1, data_s),\n         targetUser = extract(@\"userIdentifier=\"\"([^\"\"]+)\"\"\", 1, data_s),\n         callerMail = extract(@\"callerMail=\"\"([^\"\"]+)\"\"\", 1, data_s),\n         ipAddress = extract(@\"ipAddress=\"\"([^\"\"]+)\"\"\", 1, data_s)\n| where action == \"grantPermissions\"\n| where state == \"successful\"\n| where changedAttribute == \"authorizations\"\n| where isnotempty(newValue)\n| mv-expand permission = monitored_permissions\n| where newValue contains tostring(permission)\n| summarize \n    GrantedPermissions = make_set(newValue, 10),\n    MatchedPermissions = make_set(tostring(permission), 10)\n    by UpdatedOn, UserName, callerMail, targetUser, Tenant, ipAddress\n| project UpdatedOn, UserName, callerMail, targetUser, GrantedPermissions, MatchedPermissions, Tenant, ipAddress, CloudApp = \"SAP Cloud Identity Service\"\n| extend AccountName = split(UserName, \"@\")[0], UPNSuffix = split(UserName, \"@\")[1]\n",
        "queryFrequency": "PT15M",
        "queryPeriod": "PT15M",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "LateralMovement",
          "PrivilegeEscalation"
        ],
        "techniques": [
          "T1078"
        ],
        "templateVersion": "1.0.1",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}