Skip to content

Commit 35f561b

Browse files
committed
Added case with no incident ID
1 parent 806719a commit 35f561b

File tree

4 files changed

+35
-10
lines changed

4 files changed

+35
-10
lines changed
56.9 KB
Loading
6.74 KB
Loading

articles/sentinel/playbook-triggers-actions.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -109,20 +109,42 @@ Basic playbook to send incident details over mail:
109109

110110
!["Alert trigger simple add comment example"](media/playbook-triggers-actions/alert-comment.png)
111111

112-
## Work with entities
113-
114-
> [!NOTE]
115-
> If a playbook created with the **Entity trigger** makes use of the **Incident ARM ID** field, then in the event that this playbook is triggered in a context unconnected to an incident, this field will be populated with a null value. The playbook will still run, but any actions that refer to the incident ID will be skipped.
116-
>
117-
> Examples of this situation might be if the playbook was run from an entity page accessed from the **Entity behavior** page, or as the result of a hunting query.
118-
119-
### Usage example - disable a user
112+
### Disable a user
120113

121114
- Playbook is triggered by **Microsoft Sentinel Entity**
122115

123116
:::image type="content" source="media/playbook-triggers-actions/entity-trigger-actions.png" alt-text="Screenshot showing actions to take in an entity-trigger playbook to disable a user.":::
124117

125-
### Work with specific Entity types
118+
### Entity playbooks with no incident ID
119+
120+
Playbooks created with the **Entity trigger** often make use of the **Incident ARM ID** field (for example, in order to update an incident after taking action on the entity).
121+
122+
If such a playbook is triggered in a **context unconnected to an incident** (for example, when threat hunting), then there is **no incident** whose ID can populate this field. In this case, the field will be populated with a null value.
123+
124+
**As a result, the playbook may fail to run to completion.** To prevent this failure, it's recommended to create a condition that will check for a value in the incident ID field before taking any actions on it, and prescribe a different set of actions if the field has a null value - that is, if the playbook isn't being run from an incident.
125+
126+
1. Before the first action that refers to the **Incident ARM ID** field, add a step of type **Condition**.
127+
128+
1. Select the **Choose a value** field and enter the **Add dynamic content** dialog.
129+
130+
1. Select the **Expression** tab and the **length(collection)** function.
131+
132+
1. Select the **Dynamic content** tab and the **Incident ARM ID** field.
133+
134+
1. Verify the resulting expression is `length(triggerBody()?['IncidentArmID'])` and select **OK**.
135+
136+
:::image type="content" source="media/playbook-triggers-actions/condition-incident-id.png" alt-text="Screenshot of dynamic content dialog to select fields for a playbook condition.":::
137+
138+
1. Set the **operator** and **value** in the condition to "is greater than" and "0".
139+
140+
:::image type="content" source="media/playbook-triggers-actions/condition-length.png" alt-text="Screenshot of final definition of condition described in the previous screenshot.":::
141+
142+
1. In the **True** frame, add the actions to be taken if the playbook is run from an incident context.
143+
144+
In the **False** frame, add the actions to be taken if the playbook is run from a non-incident context.
145+
146+
147+
## Work with specific Entity types
126148

127149
The **Entities** dynamic field is an array of JSON objects, each of which represents an entity. Each entity type has its own schema, depending on its unique properties.
128150

articles/sentinel/tutorial-respond-threats-playbook.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ This screenshot shows the actions and conditions you would add in creating the p
230230

231231
See [**Use triggers and actions in Microsoft Sentinel playbooks**](playbook-triggers-actions.md) for details about actions you can add to playbooks for different purposes.
232232

233-
In particular, note this important information about [**working with playbooks based on the entity trigger**](playbook-triggers-actions.md#work-with-entities).
233+
In particular, note this important information about [**playbooks based on the entity trigger in a non-incident context**](playbook-triggers-actions.md#entity-playbooks-with-no-incident-id).
234234

235235
## Automate threat responses
236236

@@ -376,4 +376,7 @@ You can see the run history for playbooks on a given entity by selecting the **R
376376
## Next steps
377377
378378
In this tutorial, you learned how to use playbooks and automation rules in Microsoft Sentinel to respond to threats.
379+
- Learn more about [authenticating playbooks to Microsoft Sentinel](authenticate-playbooks-to-sentinel.md)
380+
- Learn more about [using triggers and actions in Microsoft Sentinel playbooks](playbook-triggers-actions.md)
381+
- Learn more about
379382
- Learn how to [proactively hunt for threats](hunting.md) using Microsoft Sentinel.

0 commit comments

Comments
 (0)