Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions explore-analyze/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,8 @@ toc:
- file: workflows/steps/detection-rules.md
- file: workflows/steps/alert-triage.md
- file: workflows/steps/attack-triage.md
- file: workflows/steps/exceptions.md
- file: workflows/steps/notes.md
- file: workflows/steps/streams.md
- file: workflows/steps/external-systems-apps.md
- file: workflows/steps/flow-control-steps.md
Expand Down
2 changes: 2 additions & 0 deletions explore-analyze/workflows/reference/cheat-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ Minimum schedule interval: **1 minute**. Refer to [Triggers](/explore-analyze/wo
| Manage alerts | `security.setAlertStatus`, `security.setAlertTags`, `security.assignAlert` (preferred); `kibana.SetAlertsStatus`, `kibana.SetAlertTags` (PascalCase) |
| Manage attacks | `security.setAttackStatus`, `security.setAttackTags`, `security.assignAttack` |
| Enable or disable detection rules | `security.enableRule`, `security.disableRule` |
| Add exceptions {applies_to}`serverless: ga` {applies_to}`stack: ga 9.6+` | `security.createRuleException`, `security.createExceptionListItem` |
| Manage notes {applies_to}`serverless: preview` {applies_to}`stack: preview 9.6+` | `security.createNote`, `security.getNotes`, `security.updateNote`, `security.deleteNote` |
| Manage asset criticality | `entityStore.updateAssetCriticality` |
| Call an API | `http` (with optional `connector-id`) |
| Call a service | `<connector>` or `<connector>.<action>` (for example, `slack`, `jira.pushToService`) |
Expand Down
6 changes: 6 additions & 0 deletions explore-analyze/workflows/reference/step-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,18 @@ Every step type available for Elastic Workflows, ordered alphabetically. Use thi
| [`parallel`](/explore-analyze/workflows/steps/parallel.md) {applies_to}`stack: preview 9.5+` {applies_to}`serverless: preview` | Flow control | Run branches concurrently and collect a per-branch result. |
| [`security.assignAlert`](/explore-analyze/workflows/steps/alert-triage.md#security-assignalert) | Security | Assign or unassign users on one or more alerts. |
| [`security.assignAttack`](/explore-analyze/workflows/steps/attack-triage.md#security-assignattack) | Security | Assign or unassign users on one or more attacks. |
| [`security.createExceptionListItem`](/explore-analyze/workflows/steps/exceptions.md#security-createexceptionlistitem) {applies_to}`serverless: ga` {applies_to}`stack: ga 9.6+` | Security | Add an exception item to an existing exception list, so a re-run with the same `item_id` creates no duplicate. |
| [`security.createNote`](/explore-analyze/workflows/steps/notes.md#security-createnote) {applies_to}`serverless: preview` {applies_to}`stack: preview 9.6+` | Security | Create a note on an alert, attack, or document. |
| [`security.createRuleException`](/explore-analyze/workflows/steps/exceptions.md#security-createruleexception) {applies_to}`serverless: ga` {applies_to}`stack: ga 9.6+` | Security | Add an exception item to a rule's own default exception list, so a re-run with the same `item_id` creates no duplicate. |
| [`security.deleteNote`](/explore-analyze/workflows/steps/notes.md#security-deletenote) {applies_to}`serverless: preview` {applies_to}`stack: preview 9.6+` | Security | Delete one or more notes by note ID. |
| [`security.disableRule`](/explore-analyze/workflows/steps/detection-rules.md#security-disablerule) {applies_to}`stack: ga 9.5+` {applies_to}`serverless: ga` | Security | Disable one or more detection rules by rule-ID list or KQL query, with partial-failure reporting. |
| [`security.enableRule`](/explore-analyze/workflows/steps/detection-rules.md#security-enablerule) {applies_to}`stack: ga 9.5+` {applies_to}`serverless: ga` | Security | Enable one or more detection rules by rule-ID list or KQL query, with partial-failure reporting. |
| [`security.getNotes`](/explore-analyze/workflows/steps/notes.md#security-getnotes) {applies_to}`serverless: preview` {applies_to}`stack: preview 9.6+` | Security | Retrieve all notes attached to an alert, attack, or document. |
| [`security.setAlertStatus`](/explore-analyze/workflows/steps/alert-triage.md#security-setalertstatus) | Security | Set alert status: `open`, `acknowledged`, or `closed`. |
| [`security.setAlertTags`](/explore-analyze/workflows/steps/alert-triage.md#security-setalerttags) | Security | Add or remove tags on one or more alerts. |
| [`security.setAttackStatus`](/explore-analyze/workflows/steps/attack-triage.md#security-setattackstatus) | Security | Set attack status: `open`, `acknowledged`, or `closed`. |
| [`security.setAttackTags`](/explore-analyze/workflows/steps/attack-triage.md#security-setattacktags) | Security | Add or remove tags on one or more attacks. |
| [`security.updateNote`](/explore-analyze/workflows/steps/notes.md#security-updatenote) {applies_to}`serverless: preview` {applies_to}`stack: preview 9.6+` | Security | Replace the text of an existing note on an alert, attack, or document. |
| [`switch`](/explore-analyze/workflows/steps/switch.md) | Flow control | Multi-way dispatch. |
| [`wait`](/explore-analyze/workflows/steps/wait.md) | Flow control | Pause for a fixed duration. |
| [`waitForApproval`](/explore-analyze/workflows/steps/wait-for-approval.md) {applies_to}`stack: preview 9.5+` {applies_to}`serverless: preview` | Flow control | Pause for approve/reject (human-in-the-loop). |
Expand Down
4 changes: 3 additions & 1 deletion explore-analyze/workflows/steps/action-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ Security actions provide named `security.*` steps for {{elastic-sec}} operations

* Triage alerts and attacks by setting status and managing tags and assignees (`security.setAlertStatus`, `security.setAlertTags`, `security.assignAlert`, `security.setAttackStatus`, `security.setAttackTags`, `security.assignAttack`)
* Enable or disable detection rules by ID list or query (`security.enableRule`, `security.disableRule`)
* {applies_to}`serverless: ga` {applies_to}`stack: ga 9.6+` Add an exception to a detection rule or an item to an exception list (`security.createRuleException`, `security.createExceptionListItem`)
* {applies_to}`serverless: preview` {applies_to}`stack: preview 9.6+` Create, retrieve, update, and delete notes on alerts, attacks, and documents (`security.createNote`, `security.getNotes`, `security.updateNote`, `security.deleteNote`)

Refer to [](/explore-analyze/workflows/steps/security.md) for the Security step categories, [](/explore-analyze/workflows/steps/alert-triage.md) for the Alert triage catalog, [](/explore-analyze/workflows/steps/attack-triage.md) for the Attack triage catalog, and [](/explore-analyze/workflows/steps/detection-rules.md) for the Detection rules catalog.
Refer to [](/explore-analyze/workflows/steps/security.md) for the Security step categories, [](/explore-analyze/workflows/steps/alert-triage.md) for the Alert triage catalog, [](/explore-analyze/workflows/steps/attack-triage.md) for the Attack triage catalog, [](/explore-analyze/workflows/steps/detection-rules.md) for the Detection rules catalog, [](/explore-analyze/workflows/steps/exceptions.md) for the Exceptions catalog, and [](/explore-analyze/workflows/steps/notes.md) for the Notes catalog.

## Streams

Expand Down
149 changes: 149 additions & 0 deletions explore-analyze/workflows/steps/exceptions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
---
navigation_title: Exceptions
applies_to:
serverless: ga
stack: ga 9.6+
description: Add exception items to detection rules and shared exception lists from a workflow with the security.createRuleException and security.createExceptionListItem action steps in Elastic Security.
products:
- id: kibana
- id: cloud-serverless
- id: cloud-hosted
- id: cloud-enterprise
- id: cloud-kubernetes
- id: elastic-stack
---

# Exceptions action steps [workflows-exceptions-steps]

Exceptions action steps let workflows add an [exception](/solutions/security/detect-and-alert/add-manage-exceptions.md) to a detection rule or to an exception list in {{elastic-sec}}. Use these named steps instead of a generic [`kibana.request`](/explore-analyze/workflows/steps/kibana.md#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.

## Shared conventions [workflows-exceptions-conventions]

Both exceptions steps share the same conventions.

**Privileges.** The user whose privileges authorize the run needs the privileges described in [Exception privileges](/solutions/security/detect-and-alert/add-manage-exceptions.md#exception-privileges). To find out which user that is, refer to [Whose privileges authorize a run](/explore-analyze/workflows/authorization.md#workflows-authorization-user).

**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](/solutions/security/detect-and-alert/add-manage-exceptions.md#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](/solutions/security/detect-and-alert/create-manage-value-lists.md), 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 {{es}}, such as most {{elastic-endpoint}} objects. Manage those exceptions in the {{elastic-sec}} 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.

:::{include} ../_snippets/schema-location-legend.md
:::

## Step catalog [workflows-exceptions-catalog]

Jump to either step:

[`security.createRuleException`](#security-createruleexception) ·
[`security.createExceptionListItem`](#security-createexceptionlistitem)

---

### `security.createRuleException` [security-createruleexception]

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](#workflows-exceptions-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. |

```yaml
- 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 }}"
```

### `security.createExceptionListItem` [security-createexceptionlistitem]

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](/deploy-manage/manage-spaces.md), 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](#workflows-exceptions-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. |

```yaml
- 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
```

## Output [workflows-exceptions-output]

Both steps return the created or existing item.

| Field | Type | Description |
|---|---|---|
| `id` | `string` | The item's unique ID in {{kib}}. |
| `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`. |

## Related

- [Security action steps](/explore-analyze/workflows/steps/security.md): Overview of the `security.*` step namespace.
- [Detection rules action steps](/explore-analyze/workflows/steps/detection-rules.md): Enable or disable detection rules.

Check notice on line 147 in explore-analyze/workflows/steps/exceptions.md

View workflow job for this annotation

GitHub Actions / build / vale

Elastic.WordChoice: Consider using 'deactivate, deselect, hide, turn off' instead of 'disable', unless the term is in the UI.
- [Add and manage exceptions](/solutions/security/detect-and-alert/add-manage-exceptions.md): How exceptions and exception lists work in {{elastic-sec}}.
- [Kibana action steps](/explore-analyze/workflows/steps/kibana.md): Generic `kibana.request` for other exceptions API calls.
Loading
Loading