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

User Login from Different Countries within 3 hours

Back
Id2954d424-f786-4677-9ffc-c24c44c6e7d5
RulenameUser Login from Different Countries within 3 hours
DescriptionThis query searches for successful user logins to the Okta Console from different countries within 3 hours.
SeverityHigh
TacticsInitialAccess
TechniquesT1078.004
Required data connectorsOktaSSO
OktaSSOv2
KindScheduled
Query frequency3h
Query period3h
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Okta Single Sign-On/Analytic Rules/LoginfromUsersfromDifferentCountrieswithin3hours.yaml
Version1.1.1
Arm template2954d424-f786-4677-9ffc-c24c44c6e7d5.json
Deploy To Azure
let timeframe = ago(3h);
let threshold = 2;
OktaSSO
| where column_ifexists('published_t', now()) >= timeframe
| where eventType_s =~ "user.session.start"
| where outcome_result_s =~ "SUCCESS"
| summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), NumOfCountries = dcount(column_ifexists('client_geographicalContext_country_s', int(null))) by actor_alternateId_s
| where NumOfCountries >= threshold
triggerThreshold: 0
entityMappings:
- entityType: Account
  fieldMappings:
  - identifier: FullName
    columnName: actor_alternateId_s
requiredDataConnectors:
- dataTypes:
  - Okta_CL
  connectorId: OktaSSO
- dataTypes:
  - OktaSSO
  connectorId: OktaSSOv2
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Okta Single Sign-On/Analytic Rules/LoginfromUsersfromDifferentCountrieswithin3hours.yaml
name: User Login from Different Countries within 3 hours
relevantTechniques:
- T1078.004
status: Available
version: 1.1.1
queryPeriod: 3h
kind: Scheduled
id: 2954d424-f786-4677-9ffc-c24c44c6e7d5
query: |
  let timeframe = ago(3h);
  let threshold = 2;
  OktaSSO
  | where column_ifexists('published_t', now()) >= timeframe
  | where eventType_s =~ "user.session.start"
  | where outcome_result_s =~ "SUCCESS"
  | summarize StartTime = min(TimeGenerated), EndTime = max(TimeGenerated), NumOfCountries = dcount(column_ifexists('client_geographicalContext_country_s', int(null))) by actor_alternateId_s
  | where NumOfCountries >= threshold  
description: |
    'This query searches for successful user logins to the Okta Console from different countries within 3 hours.'
queryFrequency: 3h
severity: High
triggerOperator: gt
tactics:
- InitialAccess