Update a rule

Prev Next
Patch
/v1/triage/rules/{id}

Applies a partial update to a rule. Only the fields sent, or those named in update_mask, are modified; all others are left unchanged. Setting priority moves the rule. An update applies all its fields or none of them.

Security
HTTP
Type bearer
Path parameters
id
stringRequired

The ID of the rule to update. This property is required.

Body parameters
Expand All
object
update_mask
string

The fields to update, as a comma-separated list such as "name,enabled". The possible values are "name", "description", "enabled", "priority", "matcher" and "outcome". If omitted, the fields present in the request are updated. Fields not listed are left unchanged, and a listed matcher or outcome is replaced as a whole. A listed field that is not sent is cleared: "description" becomes empty and "enabled" becomes false. "name", "priority", "matcher" and "outcome" cannot be cleared, so listing one of them without sending it fails the request.

Exampleenabled
name
string | null

The rule name, unique among the workspace's rules and guidance. Maximum 255 characters.

Min length1
Max length255
description
string | null

An optional description of the rule. Maximum 2,000 characters.

Max length2000
enabled
boolean | null

Whether the rule is active. A disabled rule is not evaluated.

priority
integer (int32) | null

Moves the rule to this position in evaluation order, 1 for first. The rules from that position on shift down one place. A position past the last rule places the rule last.

Minimum1
matcher
object (torq.public.triage.v1.RuleMatcher)

The conditions an alert must meet: the rule matches when any group matches, and a group matches when all its conditions hold. Fields and values are spelled as on the public alert, and the allowed ones are listed by Retrieve rule schemas. To scope a rule to a source or category, put that condition in every group. A matcher holds at most 200 conditions in all, those inside collection conditions included.

Example{ "or": [ { "and": [ { "field": "alert.source.integration_type_id", "operator": "in", "values": [ "crowdstrike_streaming" ] }, { "collection": "alert.observables", "match": { "or": [ { "and": [ { "field": "type", "operator": "in", "values": [ "IP Address" ] }, { "field": "value", "operator": "in", "values": [ "10.8.0.1" ] } ] } ] } } ] } ] }
or
Array of object (torq.public.triage.v1.RuleConditionGroup)

The groups, any of which matching makes the rule match. Minimum 1, maximum 64.

object

A group of conditions that must all hold.

and
Array of object (torq.public.triage.v1.RuleCondition)

The conditions, all of which must hold. At least one.

object

One condition, of one of two kinds. A field condition sets field, operator and values to test a field of the alert. A collection condition sets collection and match to test the items of one of the alert's lists, such as its observables, and holds when an item matches.

field
string

The alert field the condition tests, as a path such as "alert.source.integration_type_id". Set for a field condition.

operator
string

How the field is compared with the values. Set for a field condition.

  • "in", "not_in": the field is one of the values, or none of them.
  • "contains_any", "contains_none": the field contains at least one of the values as a substring, or none of them.
  • "matches_regex": the field matches the one value given, a regular expression in RE2 syntax.

Which operators a field takes is listed in its "x-operators" list in the rule schemas:

  • A field with a fixed set of values, such as "alert.verdict.triage_severity" or an observable's "type", a list of such values, such as "alert.categories", and an identifier compared exactly, such as "alert.source.integration_type_id": "in", "not_in".
  • Free text, such as an observable's "value", and a list of free text: all five.
  • A list of objects, such as "alert.observables": none; test its items with a collection condition.

On a list, the condition holds when some item meets it, or, for "not_in" and "contains_none", when no item does. "equals" and "not_equals" are refused; use "in" and "not_in", which match the same alerts.

values
Array of string

The values the field is compared with, as strings: one for "matches_regex", one or more for the others. Each is a non-empty string; a field with a fixed set of values takes only those. At most 1,000 values, each at most 4,096 characters, and a regular expression at most 1,024 characters. Set for a field condition.

string
collection
string

The alert list the condition looks through, as a path such as "alert.observables". Set for a collection condition.

match
object (torq.public.triage.v1.RuleElementMatcher)

The conditions an item of an alert's list must meet, in the same shape as the matcher: the item matches when any group matches, and a group matches when all its conditions hold. For conditions that must all hold on the same item, such as an observable's type and value, use one group.

or
Array of object (torq.public.triage.v1.RuleElementGroup)

The groups, any of which matching makes the item match. At least one.

object

A group of conditions on an item, all of which must hold.

and
Array of object (torq.public.triage.v1.RuleElementCondition)

The conditions, all of which must hold. At least one.

object

A condition on a field of an item, such as an observable's "type" or "value".

field
string

The item field the condition tests, relative to the item, such as "type".

operator
string

How the field is compared with the values. The operators, and which a field takes by its type, are as in a rule condition.

values
Array of string

The values the field is compared with, as strings, as in a rule condition.

string
outcome
object (torq.public.triage.v1.RuleOutcome)

What a rule does to an alert it matches: an outcome type, and a config whose shape the type defines. Retrieve rule schemas lists the allowed types and the settings each one takes. Currently the only type is "override_triage_result", which sets the alert's verdict, its severity, or both.

type
string

The outcome type, such as "override_triage_result".

config
object

The outcome's settings, as a JSON object whose fields and values the type's config schema defines. For "override_triage_result": {"verdict": "False Positive", "severity": "Low"}, with at least one of the two.

Responses
200

A successful response.

Expand All
object
rule
object (torq.public.triage.v1.Rule)

A rule sets an alert's verdict, severity or both when the alert matches its conditions.

id
string

The unique identifier of the rule.

name
string

The rule name, unique among the workspace's rules and guidance.

description
string

An optional description of the rule.

enabled
boolean

Whether the rule is active. A disabled rule is not evaluated. Always returned, including when false.

priority
integer (int32)

The rule's position in evaluation order within its evaluation point, 1 for first. Positions run from 1 to the number of rules without gaps, counting enabled and disabled rules.

evaluation_point
string

When in triage the rule is evaluated: "after_verdict", once Auto Triage has reached its verdict.

matcher
object (torq.public.triage.v1.RuleMatcher)

The conditions an alert must meet: the rule matches when any group matches, and a group matches when all its conditions hold. Fields and values are spelled as on the public alert, and the allowed ones are listed by Retrieve rule schemas. To scope a rule to a source or category, put that condition in every group. A matcher holds at most 200 conditions in all, those inside collection conditions included.

Example{ "or": [ { "and": [ { "field": "alert.source.integration_type_id", "operator": "in", "values": [ "crowdstrike_streaming" ] }, { "collection": "alert.observables", "match": { "or": [ { "and": [ { "field": "type", "operator": "in", "values": [ "IP Address" ] }, { "field": "value", "operator": "in", "values": [ "10.8.0.1" ] } ] } ] } } ] } ] }
or
Array of object (torq.public.triage.v1.RuleConditionGroup)

The groups, any of which matching makes the rule match. Minimum 1, maximum 64.

object

A group of conditions that must all hold.

and
Array of object (torq.public.triage.v1.RuleCondition)

The conditions, all of which must hold. At least one.

object

One condition, of one of two kinds. A field condition sets field, operator and values to test a field of the alert. A collection condition sets collection and match to test the items of one of the alert's lists, such as its observables, and holds when an item matches.

field
string

The alert field the condition tests, as a path such as "alert.source.integration_type_id". Set for a field condition.

operator
string

How the field is compared with the values. Set for a field condition.

  • "in", "not_in": the field is one of the values, or none of them.
  • "contains_any", "contains_none": the field contains at least one of the values as a substring, or none of them.
  • "matches_regex": the field matches the one value given, a regular expression in RE2 syntax.

Which operators a field takes is listed in its "x-operators" list in the rule schemas:

  • A field with a fixed set of values, such as "alert.verdict.triage_severity" or an observable's "type", a list of such values, such as "alert.categories", and an identifier compared exactly, such as "alert.source.integration_type_id": "in", "not_in".
  • Free text, such as an observable's "value", and a list of free text: all five.
  • A list of objects, such as "alert.observables": none; test its items with a collection condition.

On a list, the condition holds when some item meets it, or, for "not_in" and "contains_none", when no item does. "equals" and "not_equals" are refused; use "in" and "not_in", which match the same alerts.

values
Array of string

The values the field is compared with, as strings: one for "matches_regex", one or more for the others. Each is a non-empty string; a field with a fixed set of values takes only those. At most 1,000 values, each at most 4,096 characters, and a regular expression at most 1,024 characters. Set for a field condition.

string
collection
string

The alert list the condition looks through, as a path such as "alert.observables". Set for a collection condition.

match
object (torq.public.triage.v1.RuleElementMatcher)

The conditions an item of an alert's list must meet, in the same shape as the matcher: the item matches when any group matches, and a group matches when all its conditions hold. For conditions that must all hold on the same item, such as an observable's type and value, use one group.

or
Array of object (torq.public.triage.v1.RuleElementGroup)

The groups, any of which matching makes the item match. At least one.

object

A group of conditions on an item, all of which must hold.

and
Array of object (torq.public.triage.v1.RuleElementCondition)

The conditions, all of which must hold. At least one.

object

A condition on a field of an item, such as an observable's "type" or "value".

field
string

The item field the condition tests, relative to the item, such as "type".

operator
string

How the field is compared with the values. The operators, and which a field takes by its type, are as in a rule condition.

values
Array of string

The values the field is compared with, as strings, as in a rule condition.

string
outcome
object (torq.public.triage.v1.RuleOutcome)

What a rule does to an alert it matches: an outcome type, and a config whose shape the type defines. Retrieve rule schemas lists the allowed types and the settings each one takes. Currently the only type is "override_triage_result", which sets the alert's verdict, its severity, or both.

type
string

The outcome type, such as "override_triage_result".

config
object

The outcome's settings, as a JSON object whose fields and values the type's config schema defines. For "override_triage_result": {"verdict": "False Positive", "severity": "Low"}, with at least one of the two.

alerts_matched_last_30_days
integer (int32)

The number of alerts created in the last 30 days that this rule matched. Rules are checked in priority order and checking stops at the first match, so an alert counts only for the first rule that matched it. Approximate: the count is refreshed periodically. Always returned, including when 0.

created_at
string (date-time)

The timestamp when the rule was created.

created_by
object (torq.actor.v1.Actor)

The entity that performed the action.

kind
string

The actor kind. Identifies which actor case is populated. One of: USER, WORKFLOW, INTEGRATION, SERVICE_API_KEY, SOCRATES, TRIAGE, AGENT, BUILDER.

user
object (torq.actor.v1.Actor.User)

User identity information.

email
string

The actor's email address.

full_name
string

The user's full name.

workflow
object (torq.actor.v1.Actor.Workflow)

Workflow execution details.

id
string

The workflow ID.

execution_id
string

The workflow execution ID.

name
string

The workflow name.

integration
object (torq.actor.v1.Actor.Integration)

Integration configuration.

id
string

The integration ID.

type_id
string

The integration type identifier.

service_api_key
object (torq.actor.v1.Actor.ServiceApiKey)

Service account API token information.

name
string

The service account API token name.

client_id
string

The service account API token client ID.

socrates
object (torq.actor.v1.Actor.Socrates)

Original actor information.

original_actor
triage
object (torq.actor.v1.Actor.Triage)

Triage system action.

agent
object (torq.actor.v1.Actor.Agent)

Agent execution details.

id
string

The agent ID.

execution_id
string

The agent execution ID.

builder
object (torq.actor.v1.Actor.Builder)

Workflow Builder acting on behalf of a user.

original_actor
updated_at
string (date-time)

The timestamp when the rule was last updated.

updated_by
object (torq.actor.v1.Actor)

The entity that performed the action.

kind
string

The actor kind. Identifies which actor case is populated. One of: USER, WORKFLOW, INTEGRATION, SERVICE_API_KEY, SOCRATES, TRIAGE, AGENT, BUILDER.

user
object (torq.actor.v1.Actor.User)

User identity information.

email
string

The actor's email address.

full_name
string

The user's full name.

workflow
object (torq.actor.v1.Actor.Workflow)

Workflow execution details.

id
string

The workflow ID.

execution_id
string

The workflow execution ID.

name
string

The workflow name.

integration
object (torq.actor.v1.Actor.Integration)

Integration configuration.

id
string

The integration ID.

type_id
string

The integration type identifier.

service_api_key
object (torq.actor.v1.Actor.ServiceApiKey)

Service account API token information.

name
string

The service account API token name.

client_id
string

The service account API token client ID.

socrates
object (torq.actor.v1.Actor.Socrates)

Original actor information.

original_actor
triage
object (torq.actor.v1.Actor.Triage)

Triage system action.

agent
object (torq.actor.v1.Actor.Agent)

Agent execution details.

id
string

The agent ID.

execution_id
string

The agent execution ID.

builder
object (torq.actor.v1.Actor.Builder)

Workflow Builder acting on behalf of a user.

original_actor
401

Invalid bearer token. If you receive this message more than once try creating a new Client ID/Client Secret or generating a new bearer token.

object
403

You don't have permission to access this resource.

object