> For the complete documentation index, see [llms.txt](https://docs.onum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.onum.com/listeners/listener-integrations/pull-data-from-http-endpoints/pull-data-from-the-falcon-ng-siem-api/incidents.md).

# Incidents

## Overview

Get a list of Falcon NG-SIEM incidents through the [Falcon API](https://developer.crowdstrike.com/api-reference/collections/alerts/#getqueriesalertsv2) using the **HTTP Pull** Listener.

## HTTP Pull Listener configuration

In Falcon Onum, go to the **Listeners** area and click **New Listener > HTTP Pull**. Give a name to your new Listener and enter the following data:

### Parameters

Add the following parameter:

* **Name** - `domain`
* **Value** - Enter your Falcon NG-SIEM domain name.

### Secrets

You must define these credentials in Onum:

* `client_id` will reference your Falcon NG-SIEM client ID.
* `client_secret` will reference your Falcon NG-SIEM client secret.

To do it, click **Add element** and enter a **Name** for the secret (in this case, `client_id`). Then, click the **Value** field and select **New secret** to create a new one:

* Give the secret a **Name**.
* Turn off the **Expiration date** option.
* Click **Add new value** and paste the secret corresponding to the value.
* Click **Save**.

You can now select the secret you just created in the **Value** field list. Repeat the process for the `client_secret`.

{% hint style="info" %}
Learn more about secrets in Onum in [this article](/settings/organization-settings/secrets-management.md).
{% endhint %}

### Setup

After entering the required parameters and secrets, you can choose to manually enter the rest of configuration fields, or simply paste the given YAML:

{% tabs %}
{% tab title="Config as YAML" %}
Toggle **ON** the **Config as YAML** option to enable a free text field where you can paste the following YAML:

```yaml
withTemporalWindow: true
temporalWindow:
  duration: 5m
  offset: 5m
  tz: UTC
  format: RFC3339
withAuthentication: true
authentication:
  type: token
  token:
    request:
      method: POST
      url: ${parameters.domain}/oauth2/token
      headers:
        - name: Content-Type
          value: application/x-www-form-urlencoded
      bodyType: urlEncoded
      bodyParams:
        - name: grant_type
          value: client_credentials
        - name: client_id
          value: '${secrets.client_id}'
        - name: client_secret
          value: '${secrets.client_secret}'
    tokenPath: ".access_token"
    authInjection:
      in: header
      name: Authorization
      prefix: 'Bearer '
      suffix: ''
withEnumerationPhase: true
enumerationPhase:
  paginationType: offsetLimit
  limit: 100
  request:
    responseType: json
    method: GET
    url: ${parameters.domain}/incidents/queries/incidents/v1
    queryParams:
      - name: offset
        value: ${pagination.offset}
      - name: limit
        value: ${pagination.limit}
      - name: filter
        value: start:>='${temporalWindow.from}'+end:<'${temporalWindow.to}'
  output:
    select: ".resources"
    map: "."
    outputMode: collection
collectionPhase:
  variables:
    - source: input
      name: resources
      expression: "."
      format: "json"
  paginationType: none
  request:
    method: POST
    url: ${parameters.domain}/incidents/entities/incidents/GET/v1
    headers:
      - name: Accept
        value: application/json
      - name: Content-Type
        value: application/json
    responseType: json
    bodyType: raw
    bodyRaw: |
      {
        "ids": ${inputs.resources}
      }
  output:
    select: ".resources"
    map: "."
    outputMode: element
```

{% endtab %}

{% tab title="Manually configure" %}
**Temporal Window**

Toggle **ON** to add a temporal window for events. This repeatedly shifts the time window over which data is collected.

* **Duration**<mark style="color:$primary;">**\***</mark> - `5m`
* **Offset**<mark style="color:$primary;">**\***</mark> - `5m`
* **Format**<mark style="color:$primary;">**\***</mark> - `RFC3339`

**Authentication**

Toggle **ON** to configure the authentication phase. This is required to get the token to pull data using **OAuth**.

* **Type**<mark style="color:red;">**\***</mark> - `Token`
* **Token Retrieve Based Authentication**
  * **Request**
    * **Request Method**<mark style="color:red;">**\***</mark> - `POST`
    * **URL**<mark style="color:red;">**\***</mark> - `${parameters.domain}/oauth2/token`
  * **Headers**&#x20;
    * **Name** - `Content-type`
    * **Value** - `application/x-www-form-urlencoded`
  * **Body Type**<mark style="color:red;">**\***</mark> - `UrlEncoded`
  * **Body params**
    * **Name** - `grant_type`
    * **Value** - `client_credentials`
    * **Name** - `client_id`
    * **Value** - `${secrets.client_id}`
    * **Name** - `client_secret`
    * **Value** - `${secrets.client_secret}`
* **Token Path**<mark style="color:red;">**\***</mark> - `.access_token`
* **Auth Injection**
  * **In**<mark style="color:red;">**\***</mark> - `header`
  * **Name**<mark style="color:red;">**\***</mark> - `authorization`
  * **Prefix** - `'Bearer '`
  * **Suffix** - `''`

**Enumeration Phase**

Toggle **ON** to configure the enumeration phase. This API endpoint requires an initial request that will provide a list of alert ids. In order to get the details about that information, it will require an additional request for those details.

* **Pagination Type**<mark style="color:red;">**\***</mark> - `Offset/Limit`
* **Zero index**<mark style="color:red;">**\***</mark> - `false`
* **Limit**<mark style="color:red;">**\***</mark> - `100`&#x20;
* **Request**&#x20;
  * **Response Type**<mark style="color:red;">**\***</mark> - `JSON`
  * **Method**<mark style="color:red;">**\***</mark> - `GET`
  * **URL**<mark style="color:red;">**\***</mark> - `${parameters.domain}/incidents/queries/incidents/v1`
* **Query Params**&#x20;
  * **Name** - `offset`&#x20;
  * **Value** - `${pagination.offset}`
  * **Name** - `limit`
  * **Value** - `${pagination.limit}`
  * **Name** - `filter`
  * **Value** - `start:>='${temporalWindow.from}'+end:<'${temporalWindow.to}'`
* **Output**&#x20;
  * **Select**<mark style="color:$primary;">**\***</mark> - `.resources`
  * **Map** - `.`
  * **Output Mode**<mark style="color:$primary;">**\***</mark> - `collection`

**Collection Phase**&#x20;

* **Inputs**
  * **Name** - `resources`
  * **Expression** - `.`
  * **Format** - `json`
* **Pagination Type**<mark style="color:red;">**\***</mark> - `None`
* **Request**&#x20;
  * **Response type**<mark style="color:$primary;">**\***</mark> - `JSON`
  * **Method**<mark style="color:red;">**\***</mark> - `POST`
  * **URL**<mark style="color:red;">**\***</mark> - `${parameters.domain}/incidents/entities/incidents/GET/v1`
  * **Headers**
    * **Name** - `Accept`
    * **Value** - `application/json`
    * **Name** - `Content-Type`
    * **Value** - `application/json`
  * **Body type**<mark style="color:$primary;">**\***</mark> - `Raw`
    * **Body Content**<mark style="color:$primary;">**\***</mark>

```
{
  "ids": ${inputs.resources}
}
```

* **Output**&#x20;
  * **Select**<mark style="color:$primary;">**\***</mark> - `.resources`
  * **Map -** `.`
  * **Output Mode**<mark style="color:$primary;">**\***</mark> - `element`
    {% endtab %}
    {% endtabs %}

When you're done, click **Create labels** to move on to the next step and define the required [Labels](/listeners/labels.md) if needed.
