↳ GitHub sourceAnalytics ruleMedium

GitHub Activites from a New Country

Description

'Detect activities from a location that was not recently or was never visited by the user or by any user in your organization.'
Rule type
Scheduled
Version
1.0.1
Declared status
Available
Query frequency
1d
Query period
7d
Trigger
gt 0

Declared MITRE coverage

KQL query

Original query, unchanged.

let LearningPeriod = 7d;
let RunTime = 1h;
let StartTime = 1h;
let EndRunTime = StartTime - RunTime;
let EndLearningTime = StartTime + LearningPeriod;
let GitHubCountryCodeLogs = (GitHubAuditData
| where Country != "");
  GitHubCountryCodeLogs
| where TimeGenerated between (ago(EndLearningTime) .. ago(StartTime))
| summarize makeset(Country) by Actor
| join kind=innerunique (
  GitHubCountryCodeLogs
  | where TimeGenerated between (ago(StartTime) .. ago(EndRunTime))
  | distinct Country, Actor, TimeGenerated
) on Actor 
| where set_Country !contains Country
| extend timestamp = TimeGenerated
| extend AccountName = tostring(split(Actor, "@")[0]), AccountUPNSuffix = tostring(split(Actor, "@")[1])

Declared entities

Account

Related content

Links established from declared identifiers and solution manifests.

Source provenance

GitHub

Displayed values come from files in Azure/Azure-Sentinel. They describe the published template, not your workspace configuration.

Source identifier
f041e01d-840d-43da-95c8-4188f6cef546
Additional source files 2Solutions/GitHub/Analytic Rules/GitHub - Activities from Infrequent Country.yamlsource ↗Solutions/GitHub/data/Solution_GitHub.jsonsolution-membership ↗
GSTEP / CATALOG TRACKING

Added to catalog : 16 Sept 2026 · 05:49 UTC
Last change observed : 16 Sept 2026 · 05:49 UTC

GSTEP sync dates, separate from the source content’s publication dates.