LoFP LoFP / it is possible that there are legitimate user roles making new or infrequently used api calls in your infrastructure, causing the search to trigger.

Techniques

Sample rules

Detect new API calls from user roles

Description

This search detects new API calls that have either never been seen before or that have not been seen in the previous hour, where the identity type is AssumedRole.

Detection logic

`cloudtrail` eventType=AwsApiCall errorCode=success userIdentity.type=AssumedRole [search `cloudtrail` eventType=AwsApiCall errorCode=success  userIdentity.type=AssumedRole 
| stats earliest(_time) as earliest latest(_time) as latest by userName eventName 
|  inputlookup append=t previously_seen_api_calls_from_user_roles 
| stats min(earliest) as earliest, max(latest) as latest by userName eventName 
| outputlookup previously_seen_api_calls_from_user_roles
| eval newApiCallfromUserRole=if(earliest>=relative_time(now(), "-70m@m"), 1, 0) 
| where newApiCallfromUserRole=1 
| `security_content_ctime(earliest)` 
| `security_content_ctime(latest)` 
| table eventName userName]  
|rename userName as user
| stats values(eventName) earliest(_time) as earliest latest(_time) as latest by user 
| `security_content_ctime(earliest)` 
| `security_content_ctime(latest)` 
| `detect_new_api_calls_from_user_roles_filter`