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

Power Platform - Account added to privileged Microsoft Entra roles

Back
Id71d829d6-eb50-4a17-8a64-655fae8d71e1
RulenamePower Platform - Account added to privileged Microsoft Entra roles
DescriptionIdentifies changes to privileged directory roles impacting Power Platform:

- Dynamics 365 Admins

- Power Platform Admins

- Fabric Admins
SeverityLow
TacticsPrivilegeEscalation
TechniquesT1078
T1068
T1548
Required data connectorsAzureActiveDirectory
KindScheduled
Query frequency1h
Query period1d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft Business Applications/Analytic Rules/Power Platform - Account added to privileged Microsoft Entra roles.yaml
Version3.2.0
Arm template71d829d6-eb50-4a17-8a64-655fae8d71e1.json
Deploy To Azure
// 44367163-eba1-44c3-98af-f5787879f96a = Dynamics 365 Administrator
// 11648597-926c-4cf3-9c36-bcebb0ba8dcc = Power Platform Administrator
// a9ea8996-122f-4c74-9520-8edcd192826c = Fabric Administrator
let query_frequency = 1h;
let role_template_ids = dynamic(["44367163-eba1-44c3-98af-f5787879f96a", "11648597-926c-4cf3-9c36-bcebb0ba8dcc", "a9ea8996-122f-4c74-9520-8edcd192826c"]);
let monitored_activities = dynamic(["Assign", "AssignGrantedRole", "AssignPermanentGrantedRole", "AssignPermanentEligibleRole", "RoleElevatedOutsidePimAlert"]);
AuditLogs
| where TimeGenerated >= ago(query_frequency)
| where Category == "RoleManagement"
    and TargetResources has_any (role_template_ids)
    and AADOperationType in (monitored_activities)
    and Identity != "MS-PIM"
| extend
    UserPrincipalName = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName),
    AadUserId = tostring(parse_json(tostring(InitiatedBy.user)).id),
    IPAddress = tostring(parse_json(tostring(InitiatedBy.user)).ipAddress),
    RoleName = tostring(TargetResources[0].displayName),
    UserAdded = tostring(TargetResources[2].userPrincipalName)
| extend
    RoleName = iif(isempty(RoleName), tostring(parse_json(tostring(TargetResources[0].modifiedProperties))[1].newValue), RoleName),
    UserAdded = iif(isempty(UserAdded), tostring(parse_json(tostring(TargetResources[0].userPrincipalName))), UserAdded),
    CloudAppId = int(32780),
    AccountName = tostring(split(UserPrincipalName, '@')[0]),
    UPNSuffix = tostring(split(UserPrincipalName, '@')[1])
| project
    TimeGenerated,
    Identity,
    UserPrincipalName,
    AadUserId,
    RoleName,
    OperationName,
    UserAdded,
    TargetResources,
    CloudAppId,
    AccountName,
    UPNSuffix
entityMappings:
- entityType: CloudApplication
  fieldMappings:
  - identifier: AppId
    columnName: CloudAppId
- entityType: Account
  fieldMappings:
  - identifier: Name
    columnName: AccountName
  - identifier: UPNSuffix
    columnName: UPNSuffix
queryFrequency: 1h
name: Power Platform - Account added to privileged Microsoft Entra roles
alertDetailsOverride:
  alertDisplayNameFormat: Power Platform - Account added to privileged role {{RoleName}}
  alertDescriptionFormat: 'A user {{UserAdded}} was added to one of the Power Platform administrative roles: {{{RoleName}}'
kind: Scheduled
tactics:
- PrivilegeEscalation
triggerThreshold: 0
query: |
  // 44367163-eba1-44c3-98af-f5787879f96a = Dynamics 365 Administrator
  // 11648597-926c-4cf3-9c36-bcebb0ba8dcc = Power Platform Administrator
  // a9ea8996-122f-4c74-9520-8edcd192826c = Fabric Administrator
  let query_frequency = 1h;
  let role_template_ids = dynamic(["44367163-eba1-44c3-98af-f5787879f96a", "11648597-926c-4cf3-9c36-bcebb0ba8dcc", "a9ea8996-122f-4c74-9520-8edcd192826c"]);
  let monitored_activities = dynamic(["Assign", "AssignGrantedRole", "AssignPermanentGrantedRole", "AssignPermanentEligibleRole", "RoleElevatedOutsidePimAlert"]);
  AuditLogs
  | where TimeGenerated >= ago(query_frequency)
  | where Category == "RoleManagement"
      and TargetResources has_any (role_template_ids)
      and AADOperationType in (monitored_activities)
      and Identity != "MS-PIM"
  | extend
      UserPrincipalName = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName),
      AadUserId = tostring(parse_json(tostring(InitiatedBy.user)).id),
      IPAddress = tostring(parse_json(tostring(InitiatedBy.user)).ipAddress),
      RoleName = tostring(TargetResources[0].displayName),
      UserAdded = tostring(TargetResources[2].userPrincipalName)
  | extend
      RoleName = iif(isempty(RoleName), tostring(parse_json(tostring(TargetResources[0].modifiedProperties))[1].newValue), RoleName),
      UserAdded = iif(isempty(UserAdded), tostring(parse_json(tostring(TargetResources[0].userPrincipalName))), UserAdded),
      CloudAppId = int(32780),
      AccountName = tostring(split(UserPrincipalName, '@')[0]),
      UPNSuffix = tostring(split(UserPrincipalName, '@')[1])
  | project
      TimeGenerated,
      Identity,
      UserPrincipalName,
      AadUserId,
      RoleName,
      OperationName,
      UserAdded,
      TargetResources,
      CloudAppId,
      AccountName,
      UPNSuffix  
relevantTechniques:
- T1078
- T1068
- T1548
triggerOperator: gt
queryPeriod: 1d
eventGroupingSettings:
  aggregationKind: SingleAlert
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft Business Applications/Analytic Rules/Power Platform - Account added to privileged Microsoft Entra roles.yaml
severity: Low
status: Available
id: 71d829d6-eb50-4a17-8a64-655fae8d71e1
requiredDataConnectors:
- connectorId: AzureActiveDirectory
  dataTypes:
  - AuditLogs
version: 3.2.0
description: |
  Identifies changes to privileged directory roles impacting Power Platform:
  - Dynamics 365 Admins
  - Power Platform Admins
  - Fabric Admins  
{
  "$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/71d829d6-eb50-4a17-8a64-655fae8d71e1')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/71d829d6-eb50-4a17-8a64-655fae8d71e1')]",
      "properties": {
        "alertDetailsOverride": {
          "alertDescriptionFormat": "A user {{UserAdded}} was added to one of the Power Platform administrative roles: {{{RoleName}}",
          "alertDisplayNameFormat": "Power Platform - Account added to privileged role {{RoleName}}"
        },
        "alertRuleTemplateName": "71d829d6-eb50-4a17-8a64-655fae8d71e1",
        "customDetails": null,
        "description": "Identifies changes to privileged directory roles impacting Power Platform:\n- Dynamics 365 Admins\n- Power Platform Admins\n- Fabric Admins\n",
        "displayName": "Power Platform - Account added to privileged Microsoft Entra roles",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "CloudApplication",
            "fieldMappings": [
              {
                "columnName": "CloudAppId",
                "identifier": "AppId"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "AccountName",
                "identifier": "Name"
              },
              {
                "columnName": "UPNSuffix",
                "identifier": "UPNSuffix"
              }
            ]
          }
        ],
        "eventGroupingSettings": {
          "aggregationKind": "SingleAlert"
        },
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Microsoft Business Applications/Analytic Rules/Power Platform - Account added to privileged Microsoft Entra roles.yaml",
        "query": "// 44367163-eba1-44c3-98af-f5787879f96a = Dynamics 365 Administrator\n// 11648597-926c-4cf3-9c36-bcebb0ba8dcc = Power Platform Administrator\n// a9ea8996-122f-4c74-9520-8edcd192826c = Fabric Administrator\nlet query_frequency = 1h;\nlet role_template_ids = dynamic([\"44367163-eba1-44c3-98af-f5787879f96a\", \"11648597-926c-4cf3-9c36-bcebb0ba8dcc\", \"a9ea8996-122f-4c74-9520-8edcd192826c\"]);\nlet monitored_activities = dynamic([\"Assign\", \"AssignGrantedRole\", \"AssignPermanentGrantedRole\", \"AssignPermanentEligibleRole\", \"RoleElevatedOutsidePimAlert\"]);\nAuditLogs\n| where TimeGenerated >= ago(query_frequency)\n| where Category == \"RoleManagement\"\n    and TargetResources has_any (role_template_ids)\n    and AADOperationType in (monitored_activities)\n    and Identity != \"MS-PIM\"\n| extend\n    UserPrincipalName = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName),\n    AadUserId = tostring(parse_json(tostring(InitiatedBy.user)).id),\n    IPAddress = tostring(parse_json(tostring(InitiatedBy.user)).ipAddress),\n    RoleName = tostring(TargetResources[0].displayName),\n    UserAdded = tostring(TargetResources[2].userPrincipalName)\n| extend\n    RoleName = iif(isempty(RoleName), tostring(parse_json(tostring(TargetResources[0].modifiedProperties))[1].newValue), RoleName),\n    UserAdded = iif(isempty(UserAdded), tostring(parse_json(tostring(TargetResources[0].userPrincipalName))), UserAdded),\n    CloudAppId = int(32780),\n    AccountName = tostring(split(UserPrincipalName, '@')[0]),\n    UPNSuffix = tostring(split(UserPrincipalName, '@')[1])\n| project\n    TimeGenerated,\n    Identity,\n    UserPrincipalName,\n    AadUserId,\n    RoleName,\n    OperationName,\n    UserAdded,\n    TargetResources,\n    CloudAppId,\n    AccountName,\n    UPNSuffix\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "P1D",
        "severity": "Low",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "PrivilegeEscalation"
        ],
        "techniques": [
          "T1068",
          "T1078",
          "T1548"
        ],
        "templateVersion": "3.2.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}