elastic / detection-rules

https://www.elastic.co/guide/en/security/current/detection-engine-overview.html
Other
1.92k stars 492 forks source link

[New Hunt] Detect users authenticating with Okta to more than 10 unique apps within a 5 minute period (with app details) #4100

Open brokensound77 opened 2 weeks ago

brokensound77 commented 2 weeks ago

Description

Detect users authenticating with Okta to more than 10 unique apps within a 5 minute period. This is meant to detect Discovery or Lateral Movement attempts.

This is being submitted as a hunt since values is still beta and considered risky for performance. A rule version using count_distinct (which loses app details) is being tracked under: #4099

Related rules

Target Ruleset

okta

Target Rule Type

ES|QL

Query

from logs-okta*
| where event.action == "user.authentication.sso"
| stats unique_apps = mv_dedupe(values(okta.target_app.display_name)) by user.email
| eval total_apps = mv_count(unique_apps)
| where total_apps > 10
| sort total_apps desc

New fields required in ECS/data sources for this rule?

No response

Related issues or PRs

No response

References

No response

Redacted Example Data

No response