Detection rules › Kusto

Power Platform - Possibly compromised user accesses Power Platform services

Status
available
Severity
high
Time window
1d
Source
github.com/Azure/Azure-Sentinel

Identifies user accounts flagged at risk in Microsoft Entra Identity Protection and correlates these users with sign-in activity in Power Platform, including Power Apps, Power Automate and Power Platform Admin Center.

MITRE ATT&CK coverage

TacticTechniques
Initial AccessT1078 Valid Accounts
Lateral MovementT1210 Exploitation of Remote Services

Rule body kusto

id: 54d48840-1c64-4399-afee-ad39a069118d
kind: Scheduled
name: Power Platform - Possibly compromised user accesses Power Platform services
description: Identifies user accounts flagged at risk in Microsoft Entra Identity
  Protection and correlates these users with sign-in activity in Power Platform, including
  Power Apps, Power Automate and Power Platform Admin Center.
severity: High
status: Available
requiredDataConnectors:
  - connectorId: AzureActiveDirectory
    dataTypes:
      - SigninLogs
queryFrequency: 1h
queryPeriod: 1d
triggerOperator: gt
triggerThreshold: 0
tactics:
  - InitialAccess
  - LateralMovement
relevantTechniques:
  - T1078
  - T1210
query: |
  let power_automate_appid = "6204c1d1-4712-4c46-a7d9-3ed63d992682";
  let power_apps_appid = "a8f7a65c-f5ba-4859-b2d6-df772c264e9d";
  let ppac_appid = "065d9450-1e87-434e-ac2f-69af271549ed";
  let query_frequency = 1h;
  SigninLogs
  | where ingestion_time() >= ago(query_frequency)
  | where array_length(todynamic(RiskEventTypes)) != 0 or array_length(todynamic(RiskEventTypes_V2)) != 0
  | where AppId in (power_automate_appid, power_apps_appid, ppac_appid)
  | extend AffectedPlatform = case(
                                  AppId == ppac_appid,
                                  "Power Platform Admin Center",
                                  AppId == power_apps_appid,
                                  "Power Apps",
                                  AppId == power_automate_appid,
                                  "Power Automate",
                                  "Unknown"
                              )
  | extend
      Severity = iif(AffectedPlatform in ("Power Apps", "Power Automate"), "Medium", "High"),
      CloudAppId = case(AffectedPlatform == "Power Apps", int(27593), AffectedPlatform == "Power Automate", int(27592), 0),
      AccountName = tostring(split(UserPrincipalName, '@')[0]),
      UPNSuffix = tostring(split(UserPrincipalName, '@')[1])
  | project
      TimeGenerated,
      UserId,
      UniqueTokenIdentifier,
      Identity,
      RiskEventTypes,
      RiskEventTypes_V2,
      UserPrincipalName,
      AppId,
      AppDisplayName,
      AffectedPlatform,
      IPAddress,
      Severity,
      CloudAppId,
      AccountName,
      UPNSuffix
eventGroupingSettings:
  aggregationKind: SingleAlert
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: Name
        columnName: AccountName
      - identifier: UPNSuffix
        columnName: UPNSuffix
  - entityType: IP
    fieldMappings:
      - identifier: Address
        columnName: IPAddress
  - entityType: CloudApplication
    fieldMappings:
      - identifier: Name
        columnName: AffectedPlatform
      - identifier: AppId
        columnName: AppId
alertDetailsOverride:
  alertDisplayNameFormat: 'Risky user sign-in activity in {{{AffectedPlatform}} '
  alertDescriptionFormat: The user {{UserPrincipalName}} has sign-in risk events associated
    and successfully signed in to {{{AffectedPlatform}} from {{IPAddress}}
  alertSeverityColumnName: Severity
customDetails:
  RiskEventTypes: RiskEventTypes
  RiskEventTypes_V2: RiskEventTypes_V2
version: 3.0.0

Stages and Predicates

Parameters

let power_automate_appid = "6204c1d1-4712-4c46-a7d9-3ed63d992682";
let power_apps_appid = "a8f7a65c-f5ba-4859-b2d6-df772c264e9d";
let ppac_appid = "065d9450-1e87-434e-ac2f-69af271549ed";
let query_frequency = 1h;

Stage 1: source

SigninLogs

Stage 2: where

| where ingestion_time() >= ago(query_frequency)

Stage 3: where

| where array_length(todynamic(RiskEventTypes)) != 0 or array_length(todynamic(RiskEventTypes_V2)) != 0

Stage 4: where

| where AppId in (power_automate_appid, power_apps_appid, ppac_appid)

Stage 5: extend

| extend AffectedPlatform = case(
                                AppId == ppac_appid,
                                "Power Platform Admin Center",
                                AppId == power_apps_appid,
                                "Power Apps",
                                AppId == power_automate_appid,
                                "Power Automate",
                                "Unknown"
                            )
AffectedPlatform =
ifAppId == "ppac_appid""Power Platform Admin Center"
elifAppId == "power_apps_appid""Power Apps"
elifAppId == "power_automate_appid""Power Automate"
else"Unknown"

Stage 6: extend

| extend
    Severity = iif(AffectedPlatform in ("Power Apps", "Power Automate"), "Medium", "High"),
    CloudAppId = case(AffectedPlatform == "Power Apps", int(27593), AffectedPlatform == "Power Automate", int(27592), 0),
    AccountName = tostring(split(UserPrincipalName, '@')[0]),
    UPNSuffix = tostring(split(UserPrincipalName, '@')[1])
CloudAppId =
ifAffectedPlatform == "Power Apps"int(27593)
elifAffectedPlatform == "Power Automate"int(27592)
else0

Stage 7: project

| project
    TimeGenerated,
    UserId,
    UniqueTokenIdentifier,
    Identity,
    RiskEventTypes,
    RiskEventTypes_V2,
    UserPrincipalName,
    AppId,
    AppDisplayName,
    AffectedPlatform,
    IPAddress,
    Severity,
    CloudAppId,
    AccountName,
    UPNSuffix

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
AppIdin
  • 065d9450-1e87-434e-ac2f-69af271549ed transforms: cased
  • 6204c1d1-4712-4c46-a7d9-3ed63d992682 transforms: cased
  • a8f7a65c-f5ba-4859-b2d6-df772c264e9d transforms: cased
RiskEventTypesne
  • 0 transforms: array_length
RiskEventTypes_V2ne
  • 0 transforms: array_length

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
AccountNameproject
AffectedPlatformproject
AppDisplayNameproject
AppIdproject
CloudAppIdproject
IPAddressproject
Identityproject
RiskEventTypesproject
RiskEventTypes_V2project
Severityproject
TimeGeneratedproject
UPNSuffixproject
UniqueTokenIdentifierproject
UserIdproject
UserPrincipalNameproject