content
After Width: | Height: | Size: 67 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 55 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 40 KiB |
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 62 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 57 KiB |
@ -35,4 +35,145 @@ You'll need to have access to:
|
|||||||
|
|
||||||
2. Navigate to **My flows > New > Scheduled - from blank**.
|
2. Navigate to **My flows > New > Scheduled - from blank**.
|
||||||
|
|
||||||
3.
|

|
||||||
|
|
||||||
|
|
||||||
|
3. Create the flow:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
4. Set the recurrence:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
5. The example below uses an HTTP call to Microsoft Defender Security Center API. You can also replace it with the out-of-the-box "WDATP Connector" (action: "Machines – Get list of machines").
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
6. Set the JSON file with the following value:
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"@@odata.context": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"value": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"id": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"computerDnsName": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"firstSeen": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"lastSeen": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"osPlatform": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"osVersion": {},
|
||||||
|
"lastIpAddress": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"lastExternalIpAddress": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"agentVersion": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"osBuild": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"healthStatus": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"riskScore": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"exposureScore": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"aadDeviceId": {},
|
||||||
|
"machineTags": {
|
||||||
|
"type": "array"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"id",
|
||||||
|
"computerDnsName",
|
||||||
|
"firstSeen",
|
||||||
|
"lastSeen",
|
||||||
|
"osPlatform",
|
||||||
|
"osVersion",
|
||||||
|
"lastIpAddress",
|
||||||
|
"lastExternalIpAddress",
|
||||||
|
"agentVersion",
|
||||||
|
"osBuild",
|
||||||
|
"healthStatus",
|
||||||
|
"rbacGroupId",
|
||||||
|
"rbacGroupName",
|
||||||
|
"riskScore",
|
||||||
|
"exposureScore",
|
||||||
|
"aadDeviceId",
|
||||||
|
"machineTags"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
7. Extract the values from the JSON call and check if the onboarded machine(s) is / are already registered at the SharePoint list as an example:
|
||||||
|
- If yes, no notification will be triggered
|
||||||
|
- If no, will register the new onboarded machine(s) in the SharePoint list and a notification will be sent to the Microsoft Defender ATP admin
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Alert notification
|
||||||
|
The following image is an example of an email notification.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## Tips
|
||||||
|
|
||||||
|
- You can filter here using lastSeen only:
|
||||||
|
- Every 60 min:
|
||||||
|
- Take all machines last seen in the past 7 days.
|
||||||
|
|
||||||
|
- For each machine:
|
||||||
|
- If last seen property is on the one hour interval of [-7 days, -7days + 60 minutes ] -> Alert for offboarding possibility
|
||||||
|
- If first seen is on the past hour -> Alert for onboarding.
|
||||||
|
|
||||||
|
In this solution you will not have duplicate alerts too:
|
||||||
|
There are tenants that have numerous machines. Getting all those machines might be very expensive and might require paging.
|
||||||
|
|
||||||
|
You can split it to two queries:
|
||||||
|
1) For offboarding take only this interval using the OData $filter and only notify if the conditions are met.
|
||||||
|
2) Take all machines last seen in the past hour and check first seen property for them (if the first seen property is on the past hour, the last seen must be there too. )
|
||||||
|
|
||||||
|