FROM logs-okta*
| WHERE
event.dataset == "okta.system"
AND (event.action RLIKE "user\\.authentication(.*)" OR event.action == "user.session.start")
AND okta.security_context.is_proxy != true and okta.actor.id != "unknown"
AND event.outcome == "success"
| KEEP event.action, okta.security_context.is_proxy, okta.actor.id, event.outcome, client.geo.country_name, okta.actor.alternate_id
| STATS
geo_auth_counts = COUNT_DISTINCT(client.geo.country_name)
BY okta.actor.id, okta.actor.alternate_id
| WHERE
geo_auth_counts >= 2
Install detection rules in Elastic Security
Detect Okta User Sessions Started from Different Geolocations in the Elastic Security detection engine by installing this rule into your Elastic Stack.
To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(opens in a new tab or window).