Get Violations

Cortex XDR REST API

post /public_api/v1/device_control/get_violations

Gets a list of device control violations filtered by selected fields. You can retrieve up to 100 violations.

When filtering by multiple fields: - Response is concatenated using AND condition (OR is not supported). - Maximum result set size is 100. - Offset is the zero-based number of incidents from the start of the result set.

Required license: Cortex XDR Prevent or Cortex XDR Pro per Endpoint

Body parameters
request_dataObject

An empty object returns all results.

filtersArray

Provides an array of filter fields.

fieldString (Enum)

String that identifies the violation field the filter is matching. Filters are based on the following keywords: - endpoint_id_list: List of endpoint IDs. - type: Type of violation. - timestamp: Timestamp of the violation. - ip_list: List of IP addresses. - vendor: Name of vendor. - vendor_id: Vendor ID. - product: Name of product. - product_id: Product ID. - serial: Serial number. - hostname: Hostname. - violation_id_list: List of violation IDs. - username: Username.

Allowed values:"endpoint_id_list""type""timestamp""ip_list""vendor""vendor_id""product""product_id""serial""hostname""violation_id_list""username"
operatorString (Enum)

String that identifies the comparison operator you want to use for this filter. Valid keywords are: in — Permitted for all fields except timestamp. gte / lte — Permitted only for timestamp.

Allowed values:"in""gte""lte"
valueArray integer string

Value that this filter must match. The contents of this field will differ depending on the violation field that you specified for this filter: - timestamp: Integer, in UTC timezone epoch milliseconds - violation_id_list: List of integers - ip_list: Must contain an IP string - type: Must be either cd-rom, disk drive, floppy disk, portable device - All other fields need to be list of strings.

search_fromInteger

Integer representing the starting offset within the query result set from which you want violations returned. Violations are returned as a zero-based list. Any violation indexed less than this value is not returned in the final result set and defaults to zero.

search_toInteger

An integer representing the end of offset within the result set after which you do not want violations returned. Violations in the violation list that are indexed higher than this value are not returned in the final results set. Defaults to zero, which returns all alerts to the end of the list.

sortObjectrequired

Identifies the sort order for the result set.

fieldString (Enum)

The field you want to sort by.

Allowed values:"endpoint_id_list""type""timestamp""ip_list""vendor""vendor_id""product""product_id""serial""hostname""violation_id_list""username"
valueString (Enum)

Can be either asc (ascending) or desc (descending).

Allowed values:"asc""desc"
REQUEST BODY
{ "request_data": {} }
CURL
curl -X 'POST'
-H 'Accept: application/json'
-H 'Content-Type: application/json'
'https://api-yourfqdn/public_api/v1/device_control/get_violations'
-d ''
Responses

Successful response

Body
replyObject
total_countInteger

Number of total results of this filter without paging.

result_countInteger

Number of alerts actually returned as a result.

violationsArray[None]
RESPONSE
{ "example-1": { "reply": { "total_count": 10, "result_count": 1, "violations": [ { "hostname": "<host name>", "username": "test", "ip": "<IP address>", "timestamp": 1576260019000, "violation_id": 11, "type": "Disk Drive", "vendor_id": "<vendor ID>", "vendor": "<vendor name>", "product_id": "<product ID>", "product": "<product name>", "serial": "<serial number>", "endpoint_id": "<endpoint ID>" } ] } } }

Bad Request. Got an invalid JSON.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

Unauthorized access. An issue occurred during authentication. This can indicate an incorrect key, id, or other invalid authentication parameters.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

Unauthorized access. User does not have the required license type to run this API.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

Forbidden access. The provided API Key does not have the required RBAC permissions to run this API.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }

Internal server error. A unified status for API communication type errors.

Body
err_codeString

HTTP response code.

err_msgString

Error message.

Example:"{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}"
err_extraString

Additional information describing the error.

RESPONSE
{ "err_code": "err_code_example", "err_msg": "{\"line\": 1, \"column\": 19, \"message\": \"no viable alternative at input '|alter2'\"}", "err_extra": "err_extra_example" }