Get Malware Counts

Endpoint URL: https://<your server>/rest/malware/counts
Endpoint URI: malware/counts

Action: POST

Returns a count of each type of malware.

Note

Ensure that you have logged into the Cybereason platform. For details, see Log in with the API.

Request Headers

You must add an Content-Type:application/json header with the request.

Note

If you are using cURL, add the authorization cookie details or the path to the file with cookie details with every request.


Request Body

Input: JSON

Download JSON syntax file

Depending on your browser settings, this linked file may open in a separate tab instead of downloading directly to your machine. If this happens, use the Save As option in your browser to save the file locally.

{
              "compoundQueryFilters": [
                                        {
                                          "filters":[
                                                      {
                                                        "fieldName":"needsAttention",
                                                        "operator":"Is",
                                                        "values":[true]
                                                      }
                                                    ],
                                          "filterName":"needsAttention"
                                        },
                                        {
                                          "filters":[
                                                      {
                                                        "fieldName":"type",
                                                        "operator":"Equals",
                                                        "values":["KnownMalware"]
                                                      },
                                                      {
                                                        "fieldName":"needsAttention",
                                                        "operator":"Is",
                                                        "values":[false]
                                                      }
                                                    ],
                                          "filterName":"KnownMalware"
                                        },
                                        {
                                          "filters":[
                                                      {
                                                        "fieldName":"type",
                                                        "operator":"Equals",
                                                        "values":["UnknownMalware"]
                                                      },
                                                      {
                                                        "fieldName":"needsAttention",
                                                        "operator":"Is",
                                                        "values":[false]
                                                      }
                                                    ],
                                          "filterName":"UnknownMalware"
                                        },
                                        {
                                          "filters":[
                                                      {
                                                        "fieldName":"type",
                                                        "operator":"Equals",
                                                        "values":["FilelessMalware"]
                                                      },
                                                      {
                                                        "fieldName":"needsAttention",
                                                        "operator":"Is",
                                                        "values":[false]
                                                      }
                                                    ],
                                            "filterName":"FilelessMalware"
                                        },
                                        {
                                          "filters":[
                                                      {
                                                        "fieldName":"type",
                                                        "operator":"Equals",
                                                        "values":["ApplicationControlMalware"]
                                                      },
                                                      {
                                                        "fieldName":"needsAttention",
                                                        "operator":"Is",
                                                        "values":[false]
                                                      }
                                                    ],
                                          "filterName":"ApplicationControlMalware"
                                        }
                                      ]
            }

Note

When sending this request, there may be a delay in returning a response, depending on how much data and activity is in your system. Ensure you do not send this request multiple times while waiting for response as this may cause unexpected results and performance issues in your environment.

If you want to return fewer types of malware, you can remove the necessary filters object from the template above.

In addition, if you are trying to retrieve types of malware other than the Needs Attention type, you must add multiple objects in the filters object as seen above.


Request Parameters

URL/URI parameters: none

Body Parameters: Use the following fields in the request. Required parameters are noted in bold.

Parameter

Type

Description

compoundQueryFilters

Array

Object containing data on the Malware. For details, see the description of the fields below.

filters

Array

A description of the filter for the Malware type.

fieldName

String

The type of Malware for which to retrieve data. Possible values include:

  • needsAttention

  • type

operator

Enum

The operator to use for the field. Use these values:

  • If you enter needsAttention in the fieldName parameter, use the Is operator.

  • If you enter type in the fieldName parameter, use the Equals operator.

values

String

Indicates the value to use with the fieldName parameter.

The values differ depending on the type of malware:

  • If the fieldName parameter is set to needsAttention, enter true or false.

  • If the fieldName parameter is set to type, use a Malware type, such as KnownMalware, UnknownMalware, FilelessMalware, ApplicationControlMalware or RansomwareMalware.

filterName

String

The name of the specific filter. Use needsAttention for the Needs Attention Malware, and the same name as the value field for other types of Malware.


Response Status Codes

This request can return the following status codes:

  • 200: Success OK


Response Success Schema

The response contains the following fields:

Field

Type

Description

data

Array

An object containing the data about the malwares.

malwareCountFilters

Array

An object containing the details of the individual filters.

filter

String

The name of the filter specified in the filterName field in the request.

count

Integer

The number of malware items returned for this filter.

totalCount

Integer

The total number of malware instances returned.

status

Enum

The status of the query.

message

String

Any message attached to the query.


Important Response Fields

Important information is found in these fields:

  • filter parameter: The type of malware. Each type of malware should have a filter parameter.

  • count parameter: The number of instances of malware for that type.


Example: Return counts of different types of malware

Request

curl --request POST \
    --url https://12.34.56.78/rest/malware/counts \
    --header 'Content-Type:application/json' \
    --data '{
              "compoundQueryFilters": [
                    {
                      "filters":[
                                  {
                                    "fieldName":"needsAttention",
                                    "operator":"Is",
                                    "values":[true]
                                  }
                                ],
                      "filterName":"needsAttention"
                    },
                    {
                      "filters":[
                                  {
                                    "fieldName":"type",
                                    "operator":"Equals",
                                    "values":["KnownMalware"]
                                  },
                                  {
                                    "fieldName":"needsAttention",
                                    "operator":"Is",
                                    "values":[false]
                                  }
                                ]
                      "filterName":"KnownMalware"
                    },
                    {
                      "filters":[
                                  {
                                    "fieldName":"type",
                                    "operator":"Equals",
                                    "values":["UnknownMalware"]
                                  },
                                  {
                                    "fieldName":"needsAttention",
                                    "operator":"Is",
                                    "values":[false]
                                  }
                                ],
                      "filterName":"UnknownMalware"
                    },
                    {
                      "filters":[
                                  {
                                    "fieldName":"type",
                                    "operator":"Equals",
                                    "values":["FilelessMalware"]
                                  },
                                  {
                                    "fieldName":"needsAttention",
                                    "operator":"Is",
                                    "values":[false]
                                  }
                                ],
                        "filterName":"FilelessMalware"
                    },
                    {
                      "filters":[
                                  {
                                    "fieldName":"type",
                                    "operator":"Equals",
                                    "values":["ApplicationControlMalware"]
                                  },
                                  {
                                    "fieldName":"needsAttention",
                                    "operator":"Is",
                                    "values":[false]
                                  }
                                ],
                      "filterName":"ApplicationControlMalware"
                    }
                  ]
            }'

Response

{
  "data": {
      "malwareCountFilters": [
          {
              "filter": "needsAttention",
              "count": 0
          },
          {
              "filter": "KnownMalware",
              "count": 528
          },
          {
              "filter": "UnknownMalware",
              "count": 1975
          },
          {
              "filter": "FilelessMalware",
              "count": 3043
          },
          {
              "filter": "ApplicationControlMalware",
              "count": 0
          }
      ],
      "totalCount": 5546
  },
  "status": "SUCCESS",
  "message": ""
}