Exceptions action steps
Exceptions action steps let workflows add an exception to a detection rule or to an exception list in Elastic Security. Use these named steps instead of a generic kibana.request call to the exceptions APIs.
Use exceptions steps for patterns like:
- Exclude a host from a rule for the length of a maintenance window.
- Add a scanner's IP address to a shared allowlist when an alert confirms it.
- Create the same exception on every run without producing duplicates.
Both exceptions steps share the same conventions.
Privileges. The user whose privileges authorize the run needs the privileges described in Exception privileges. To find out which user that is, refer to Whose privileges authorize a run.
All parameters live under with. There are no top-level fields specific to these steps.
Entries. entries is an array of conditions, and all must match for the exception to apply. Create separate items for alternative conditions. Each entry combines a field with an operator. For how each operator matches, and the field types and escaping it needs, refer to Configure exception conditions.
| Operator | Operand |
|---|---|
is, is_not, matches, does_not_match |
A single value. The match operators support * and ? wildcards. |
is_one_of, is_not_one_of |
A values array. |
exists, does_not_exist |
None. |
is_in_list, is_not_in_list |
A value list, as list.id and list.type. An item can't mix a value-list entry with other entry types. |
These steps can't target fields mapped as nested in Elasticsearch, such as most Elastic Endpoint objects. Manage those exceptions in the Elastic Security UI.
Re-run safely with item_id. Without item_id, every run creates a new exception item, so a retry, a scheduled trigger, or a loop produces duplicates. Provide item_id whenever the workflow might run more than once for the same exception. When an item with that item_id already exists on the target list, the step skips creation and returns the existing item. When overwrite is true, the step updates the item instead and keeps its existing comments. overwrite requires item_id. If the item_id exists on a different list, the step fails and leaves that item unchanged.
Temporary exceptions. Set expire_time to an ISO 8601 datetime to make the exception stop applying after that time.
Schema convention. In each schema table on this page, the Location column indicates where each parameter sits in the YAML:
top level: Alongsidetypeandname, at the top of the step or trigger definition.`with`: Inside the step'swith:block.`on`: Inside the trigger'son:block.
Jump to either step:
security.createRuleException ·
security.createExceptionListItem
Add an exception item to a detection rule's own default exception list. The step creates the list if the rule doesn't have one yet, and the exception affects only that rule.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
rule_id |
with |
string | Yes | The rule's id, for example kibana.alert.rule.uuid on an alert. Not the rule's rule_id. |
name |
with |
string | Yes | Exception item name. |
description |
with |
string | Yes | Exception item description. Can be empty. |
entries |
with |
array | Yes | 1 to 100 conditions. Refer to Shared conventions. |
item_id |
with |
string | No | Stable identifier, so that a re-run updates or skips this item instead of creating a duplicate. |
overwrite |
with |
boolean | No | When true, update the existing item with this item_id instead of skipping it. Requires item_id. Defaults to false. |
os_types |
with |
string[] |
No | Operating systems the exception applies to: linux, macos, or windows. |
tags |
with |
string[] |
No | Tags for the item. |
expire_time |
with |
string | No | ISO 8601 datetime after which the exception no longer applies. |
comments |
with |
string[] |
No | Comments attached to the item. |
- name: exclude_maintenance_host
type: security.createRuleException
with:
rule_id: "{{ event.kibana.alert.rule.uuid }}"
item_id: "maintenance-window-{{ event.host.name }}"
overwrite: true
name: "Exclude maintenance host"
description: "Host is under maintenance"
expire_time: "{{ variables.expiration }}"
entries:
- field: host.name
operator: is
value: "{{ event.host.name }}"
Add an exception item to an existing exception list. Adding to a shared list affects every rule that uses the list. The step fails if the list doesn't exist.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
list_id |
with |
string | Yes | The target list's list_id. |
namespace_type |
with |
string | No | single for a list in the current space, or agnostic for a list shared across spaces. Defaults to single. |
name |
with |
string | Yes | Exception item name. |
description |
with |
string | Yes | Exception item description. Can be empty. |
entries |
with |
array | Yes | 1 to 100 conditions. Refer to Shared conventions. |
item_id |
with |
string | No | Stable identifier, so that a re-run updates or skips this item instead of creating a duplicate. |
overwrite |
with |
boolean | No | When true, update the existing item with this item_id instead of skipping it. Requires item_id. Defaults to false. |
os_types |
with |
string[] |
No | Operating systems the exception applies to: linux, macos, or windows. |
tags |
with |
string[] |
No | Tags for the item. |
expire_time |
with |
string | No | ISO 8601 datetime after which the exception no longer applies. |
comments |
with |
string[] |
No | Comments attached to the item. |
- name: allow_approved_scanners
type: security.createExceptionListItem
with:
list_id: corporate-allowlist
namespace_type: agnostic
name: "Allow approved scanner IPs"
description: "Source IPs of the approved scanners"
entries:
- field: source.ip
operator: is_in_list
list:
id: approved_scanner_ips
type: ip
Both steps return the created or existing item.
| Field | Type | Description |
|---|---|---|
id |
string |
The item's unique ID in Kibana. |
item_id |
string |
The item's item_id. |
list_id |
string |
The list the item is on. For security.createRuleException, the rule's default list. |
namespace_type |
string |
single or agnostic. Always single for a rule's default list. |
name |
string |
The item's name. |
created_at |
string |
When the item was created. |
created_by |
string |
The user who created the item. |
expire_time |
string |
Present only when set on the item. |
outcome |
string |
What the step did: created, skipped, or overwritten. |
- Security action steps: Overview of the
security.*step namespace. - Detection rules action steps: Enable or disable detection rules.
- Add and manage exceptions: How exceptions and exception lists work in Elastic Security.
- Kibana action steps: Generic
kibana.requestfor other exceptions API calls.