You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -3,14 +3,15 @@ title: Use a Microsoft Sentinel watchlist and playbook to inform owners of alert
3
3
description: Learn how to create a Microsoft Sentinel watchlist and playbook based on a Microsoft Defender for Cloud incident creation rule to inform resource owners of security alerts.
4
4
author: batamig
5
5
ms.author: bagol
6
-
manager: rkarlin
7
-
ms.service: azure-sentinel
8
-
ms.subservice: azure-sentinel
9
6
ms.topic: how-to
10
7
ms.date: 09/20/2021
11
8
---
12
9
13
-
# Use Microsoft Sentinel watchlists and playbook to inform owners of alerts
10
+
# Use Microsoft Sentinel watchlists and playbooks together to automate activity
11
+
12
+
This article describes two, common situations where using watchlists and playbooks together are helpful in automating activity in your systems: informing resource owners about alerts and responding to incidents with deny and allow lists.
13
+
14
+
## Automatically inform owners of alerts
14
15
15
16
[Microsoft Defender for Cloud alerts](/azure/defender-for-cloud/defender-for-cloud-introduction) inform the Security Operations Center (SOC) about possible security attacks on Azure resources.
16
17
@@ -22,23 +23,23 @@ Rather than manually finding the relevant contact and reaching out to them each
22
23
> The playbook described in this article uses the [Microsoft Sentinel incident trigger](/connectors/azuresentinel/#triggers). You can implement a similar solution by creating scheduled alerts with Microsoft Defender for Cloud, and then using the alert trigger.
23
24
>
24
25
25
-
## Prerequisites
26
+
###Prerequisites
26
27
27
-
To use the process described in this article, you must have the following prerequisites:
28
+
To use the process described in this section, you must have the following prerequisites:
28
29
29
30
- A user or registered application with [Microsoft Sentinel Contributor](../role-based-access-control/built-in-roles.md#microsoft-sentinel-contributor) role to use with the Microsoft Sentinel connector to Azure Logic Apps
30
31
31
32
- The [Defender for Cloud data connector](connect-azure-security-center.md) and [incident creation rule](automate-incident-handling-with-automation-rules.md#creating-and-managing-automation-rules) enabled
32
33
33
34
- A user to authenticate to Microsoft Teams, and a user to authenticate to Office 365 Outlook
34
35
35
-
## Process summary and playbook steps
36
+
###Process summary and playbook steps
36
37
37
-
The process described in this article includes the following steps:
38
+
The process described in this section includes the following steps:
38
39
39
40
1. A Microsoft Sentinel watchlist maps each subscription in the organization to its owner and their contact email address.
40
41
41
-
1.A [Watchlists-InformSubowner-IncidentTrigger](https://github.com/Azure/Azure-Sentinel/tree/master/Playbooks/Watchlist-InformSubowner-IncidentTrigger) playbook is attached to a Defender for Cloud incident creation rule.
42
+
1.The **Watchlists-InformSubowner-IncidentTrigger** playbook is attached to a Defender for Cloud incident creation rule.
42
43
43
44
Every new instance of the Defender for Cloud alert that flows to Microsoft Sentinel creates a Microsoft Sentinel incident.
44
45
@@ -49,7 +50,7 @@ The process described in this article includes the following steps:
49
50
1. The playbook sends the subscription owner a Teams message and email with details about the potential resource compromise.
50
51
51
52
52
-
The following image shows the [Watchlists-InformSubowner-IncidentTrigger](https://github.com/Azure/Azure-Sentinel/tree/master/Playbooks/Watchlist-InformSubowner-IncidentTrigger) playbook in the Logic App designer.
53
+
The following image shows the **Watchlists-InformSubowner-IncidentTrigger** playbook in the Logic App designer.
53
54
54
55

55
56
@@ -61,9 +62,9 @@ The playbook runs the following steps:
61
62
62
63
1.**Filter array to get AzureResource identifier**. A Microsoft Defender for Cloud alert might have two kinds of identifiers: `AzureResource` or a resource ID shown in Log Analytics, and Log Analytics information about the workspace that stores the alerts. This action returns an array of just the `AzureResource` identifiers for later use.
63
64
64
-
1.**Parse Json to get subscriptionId**. This step gets the Subscription ID from the SecAdditional Data of the Defender for Cloud alert.
65
+
1.**Parse Json to get subscriptionId**. This step gets the Subscription ID from the *SecAdditional Data* of the Defender for Cloud alert.
65
66
66
-
1.**Run query and list results - Get Watchlist**. The Azure Monitor Log Analytics connector gets the watchlist items. **Subscription**, **Resource Group**, and **Resource Name**are the Microsoft Sentinel workspace details where the watchlist is located. Use the `project` argument to specify which fields are relevant for your use.
67
+
1.**Run query and list results - Get Watchlist**. The Azure Monitor Log Analytics connector gets the watchlist items, including the **Subscription**, **Resource Group**, and **Resource Name**for the Microsoft Sentinel workspace details where the watchlist is located. Use the `project` argument to specify which fields are relevant for your use.
67
68
68
69

69
70
@@ -81,9 +82,9 @@ The playbook runs the following steps:
81
82
82
83

83
84
84
-
## Set up your watchlist and deploy the playbook
85
+
###Set up your watchlist and deploy the playbook
85
86
86
-
Use the following steps to create and upload the watchlist, deploy the [playbook](https://github.com/Azure/Azure-Sentinel/tree/master/Playbooks/Watchlist-InformSubowner-IncidentTrigger), and then confirm your API connections.
87
+
Use the following steps to create and upload the watchlist, deploy the playbook, and then confirm your API connections.
87
88
88
89
**To create and upload the watchlist:**
89
90
@@ -101,24 +102,201 @@ Use the following steps to create and upload the watchlist, deploy the [playbook
101
102
102
103
**To deploy the playbook**:
103
104
104
-
1. Open the [Watchlists-InformSubowner-IncidentTrigger playbook](https://github.com/Azure/Azure-Sentinel/tree/master/Playbooks/Watchlist-InformSubowner-IncidentTrigger) in the Microsoft Sentinel Playbooks repository.
105
+
1. In the Microsoft Sentinel **Automation** page, on the **Playbook templates (Preview)** tab, search for and locate the **Watchlists-InformSubowner-IncidentTrigger** playbook.
106
+
107
+
1. On the bottom right, select **Create playbook**, and then use the wizard to deploy the playbook in your workspace.
108
+
109
+
Make sure to enter a meaningful name for your playbook, and a **User name** to determine the names of the API connection resources.
110
+
111
+
1. After the deployment is complete, select your new playbook to open it in the Logic Apps Designer.
112
+
113
+
1. In your logic app, on the left under **Development Tools**, select **API connections**, and select the connection for each product in the playbook.
114
+
115
+
For any unconnected products, select **Authorize**, sign in, and then save the logic app.
116
+
117
+
## Automate incident response with an allow list
118
+
119
+
Allow-listing is a helpful strategy for allowing certain identities or sources to access sensitive resources or exclude them from security protections. For example, if a specific IP address on an allow list triggers a new alert, your system can use an allow list to recognize it as known to the SOC as an approved source. If an alert includes only approved IP addresses in its entities, you can save time by automatically closing the incident.
120
+
121
+
This section describes how to use a watchlist and a playbook to automatically close incidents for approved IP addresses, as an example of how this strategy works.
122
+
123
+
> [!TIP]
124
+
> You can add more steps to the playbook described in this section, or modify it for similar steps in deny list scenarios.
125
+
126
+
### Prerequisites
105
127
106
-
1. Scroll down and select the **Deploy to Azure**or **Deploy to Azure Gov** button, depending on your needs.
128
+
To use the process described in this section, you must have a user or registered application with [Microsoft Sentinel Contributor](../role-based-access-control/built-in-roles.md#microsoft-sentinel-contributor) role to use with the Microsoft Sentinel connector to Azure Logic Apps.
107
129
108
-
1. Fill out the parameters:
130
+
## Process summary and playbook steps
131
+
132
+
The process described in this article includes the following steps:
133
+
134
+
1. A Microsoft Sentinel watchlist lists all approved IP addresses.
135
+
136
+
1. The **Watchlist-CloseIncidentKnownIPs** playbook is attached to an analytics rule that attaches IP addresses to the outcome alerts.
137
+
138
+
1. Each time a new alert for the analytics rule is created, the playbook is triggered and obtains the alert details.
139
+
140
+
1. For each IP address in the collected alert, the playbook queries the watchlist to verify whether they are approved.
109
141
110
-
-**Basics**: Fill in the Sentinel workspace subscription, resource group, and location.
111
-
-**Settings**. Fill in a **Playbook name** to identify the playbook in your subscription, and a **User name** to determine the names of the API connections resources.
112
-
113
-
1. Check the Terms and Conditions, and select **Purchase**.
142
+
1. Any IP address found in the watchlist is added to the *Safe IPs* array. IP addresses not found in the watchlist are added to the *Not Safe IPs* array.
143
+
144
+
1. An informative comment is added to the incident that contains the alert, adding details about the IP addresses in each category (*Safe*/*Not Safe*).
145
+
146
+
1. If all listed IP addresses are safe, the incident is closed with a **Benign Positive** classification reason.
147
+
148
+
149
+
The following image shows the **Watchlists-CloseIncidentKnownIPs** playbook in the Logic App designer.
150
+
151
+

152
+
153
+
The playbook runs the following steps:
114
154
115
-
1.The Azure Resource Manager (ARM) template containing the Logic App playbook workflow and API connections deploys to Azure. When the deployment finishes, it shows the Azure ARM template summary page.
155
+
1. When a response to an Azure Sentinel alert is triggered
116
156
157
+
Azure Sentinel alert was created. The playbook receives the alert as the input.
117
158
118
-
1. In Logic Apps, select the playbook name to go to the logic app resource for the playbook.
119
-
1. On the left menu, select **API connections**.
120
-
1. Select the connection for each product in the playbook to confirm the connection. For any unconnected products, select **Authorize**, sign in with your user name, and save.
159
+
121
160
161
+
Initialize variables
162
+
163
+
This actions stores values to be used later in the playbook:
164
+
165
+
Watchlist name is a variable of type string, will be used for the Log Analytics query
166
+
Safe/not safe IPs are variables of type array, will be used to store the found IPs
167
+
168
+
169
+
Entities - Get IPs
170
+
171
+
This action takes all the entities found in the alert and parses only the IPs with their special fields ready to be used as dynamic values in later actions.
172
+
173
+
174
+
175
+
For Each IP
176
+
177
+
Iterates on the IPs found in this alert and performs the following:
178
+
179
+
thumbnail image 2 of blog post titled
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
Playbooks & Watchlists Part 2: Automate incident response for Deny-list/Allow-list
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+
200
+
201
+
202
+
203
+
204
+
205
+
206
+
Run query and list results - Get Watchlist
207
+
In this step we ask Log Analytics (Azure Monitor Logs connector) to get the items of the Watchlist. Subscription, Resource Group and Resource Name are the Azure Sentinel workspace details where the watchlist is located.
| where IpAddress == ''@{items('For_each')?['Address']}"
212
+
Condition
213
+
In this step I check the length of the response array from the query, using the Logic apps expression length(collection). If it is greater then 0, we have found the IP in the watchlist.
214
+
Therefor, we will add this IP to the Safe array; otherwise, to the not safe.
215
+
216
+
217
+
Add a comment to the incident
218
+
In this step we audit the information collected so far: a list of safe IPs found in the Watchlist, a side to a list of unknown IPs.
219
+
220
+
221
+
222
+
Condition
223
+
224
+
Finally, we want to check if there is any IP which found as not safe. This step checks if our "not safe" array is empty. If so, we will close the incident.
225
+
226
+
227
+
228
+
Change Incident Status
229
+
Closes the incident with Benign Positive classification reason.
230
+
231
+
Setup instructions
232
+
233
+
234
+
Create and Upload your watchlist
235
+
236
+
237
+
238
+
Create your input CSV table
239
+
In this use case I have created a simple table, where each row represents an ip address.
240
+
I created the table using Office 365 Excel, and then saved it as a CSV file (save as).
241
+
242
+
Upload your table
243
+
244
+
In Azure Sentinel, go to Watchlists.
245
+
246
+
Click on Add new
247
+
thumbnail image 3 of blog post titled
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+
258
+
259
+
Playbooks & Watchlists Part 2: Automate incident response for Deny-list/Allow-list
260
+
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
Fill in the required details.
275
+
Note that the Alias will be used to query this watchlist in the playbook query step.
276
+
277
+
Add the CSV file
278
+
279
+
Review and create.
280
+
281
+
Playbook deployment instructions
282
+
283
+
284
+
Open the link to the playbook. Scroll down on the page and Click on “Deploy to Azure” or "Deploy to Azure Gov" button depending on your need.
285
+
286
+
Fill the parameters:
287
+
288
+
Basics
289
+
Fill the subscription, resource group and location Sentinel workspace is under.
290
+
Settings
291
+
Playbook name - this is how you'll find the playbook in your subscription
292
+
User name (will affect the names of the API connections resources)
293
+
Check the terms and conditions and click purchase.
294
+
The ARM template, contains the Logic App workflow (playbook) and API connections is now deploying to Azure. When finished, you will be taken to the Azure ARM Template summary page.
295
+
Click on the Logic Apps name. you will be taken to the Logic Apps resource of this playbook.
296
+
Confirm API connections
297
+
On the left menu, click on API connections.
298
+
For each product being used in this playbook, click on the connection name - in our case, it is only the Azure Sentinel connection.
299
+
Click on Authorize to log in with your user, and don't forget to save.
0 commit comments