Skip to main content

addToBlocklist

Use this method to set up one or more rules that you can use to add items to blocklists.

Important

This method has been updated to version 1.2. For information applicable to version 1.0, refer to this section.

Version 1.0 is only compatible with hash type blocklist rules.

Parameters

Parameter

Description

Included in request

Type

Values

type

Indicates the type of rules you want to create.

Mandatory

String

Possible values:

  • hash

  • path

  • connection

rules

Contains the list of rules you want to create and their assigned settings.

Mandatory

Array of objects

You can only add rules that match the type specified in the type parameter.

Refer to rules.

These are common parameters, available across all public API methods:

Parameter

Description

Included in request

Type

Value requirements

id

This parameter adds an identifier to the request, linking it to its corresponding response.

The target replies with the same value in the response, allowing easy call tracking.

Mandatory

String

No additional requirements.

method

The name of the method you are using to send the request.

Mandatory

String

Must be a valid method name.

jsonrpc

The version of JSON-RPC used by the request and the response.

Mandatory

String

The only possible value is 2.0.

params

An object containing the configuration of the request.

Mandatory

Object

No additional requirements.

Objects

rules

Parameter

Description

Included in request

Type

Values

note

Describes this specific rule.

Optional

String

No additional requirements.

details

Identifies a specific rule and its settings.

Mandatory

Object

Refer to details.

details

Parameters available when type is hash:

Parameter

Description

Included in request

Type

Values

algorithm

The algorithm used to obtain the hash.

Mandatory

String

Possible values:

  • sha256

  • md5

hash

The hash associated with the file you want to block.

Mandatory

String

The hash value must conform to the format specified in the algorithm parameter.

Parameters available when type is connection:

Parameter

Description

Included in request

Type

Values

ruleName

The name under which the rule will be listed in the rules table (for example, the name of the application the rule applies to).

Mandatory

String

No additional requirements.

commandLine

If included, the rule applies only when an application is opened by using the command line interface with the specified command.

Optional when path is provided

Not available otherwise

String

No additional requirements.

protocol

If included, the rule applies only if a specific IP protocol is used by the connection.

Mandatory

String

Possible values:

  • any

  • TCP

  • UDP

  • A protocol from the list here (the Keyword column)

direction

The rule applies only to connections of a specific direction.

Mandatory

String

Possible values:

  • inbound

  • outbound

  • both

ipVersion

The rule applies only to connections to or from a specific IP type.

Mandatory

String

Possible values:

  • any

  • IPV4

  • IPV6

localAddress

If included, the rule applies only to connections to or from specific local network addresses.

Optional

Object

Refer to localAddress.

remoteAddress

If included, the rule applies only to connections to or from specific remote addresses.

Optional

Object

Refer to remoteAddress.

directlyConnected

If enabled, the rule applies only to connections to or from specific Mac addresses.

Optional

Object

Refer to directlyConnected.

operatingSystems

If included, the rule applies only to connections to or from endpoints using the specified operating systems.

Optional

Array of strings

Possible values for each element of the array:

  • windows

  • mac

Default value: ["windows"].

path

Determines which application the rule applies to.

Optional

String

No additional requirements.

hash

The MD5 of the application.

Optional when path is provided

Not available otherwise

String

No additional requirements.

Parameters available when type is path:

Parameter

Description

Included in request

Type

Values

path

All applications that are launched from the specified path are blocked.

Mandatory

String

The path format must match the operating system of the target endpoint. Must be a file absolute path.

localAddress

This object is only available if type is connection.

Parameter

Description

Included in request

Type

Values

any

If false, only connections originating from the address specified under the ipMask setting are blocked.

If true, all connections are blocked regardless of IP address.

Mandatory

Boolean

No additional requirements.

ipMask

If any is false, only connections to or from the address specified under this setting are blocked.

Optional when any is false

Not available otherwise

String

The value can be in an IP or an IP/Mask format.

portRange

If a range is used, only connections made through ports between these two values are blocked.

If specific ports are used, only connections made through ports are blocked.

Optional

String

No additional requirements.

remoteAddress

This object is only available if type is connection.

Parameter

Description

Included in request

Type

Values

any

If false, only connections originating from the address specified under the ipMask setting are blocked.

If true, all connections are blocked, regardless of IP address.

Mandatory

Boolean

No additional requirements.

ipMask

If any is false, only connections to or from the address specified under this setting are blocked.

Optional when any is false

Not available otherwise

String

The value can be in an IP or an IP/mask format.

portRange

If a range is used, only connections made through ports between these two values are blocked.

If specific ports are used, only connections made through ports are blocked.

Optional

String

No additional requirements.

directlyConnected

This object is only available if type is connection.

Parameter

Description

Included in request

Type

Values

enable

Indicates if this option is enabled.

Mandatory for Windows, optional for macOS

Boolean

No additional requirements.

remoteMac

Only connections from the specified Mac addresses are allowed.

Mandatory when enable is true

Not available otherwise

String

Must be in a valid Mac address format.

Return value

Attribute

Type

Description

result

Boolean

Indicates if the operation was successful.

Examples

Request

Response

{
  "id": "5087eab8-b74f-4a3e-85b3-4271e85890d5",
  "jsonrpc": "2.0",
  "result": true
}

Use this method to add one or more file hashes to the Blocklist.

Parameters

Parameter

Type

Optional

Description

hashType

Integer

No

The algorithm used to obtain the hash.

Possible values:

  • 1 - SHA256

  • 2 - MD5

hashList

Array of strings

No

An array containing several hashes.

All hashes must be of the type specified by the hashType parameter.

sourceInfo

String

No

A description for the hashes.

These are common parameters, available across all public API methods:

Parameter

Description

Included in request

Type

Value requirements

id

This parameter adds an identifier to the request, linking it to its corresponding response.

The target replies with the same value in the response, allowing easy call tracking.

Mandatory

String

No additional requirements.

method

The name of the method you are using to send the request.

Mandatory

String

Must be a valid method name.

jsonrpc

The version of JSON-RPC used by the request and the response.

Mandatory

String

The only possible value is 2.0.

params

An object containing the configuration of the request.

Mandatory

Object

No additional requirements.

Return value

This method returns a Boolean which is true if the operation was successful.

Example

Request:

{
    "id": "0df7568c-59c1-48e0-a31b-18d83e6d9810",
    "jsonrpc": "2.0",
    "method": "addToBlocklist",
    "params": {
        "hashType": 2,
        "hashList": [
            "5b7ac19bb1a43dfb107b23c6",
            "f696282aa4cd4f614aa995190cf442fe"
        ],
       "sourceInfo": "Added from public API"
    }
}   

Response:

{
    "id": "0df7568c-59c1-48e0-a31b-18d83e6d9810",
    "jsonrpc": "2.0",
    "result": true
}