createCustomRule
Method to create a custom rule.
Parameters
Parameter | Description | Included in request | Type | Values |
|---|---|---|---|---|
| The ID of the company the custom rule will belong to. | Optional | String | Must be the valid ID of a company that you manage. Default value: The ID of the company the API key used to make the request. |
| The type of the rule to be created. | Optional | Integer | Possible values:
Default value: |
| The name of the rule to be created. | Mandatory | String | This parameter cannot begin with a whitespace character, cannot include the characters Also, it cannot be duplicated within the same company. |
| The description of the rule. | Optional | String | This parameter cannot begin with a whitespace character, cannot include the characters |
| The list of associated rule tags. | Optional | Array of Strings | Each string must:
|
| Contains the settings associated with the rule. | Mandatory | Object | Refer to |
| Indicates if the request will return the ID of the new rule. | Optional | Boolean | Possible values:
Default value: |
| Contains | Optional | Object | Refer to |
These are common parameters, available across all public API methods:
Parameter | Description | Included in request | Type | Values |
|---|---|---|---|---|
| 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. |
| The name of the method you are using to send the request. | Mandatory | String | Must be a valid method name. |
| The version of JSON-RPC used by the request and the response. | Mandatory | String | Possible values:
|
| An object containing the configuration of the request. | Mandatory | Object | No additional requirements. |
Objects
settings
Name | Description | Included in request | Type | Values |
|---|---|---|---|---|
| Indicates if the rule is active. | Optional | Integer | Possible values:
Default value: |
| Indicates the severity of the alerts that will be generated. | Mandatory for detection rules; not applicable to exclusion rules. | Integer | Possible values:
|
| Indicates the type of the target entity. | Mandatory | String | Possible values for custom exclusion and detection rules:
Possible values available only for custom exclusion rules:
|
| Defines the rule by listing the exclusion or detection sub-rules that the specified ImportantThis parameter does not include definitions related to the | Mandatory | Array of Objects | Each object contains the following settings:
NoteFor information on the possible values of |
| Contains the exclusion or detection sub-rules related to the | Optional | Array of Objects ImportantIt is an array containing a single object, as only one | The object within the array contains the following settings:
NoteFor information on the |
| Indicates the automatic response actions and their enablement status for EDR incidents generated by this rule. Important
| Optional for EDR detection rules; not applicable to exclusion rules or XDR detection rules. | Array of Objects | Each object contains the following settings:
|
targets
Name | Description | Included in request | Type | Values |
|---|---|---|---|---|
| The IDs of the companies to which the custom rule applies. | Optional | Array of Strings | Default value: a list with one entry, representing your company ID. |
Return value
This method returns either the ID of the newly created rule (String) or a Boolean value which is true if the creation of the custom rule was successful.
Example
Request:
{
"params": {
"companyId": "669fa6bb98b4ed9eb90b85b2",
"type": 1,
"name": "Detection Rule via API",
"description": "Detection Rule via API Description",
"settings": {
"status": 0,
"severity": 1,
"target": "file",
"automaticActions": [
{
"type": 1,
"enabled": true
}
],
"criteriaList": [
{
"field": "File.Name",
"relation": "is",
"value": "abcd"
}
],
"filters": [
{
"field": "detection",
"value": "test-api"
}
]
},
"targets": {
"companiesIds": [
"61827b8036492c2fc0718722",
"61827b8036492c2fc0718722"
]
},
"returnRuleId": true
},
"jsonrpc": "2.0",
"method": "createCustomRule",
"id": "0df7568c-59c1-48e0-a31b-18d83e6d9810"
}Response:
{
"id": "0df7568c-59c1-48e0-a31b-18d83e6d9810",
"jsonrpc": "2.0",
"result": "6372b7a3897aaa77ee021642"
}