Closed P1llus closed 4 years ago
Pinging @elastic/siem (Team:SIEM)
As of now I think pagination only supports setting HTTP headers, HTTP POST body parameters, or the full request URL. So we will need an enhancement (and possibly refactoring) to allow setting query parameters in the request URL.
Just a quickly written example, I feel state/pagination should support:
Closing this in favor of https://github.com/elastic/beats/issues/19486
Creating an initial issue for discussion based on comment from @andrewkroh
When querying an API there is a need to persist state between each API call. Currently we do not have the possibility to store state in the registry file, so this issue is to track different user stories that would be great to support in the future.
User story: Azure ATP Allows querying with URL parameters using ODATA queries documented: https://docs.microsoft.com/en-us/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-odata-samples
When starting up a beat for the first time, it will retrieve all events, and for each consequent event it would be nice to be able to track a value from the last ingested event to be used as a query filter.
Initial request:
https://api-eu.securitycenter.windows.com/api/alerts
Response:
Any new API calls could use a field of choice by the user. The field type could also be a choice for the user between int and date (with a date format if needed).
We then need a way to define where the value is to be inserted, in this example it would be a URL parameter in the GET request:
Based on the newest incidentId of the newest event:
https://api-eu.securitycenter.windows.com/api/alerts?$filter=incidentId+gt+2
Based on the newest alertCreationTime of the newest event:
https://api-eu.securitycenter.windows.com/api/alerts?$filter=alertCreationTime+gt+2020-05-12T17:50:48.5153821Z