Scan Endpoints

Run a scan on endpoints.

Synopsis

URI
/public_api/v1/endpoints/scan/
HTTP Method
POST
Required License
Cortex XDR Prevent or Cortex XDR Pro per Endpoint

Description

Run a scan on selected endpoints.
  • Response is concatenated using AND condition (OR is not supported).
  • Offset is the zero-based number of incidents from the start of the result set.

Request Fields

The body of this request contains a JSON object with the following fields:
You can send a request to retrieve either
all
or
filtered
results.
Field
Description
request_data
(
Required
) A dictionary containing the API request fields.
filters
(
Required
) Scan all endpoints or according to filters.
To scan all endpoints:
  • all
Provides an array of filtered fields. Each JSON object must contain the following keywords:
  • field
    String that identifies a list the filters match. Filters are based on the following keywords:
    • endpoint_id_list
      —List of endpoint IDs.
    • dist_name
      —Name of the distribution list.
    • first_seen
      —When an endpoint was first seen.
    • last_seen
      —When an endpoint was last seen.
    • ip_list
      —List of IP addresses.
    • group_name
      —Name of endpoint group.
    • platform
      —Type of operating system.
    • alias
      —Endpoint alias name.
    • isolate
      —If an endpoint has been isolated.
    • hostname
      —Name of host.
  • operator
    String that identifies the comparison operator you want to use for this filter. Valid keywords and values are:
    in
    • endpoint_id_list
      ,
      dist_name
      ,
      group_name
      ,
      alias
      ,
      hostname
      ,
      username
      —List of strings
    • ip_list
      —List of strings, for example
      192.168.5.12
    • platform
      windows
      ,
      linux
      ,
      macos
      ,
      android
    • isolate
      isolated
      or
      unisolated
    • scan_status
      none
      ,
      pending
      ,
      in_progress
      ,
      canceled
      ,
      aborted
      ,
      pending_cancellation
      ,
      success
      , or
      error
    gte
    /
    lte
    • first_seen
      and
      last_seen
      — Integer in timestamp epoch milliseconds
  • value
    Value that this filter must match. Valid keywords:
    • first_seen
      ,
      last_seen
      —Integer representing the number of milliseconds after the Unix epoch, UTC timezone.
    • endpoint_id_list
      ,
      dist_name
      ,
      hostname
      ,
      alias
      ,
      group_name
      —List of strings
    • ip_list
      - Must contain an IP address string
    • isolate
      - Must be
      isolated
      or
      unisolated
      .
    • platform
      - Must be either
      windows
      ,
      linux
      ,
      macos
      , or
      android
      .
Request Example
To scan all endpoints:
curl -X POST https://api-{fqdn}/public_api/v1/endpoints/scan/ \ -H "x-xdr-auth-id:{API_KEY_ID}" \ -H "Authorization:{API_KEY}" \ -H "Content-Type:application/json" \ -d '{ "request_data":{ "filters": "all" } }'
To scan filtered endpoints:
curl -X POST https://api-{fqdn}/public_api/v1/endpoints/scan/ \ -H "x-xdr-auth-id:{API_KEY_ID}" \ -H "Authorization:{API_KEY}" \ -H "Content-Type:application/json" \ -d '{ "request_data":{ "filters":[ { "field":"endpoint_id_list", "operator":"in", "value":[ "<endpoint ID>" ] }, { "field":"dist_name", "operator":"in", "value":[ "WinInstaller" ] }, { "field":"group_name", "operator":"in", "value":[ test" ] }, { "field":"scan_status", "operator":"in", "value":[ "none", "pending", "in_progress", "pending_cancellation", "aborted", "success" ] }, { "field":"group_name", "operator":"in", "value":[ "test" ] } ] } }'

Success Response

Upon success, the HTTP response code is 200.
Field
Description
reply
JSON object containing the query result.
action_id
ID of action to scan selected endpoints.
Response only indicates the request was successfully sent to the endpoint. To track if the scan was successful either:
  • In Cortex XDR console, navigate to
    Response
    Action Center
    All Actions
    and search for the action ID. Make sure the
    Action ID
    field is selected in the table
    Layout
    settings by selecting ( ).
  • Send a Get Action Status request.
status
Integer representing whether the action:
  • 1
    —succeeded
  • 0
    —failed
endpoints_count
Number of endpoints included in the request.
Success Response Example
{ "reply": { "action_id":"<action ID>", "status": "1", "endpoints_count": "673" } }

Error Response

Upon error, the reply includes an HTTP response code, an error message, and additional information describing the error. The HTTP response code is one of the following:
Field
Description
400
Bad Request. Got an invalid JSON.
401
Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.
402
Unauthorized access. User does not have the required license type to run this API.
403
Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.
500
Internal server error. A unified status for API communication type errors.
Error Response Format
{"reply": {"err_code": STATUS_CODE, "err_msg": GENERAL_MESSAGE, "err_extra": EXTRA_DATA}}

Recommended For You