|
| 1 | +--- |
| 2 | +title: Add advanced conditions to Microsoft Sentinel automation rules |
| 3 | +description: This article explains how to add complex, advanced "Or" conditions to automation rules in Microsoft Sentinel, for more effective triage of incidents. |
| 4 | +author: yelevin |
| 5 | +ms.topic: how-to |
| 6 | +ms.date: 09/13/2022 |
| 7 | +ms.author: yelevin |
| 8 | +--- |
| 9 | + |
| 10 | +# Add advanced conditions to Microsoft Sentinel automation rules |
| 11 | + |
| 12 | +> [!IMPORTANT] |
| 13 | +> |
| 14 | +> The advanced conditions capability for automation rules is currently in **PREVIEW**. See the [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/) for additional legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability. |
| 15 | +
|
| 16 | +This article explains how to add advanced "Or" conditions to automation rules in Microsoft Sentinel, for more effective triage of incidents. |
| 17 | + |
| 18 | +Add "Or" conditions in the form of *condition groups* in the Conditions section of your automation rule. |
| 19 | + |
| 20 | +Condition groups can contain two levels of conditions: |
| 21 | + |
| 22 | +- [**Simple**](#example-1-simple-conditions): At least two conditions, each separated by an `OR` operator: |
| 23 | + |
| 24 | + - **A `OR` B** |
| 25 | + - **A `OR` B `OR` C** ([See Example 1B below](#example-1b-add-more-or-conditions).) |
| 26 | + - and so on. |
| 27 | + |
| 28 | +- [**Compound**](#example-2-compound-conditions): More than two conditions, with at least two conditions on at least one side of an `OR` operator: |
| 29 | + |
| 30 | + - **(A `and` B) `OR` C** |
| 31 | + - **(A `and` B) `OR` (C `and` D)** |
| 32 | + - **(A `and` B) `OR` (C `and` D `and` E)** |
| 33 | + - **(A `and` B) `OR` (C `and` D) `OR` (E `and` F)** |
| 34 | + - and so on. |
| 35 | + |
| 36 | +You can see that this capability affords you great power and flexibility in determining when rules will run. It can also greatly increase your efficiency by enabling you to combine many old automation rules into one new rule. |
| 37 | + |
| 38 | +## Add a condition group |
| 39 | + |
| 40 | +Since condition groups offer a lot more power and flexibility in creating automation rules, the best way to explain how to do this is by presenting some examples. |
| 41 | + |
| 42 | +Let's create a rule that will change the severity of an incoming incident from whatever it is to High, assuming it meets the conditions we'll set. |
| 43 | + |
| 44 | +1. From the **Automation** page, select **Create > Automation rule** from the button bar at the top. |
| 45 | + |
| 46 | + See the [general instructions for creating an automation rule](create-manage-use-automation-rules.md) for details. |
| 47 | + |
| 48 | +1. Give the rule a name: "Triage: Change Severity to High" |
| 49 | + |
| 50 | +1. Select the trigger **When incident is created**. |
| 51 | + |
| 52 | +1. Under **Conditions**, leave the **Analytics rule name** condition as is. We'll add more conditions below. |
| 53 | + |
| 54 | +1. Under **Actions**, select **Change severity** from the drop-down list. |
| 55 | + |
| 56 | +1. Select **High** from the drop-down list that appears below **Change severity**. |
| 57 | + |
| 58 | +:::image type="content" source="media/add-advanced-conditions-to-automation-rules/create-automation-rule-no-conditions.png" alt-text="Screenshot of creating new automation rule without adding conditions."::: |
| 59 | + |
| 60 | +## Example 1: simple conditions |
| 61 | + |
| 62 | +In this first example, we'll create a simple condition group: If either condition A **or** condition B is true, the rule will run and the incident's severity will be set to *High*. |
| 63 | + |
| 64 | +1. Select the **+ Add** expander and choose **Condition group (Or) (Preview)** from the drop-down list. |
| 65 | + |
| 66 | + :::image type="content" source="media/add-advanced-conditions-to-automation-rules/add-condition-group.png" alt-text="Screenshot of adding a condition group to an automation rule's condition set."::: |
| 67 | + |
| 68 | +1. See that two sets of condition fields are displayed, separated by an `OR` operator. These are the "A" and "B" conditions we mentioned above: If A or B is true, the rule will run. |
| 69 | + (Don't be confused by all the different layers of "Add" links - these will all be explained.) |
| 70 | + |
| 71 | + :::image type="content" source="media/add-advanced-conditions-to-automation-rules/empty-condition-group.png" alt-text="Screenshot of empty condition group fields."::: |
| 72 | + |
| 73 | +1. Let's decide what these conditions will be. That is, what two *different* conditions will cause the incident severity to be changed to *High*? Let's suggest the following: |
| 74 | + |
| 75 | + - If the incident's associated MITRE ATT&CK **Tactics** include any of the four we've selected from the drop-down (see the image below), the severity should be raised to High. |
| 76 | + |
| 77 | + - If the incident contains a **Host name** entity named "SUPER_SECURE_STATION", the severity should be raised to High. |
| 78 | + |
| 79 | + :::image type="content" source="media/add-advanced-conditions-to-automation-rules/add-simple-or-condition.png" alt-text="Screenshot of adding simple OR conditions to an automation rule."::: |
| 80 | + |
| 81 | + As long as at least ONE of these conditions is true, the actions we define in the rule will run, changing the severity of the incident to High. |
| 82 | + |
| 83 | +### Example 1A: Add an OR value within a single condition |
| 84 | + |
| 85 | +Let's say we have not one, but two super-sensitive workstations whose incidents we want to make high-severity. |
| 86 | +We can add another value to an existing condition (for any conditions based on entity properties) by selecting the dice icon to the right of the existing value and adding the new value below. |
| 87 | + |
| 88 | +:::image type="content" source="media/add-advanced-conditions-to-automation-rules/add-value-to-condition.png" alt-text="Screenshot of adding more values to a single condition."::: |
| 89 | + |
| 90 | +### Example 1B: Add more OR conditions |
| 91 | + |
| 92 | +Let's say we want to have this rule run if one of THREE (or more) conditions is true. If A *or* B *or* C is true, the rule will run. |
| 93 | + |
| 94 | +1. Remember all those "Add" links? To add another OR condition, select the **+ Add** connected by a line to the `OR` operator. |
| 95 | + |
| 96 | + :::image type="content" source="media/add-advanced-conditions-to-automation-rules/add-another-or-condition.png" alt-text="Screenshot of adding another OR condition to an automation rule."::: |
| 97 | + |
| 98 | +1. Now, fill in the parameters and values of this condition the same way you did the first two. |
| 99 | + |
| 100 | + :::image type="content" source="media/add-advanced-conditions-to-automation-rules/added-another-or-condition.png" alt-text="Screenshot of another OR condition added to an automation rule."::: |
| 101 | + |
| 102 | +## Example 2: compound conditions |
| 103 | + |
| 104 | +Now we decide we're going to be a little more picky. We want to add more conditions to each side of our original OR condition. That is, we want the rule to run if A *and* B are true, *OR* if C *and* D are true. |
| 105 | + |
| 106 | +1. To add a condition to one side of an OR condition group, select the **+ Add** link immediately below the existing condition, on the same side of the `OR` operator (in the same blue-shaded area) to which you want to add the new condition. |
| 107 | + |
| 108 | + :::image type="content" source="media/add-advanced-conditions-to-automation-rules/add-a-compound-condition.png" alt-text="Screenshot of adding a compound condition to an automation rule."::: |
| 109 | + |
| 110 | + You'll see a new row added where the **+ Add** link was, separated by an `AND` operator. |
| 111 | + |
| 112 | + :::image type="content" source="media/add-advanced-conditions-to-automation-rules/empty-new-condition.png" alt-text="Screenshot of empty new condition row in automation rules."::: |
| 113 | + |
| 114 | +1. Fill in the parameters and values of this condition the same way you did the others. |
| 115 | + |
| 116 | + :::image type="content" source="media/add-advanced-conditions-to-automation-rules/fill-in-new-condition.png" alt-text="Screenshot of new condition fields to fill in to add to automation rules."::: |
| 117 | + |
| 118 | +1. Repeat the previous two steps to add an AND condition to the other side of the OR condition group. |
| 119 | + |
| 120 | + :::image type="content" source="media/add-advanced-conditions-to-automation-rules/add-compound-conditions.png" alt-text="Screenshot of adding multiple compound conditions to an automation rule."::: |
| 121 | + |
| 122 | +That's it! You can use what you've learned here to add more conditions and condition groups, using different combinations of `AND` and `OR` operators, to create powerful, flexible, and efficient automation rules to really help your SOC run smoothly and lower your response and resolution times. |
| 123 | + |
| 124 | +## Next steps |
| 125 | + |
| 126 | +In this document, you learned how to add condition groups using `OR` operators to automation rules. |
| 127 | + |
| 128 | +- For instructions on creating basic automation rules, see [Create and use Microsoft Sentinel automation rules to manage response](create-manage-use-automation-rules.md). |
| 129 | +- To learn more about automation rules, see [Automate incident handling in Microsoft Sentinel with automation rules](automate-incident-handling-with-automation-rules.md) |
| 130 | +- To learn more about advanced automation options, see [Automate threat response with playbooks in Microsoft Sentinel](automate-responses-with-playbooks.md). |
| 131 | +- For help with implementing automation rules and playbooks, see [Tutorial: Use playbooks to automate threat responses in Microsoft Sentinel](tutorial-respond-threats-playbook.md). |
0 commit comments