Skip to content

Instantly share code, notes, and snippets.

@marcinantkiewicz
Created July 20, 2021 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcinantkiewicz/f0148aa5e79615f3bc5f0177e26ae38e to your computer and use it in GitHub Desktop.
Save marcinantkiewicz/f0148aa5e79615f3bc5f0177e26ae38e to your computer and use it in GitHub Desktop.
def get_detects():
# other parameters: for pagination: limit (max on page) and offset, and for ordering: sort. I want detections from last 5min.
parameters = {"filter":"last_behavior:>'now-5m'"}
d = detects.Detects(creds={ 'client_id': cid,'client_secret': key})
response = d.QueryDetects(parameters)
if response:
if response['body']['meta']['pagination']['total'] > 0:
return response['body']['resources']
else:
return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment