Detection rules › Kusto

Insider Risk_Risky User Access By Application

Severity
medium
Time window
6h
Source
github.com/Azure/Azure-Sentinel

'This alert evaluates Microsoft Entra ID Sign in risk via Machine Learning correlations in the basket operator. The basket threshold is adjustable, and the default is set to .01. There is an optional configuration to configure the percentage rates. The correlations are designed to leverage machine learning to identify patterns of risky user application access. There is an option for configuration of correlations against Microsoft Sentinel watchlists. For more information, see Tutorial: Use risk detections for user sign-ins to trigger Microsoft Entra ID Multi-Factor Authentication or password changes'

MITRE ATT&CK coverage

TacticTechniques
ExecutionT1204 User Execution

Rule body kusto

id: 15386bba-dc70-463f-a09f-d392e7731c63
name: Insider Risk_Risky User Access By Application
description: |
  'This alert evaluates Microsoft Entra ID Sign in risk via Machine Learning correlations in the basket operator. The basket threshold is adjustable, and the default is set to .01. There is an optional configuration to configure the percentage rates. The correlations are designed to leverage machine learning to identify patterns of risky user application access. There is an option for configuration of correlations against Microsoft Sentinel watchlists. For more information, see [Tutorial: Use risk detections for user sign-ins to trigger Microsoft Entra ID Multi-Factor Authentication or password changes](https://docs.microsoft.com/azure/active-directory/authentication/tutorial-risk-based-sspr-mfa)'
severity: Medium
requiredDataConnectors:
  - connectorId: AzureActiveDirectory
    dataTypes:
      - SigninLogs 
queryFrequency: 6h
queryPeriod: 6h
triggerOperator: gt
triggerThreshold: 0
tactics:
  - Execution
relevantTechniques:
  - T1204
query: |
  SigninLogs
  | where RiskState == "atRisk"
  | project UserPrincipalName, Location, AppDisplayName, RiskState
  | evaluate basket(0.01) // Adjust & Tune Thresholds within Organzational Requirements
  // | where Percent > 50 // Adjust & Tune Thresholds within Organzational Requirements
  | where UserPrincipalName <> ""
  | where AppDisplayName <> ""
  | project Percent, UserPrincipalName, Location, AppDisplayName, RiskState
  // | lookup kind=inner _GetWatchlist('<Your Watchlist Name>') on $left.UserPrincipalName == $right.SearchKey
  | sort by Percent desc
  | extend AccountName = tostring(split(UserPrincipalName, "@")[0]), AccountUPNSuffix = tostring(split(UserPrincipalName, "@")[1])
eventGroupingSettings:
  aggregationKind: SingleAlert
entityMappings:
  - entityType: Account
    fieldMappings:
      - identifier: FullName
        columnName: UserPrincipalName
      - identifier: Name
        columnName: AccountName
      - identifier: UPNSuffix
        columnName: AccountUPNSuffix
incidentConfiguration:
  createIncident: true
  groupingConfiguration:
    enabled: true
    reopenClosedIncident: true
    lookbackDuration: 3d
    matchingMethod: Selected
    groupByEntities:
      - Account
version: 1.1.4
kind: Scheduled

Stages and Predicates

Stage 1: source

SigninLogs

Stage 2: where

| where RiskState == "atRisk"

Stage 3: project

| project UserPrincipalName, Location, AppDisplayName, RiskState

Stage 4: evaluate

| evaluate basket(0.01)

Stage 5: where

| where UserPrincipalName <> ""

Stage 6: where

| where AppDisplayName <> ""

Stage 7: project

| project Percent, UserPrincipalName, Location, AppDisplayName, RiskState

Stage 8: sort

| sort by Percent desc

Stage 9: extend

| extend AccountName = tostring(split(UserPrincipalName, "@")[0]), AccountUPNSuffix = tostring(split(UserPrincipalName, "@")[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
RiskStateeq
  • atRisk 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
AppDisplayNameproject
Locationproject
Percentproject
RiskStateproject
UserPrincipalNameproject
AccountNameextend
AccountUPNSuffixextend