from logs-okta*
| where
event.dataset == "okta.system" and
(event.action rlike "user\.authentication(.*)" or event.action == "user.session.start") and
okta.debug_context.debug_data.dt_hash != "-" and
okta.outcome.reason == "INVALID_CREDENTIALS"
| keep
event.action,
okta.debug_context.debug_data.dt_hash,
okta.actor.id,
okta.actor.alternate_id,
okta.outcome.reason
| stats
Esql.okta_actor_id_count_distinct = count_distinct(okta.actor.id)
by
okta.debug_context.debug_data.dt_hash,
okta.actor.alternate_id
| where
Esql.okta_actor_id_count_distinct > 20
| sort
Esql.okta_actor_id_count_distinct desc
Install detection rules in Elastic Security
Detect Multiple Okta User Authentication Events with Same Device Token Hash 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).