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

Lumen TI IPAddress in IdentityLogonEvents

Back
Ida7cd18cd-1503-47ec-8dca-65d750540637
RulenameLumen TI IPAddress in IdentityLogonEvents
DescriptionThis query maps Lumen IP indicators of compromise (IOCs) from threat intelligence (TI), by searching for matches in Azure AD sign-in logs.
SeverityMedium
TacticsCommandAndControl
TechniquesT1071
Required data connectorsAzureActiveDirectory
LumenThreatFeedConnector
ThreatIntelligenceUploadIndicatorsAPI
KindScheduled
Query frequency4h
Query period14d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Lumen Defender Threat Feed/Analytic Rules/Lumen_IPEntity_IdentityLogonEvents.yaml
Version1.0.2
Arm templatea7cd18cd-1503-47ec-8dca-65d750540637.json
Deploy To Azure
let dt_lookBack = 1d;  // Data lookback for AAD sign-in logs
let ioc_lookBack = 14d; // TI lookback
let IP_Indicators =
    ThreatIntelIndicators
    | where TimeGenerated >= ago(ioc_lookBack)
    | where IsActive == true and ValidUntil > now()
    | summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by Id
    | where SourceSystem == 'Lumen'
    | where ObservableKey == 'ipv4-addr:value'
    | extend TI_ipEntity = ObservableValue
    | where ipv4_is_private(TI_ipEntity) == false and TI_ipEntity !startswith 'fe80' and TI_ipEntity !startswith '::' and TI_ipEntity !startswith '127.';
let SignInUnion =
    union isfuzzy=true
    (
        AADNonInteractiveUserSignInLogs
        | where TimeGenerated >= ago(dt_lookBack)
        | extend
            ILE_ipEntity = IPAddress,
            AccountDisplayName = coalesce(UserDisplayName, UserPrincipalName),
            Application = coalesce(column_ifexists('AppDisplayName',''), column_ifexists('ResourceDisplayName','')),
            LogonType = column_ifexists('ClientAppUsed',''),
            IdentityLogonEvents_TimeGenerated = TimeGenerated
        | project IdentityLogonEvents_TimeGenerated, ILE_ipEntity, AccountDisplayName, Application, LogonType, IPAddress, Type
    ),
    (
        AADServicePrincipalSignInLogs
        | where TimeGenerated >= ago(dt_lookBack)
        | extend
            ILE_ipEntity = IPAddress,
            AccountDisplayName = coalesce(ServicePrincipalName, tostring(ServicePrincipalId)),
            Application = coalesce(column_ifexists('AppDisplayName',''), column_ifexists('ResourceDisplayName','')),
            LogonType = "ServicePrincipal",
            IdentityLogonEvents_TimeGenerated = TimeGenerated
        | project IdentityLogonEvents_TimeGenerated, ILE_ipEntity, AccountDisplayName, Application, LogonType, IPAddress, Type
    ),
    (
        AADManagedIdentitySignInLogs
        | where TimeGenerated >= ago(dt_lookBack)
        | extend
            ILE_ipEntity = IPAddress,
            AccountDisplayName = coalesce(ServicePrincipalName, tostring(ServicePrincipalId)),
            Application = ResourceDisplayName,
            LogonType = "ManagedIdentity",
            IdentityLogonEvents_TimeGenerated = TimeGenerated
        | project IdentityLogonEvents_TimeGenerated, ILE_ipEntity, AccountDisplayName, Application, LogonType, IPAddress, Type
    ),
    (
        ADFSSignInLogs
        | where TimeGenerated >= ago(dt_lookBack)
        | extend
            ILE_ipEntity = IPAddress,
            AccountDisplayName = coalesce(UserDisplayName, UserPrincipalName),
            Application = coalesce(AppDisplayName, ResourceDisplayName),
            LogonType = coalesce(Requirement, AuthenticationRequirement),
            IdentityLogonEvents_TimeGenerated = TimeGenerated
        | project IdentityLogonEvents_TimeGenerated, ILE_ipEntity, AccountDisplayName, Application, LogonType, IPAddress, Type
    );
IP_Indicators
| join kind=innerunique (SignInUnion) on $left.TI_ipEntity == $right.ILE_ipEntity
| where IdentityLogonEvents_TimeGenerated < ValidUntil
| summarize arg_max(IdentityLogonEvents_TimeGenerated, *), StartTime = min(IdentityLogonEvents_TimeGenerated), EndTime = max(IdentityLogonEvents_TimeGenerated) by Id, ILE_ipEntity
| project timestamp = EndTime, StartTime, EndTime, AccountDisplayName, IPAddress, Application, LogonType, Id, Tags, ValidUntil, Confidence, TI_ipEntity, ILE_ipEntity, Type
suppressionEnabled: true
description: |
    This query maps Lumen IP indicators of compromise (IOCs) from threat intelligence (TI), by searching for matches in Azure AD sign-in logs.
displayName: Lumen TI IPAddress in IdentityLogonEvents
tactics:
- CommandAndControl
requiredDataConnectors:
- connectorId: LumenThreatFeedConnector
  dataTypes:
  - ThreatIntelligenceIndicator
- connectorId: ThreatIntelligenceUploadIndicatorsAPI
  dataTypes:
  - ThreatIntelligenceIndicator
- connectorId: AzureActiveDirectory
  dataTypes:
  - AADNonInteractiveUserSignInLogs
  - AADServicePrincipalSignInLogs
  - AADManagedIdentitySignInLogs
  - ADFSSignInLogs
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Lumen Defender Threat Feed/Analytic Rules/Lumen_IPEntity_IdentityLogonEvents.yaml
severity: Medium
name: Lumen TI IPAddress in IdentityLogonEvents
suppressionDuration: 5h
triggerThreshold: 0
queryPeriod: 14d
query: |
  let dt_lookBack = 1d;  // Data lookback for AAD sign-in logs
  let ioc_lookBack = 14d; // TI lookback
  let IP_Indicators =
      ThreatIntelIndicators
      | where TimeGenerated >= ago(ioc_lookBack)
      | where IsActive == true and ValidUntil > now()
      | summarize LatestIndicatorTime = arg_max(TimeGenerated, *) by Id
      | where SourceSystem == 'Lumen'
      | where ObservableKey == 'ipv4-addr:value'
      | extend TI_ipEntity = ObservableValue
      | where ipv4_is_private(TI_ipEntity) == false and TI_ipEntity !startswith 'fe80' and TI_ipEntity !startswith '::' and TI_ipEntity !startswith '127.';
  let SignInUnion =
      union isfuzzy=true
      (
          AADNonInteractiveUserSignInLogs
          | where TimeGenerated >= ago(dt_lookBack)
          | extend
              ILE_ipEntity = IPAddress,
              AccountDisplayName = coalesce(UserDisplayName, UserPrincipalName),
              Application = coalesce(column_ifexists('AppDisplayName',''), column_ifexists('ResourceDisplayName','')),
              LogonType = column_ifexists('ClientAppUsed',''),
              IdentityLogonEvents_TimeGenerated = TimeGenerated
          | project IdentityLogonEvents_TimeGenerated, ILE_ipEntity, AccountDisplayName, Application, LogonType, IPAddress, Type
      ),
      (
          AADServicePrincipalSignInLogs
          | where TimeGenerated >= ago(dt_lookBack)
          | extend
              ILE_ipEntity = IPAddress,
              AccountDisplayName = coalesce(ServicePrincipalName, tostring(ServicePrincipalId)),
              Application = coalesce(column_ifexists('AppDisplayName',''), column_ifexists('ResourceDisplayName','')),
              LogonType = "ServicePrincipal",
              IdentityLogonEvents_TimeGenerated = TimeGenerated
          | project IdentityLogonEvents_TimeGenerated, ILE_ipEntity, AccountDisplayName, Application, LogonType, IPAddress, Type
      ),
      (
          AADManagedIdentitySignInLogs
          | where TimeGenerated >= ago(dt_lookBack)
          | extend
              ILE_ipEntity = IPAddress,
              AccountDisplayName = coalesce(ServicePrincipalName, tostring(ServicePrincipalId)),
              Application = ResourceDisplayName,
              LogonType = "ManagedIdentity",
              IdentityLogonEvents_TimeGenerated = TimeGenerated
          | project IdentityLogonEvents_TimeGenerated, ILE_ipEntity, AccountDisplayName, Application, LogonType, IPAddress, Type
      ),
      (
          ADFSSignInLogs
          | where TimeGenerated >= ago(dt_lookBack)
          | extend
              ILE_ipEntity = IPAddress,
              AccountDisplayName = coalesce(UserDisplayName, UserPrincipalName),
              Application = coalesce(AppDisplayName, ResourceDisplayName),
              LogonType = coalesce(Requirement, AuthenticationRequirement),
              IdentityLogonEvents_TimeGenerated = TimeGenerated
          | project IdentityLogonEvents_TimeGenerated, ILE_ipEntity, AccountDisplayName, Application, LogonType, IPAddress, Type
      );
  IP_Indicators
  | join kind=innerunique (SignInUnion) on $left.TI_ipEntity == $right.ILE_ipEntity
  | where IdentityLogonEvents_TimeGenerated < ValidUntil
  | summarize arg_max(IdentityLogonEvents_TimeGenerated, *), StartTime = min(IdentityLogonEvents_TimeGenerated), EndTime = max(IdentityLogonEvents_TimeGenerated) by Id, ILE_ipEntity
  | project timestamp = EndTime, StartTime, EndTime, AccountDisplayName, IPAddress, Application, LogonType, Id, Tags, ValidUntil, Confidence, TI_ipEntity, ILE_ipEntity, Type  
relevantTechniques:
- T1071
id: a7cd18cd-1503-47ec-8dca-65d750540637
queryFrequency: 4h
entityMappings:
- entityType: IP
  fieldMappings:
  - columnName: ILE_ipEntity
    identifier: Address
triggerOperator: gt
version: 1.0.2
kind: Scheduled