elastic / elastic/detection-rules

[New Rule] Detect users authenticating with Okta to more than 10 unique apps within a 5 minute period

Open
#4,099 1 comment 0 reactions 1 assignee Claimed by @brokensound77 View on GitHub
backlog Integration: Okta Rule: New Team: TRADE
Dominant language
Python
Stars
2.7k
Forks
696
Avg merge
4d 17h
Merged PRs (30d)
87

Description

### 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 approach will be done with `count_distinct`, but at the cost of losing app details. A version with app details will be created as a hunt (#4100) until `values` is performant enough to create a prod rule with. This can also be done with a threshold rule, since `values` is still beta and considered risky for performance. (This could also be a threshold rule)

### Related rules

* 4edd3e1a-3aa0-499b-8147-4d2ea43b1613 okta Unauthorized Access to an Okta Application

### Target Ruleset

okta

### Target Rule Type

ES|QL

### Tested ECS Version

_No response_

### Query

```sql
from logs-okta*
| where event.action == "user.authentication.sso"
| stats total_apps = count_distinct(okta.target_app.display_name) by user.email
| 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.