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
target_auth_count = COUNT_DISTINCT(okta.actor.id)
BY okta.debug_context.debug_data.dt_hash, okta.actor.alternate_id
| WHERE
target_auth_count > 20
| SORT
target_auth_count 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).