Repository navigation
Expand file tree
/
Copy pathUniFi-ISP-Packet-Loss.json
More file actions
75 lines (75 loc) · 4.14 KB
/
Copy pathUniFi-ISP-Packet-Loss.json
File metadata and controls
75 lines (75 loc) · 4.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspace": {
"type": "String"
}
},
"resources": [
{
"id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/a1b2c3d4-1234-5678-9abc-def012345006')]",
"name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/a1b2c3d4-1234-5678-9abc-def012345006')]",
"type": "Microsoft.OperationalInsights/workspaces/providers/alertRules",
"kind": "Scheduled",
"apiVersion": "2023-12-01-preview",
"properties": {
"displayName": "UniFi Site Manager - ISP Packet Loss",
"description": "Detects when packet loss is occurring on the WAN connection. Even small amounts of packet loss can significantly impact application performance, VoIP calls, and video conferencing.",
"severity": "Medium",
"enabled": true,
"query": "// UniFi ISP Packet Loss Detection\n// Author: Fetch Labs (https://sentinel.blog)\nlet PacketLossThreshold = 1;\nUniFiSiteManager_ISPMetrics_CL\n| where TimeGenerated > ago(30m)\n| mv-expand period = periods\n| extend \n metricTime = todatetime(period.metricTime),\n packetLoss = toint(period.data.wan.packetLoss),\n ispName = tostring(period.data.wan.ispName),\n ispAsn = tostring(period.data.wan.ispAsn),\n avgLatency = toint(period.data.wan.avgLatency)\n| where packetLoss >= PacketLossThreshold\n| summarize \n TotalPacketLoss = sum(packetLoss),\n EventCount = count(),\n AvgLatency = avg(avgLatency),\n FirstSeen = min(metricTime),\n LastSeen = max(metricTime)\n by siteId, ispName, ispAsn\n| extend TimeGenerated = now()\n| project\n TimeGenerated,\n SiteId = siteId,\n ISPName = ispName,\n ISPAsn = ispAsn,\n TotalPacketLoss,\n EventCount,\n AvgLatencyMs = round(AvgLatency, 1),\n FirstSeen,\n LastSeen\n",
"queryFrequency": "PT15M",
"queryPeriod": "PT30M",
"triggerOperator": "GreaterThan",
"triggerThreshold": 0,
"suppressionDuration": "PT1H",
"suppressionEnabled": true,
"startTimeUtc": null,
"tactics": [
"Impact"
],
"techniques": [
"T1498",
"T1499"
],
"subTechniques": [
"T1498.001"
],
"alertRuleTemplateName": null,
"incidentConfiguration": {
"createIncident": true,
"groupingConfiguration": {
"enabled": true,
"reopenClosedIncident": false,
"lookbackDuration": "PT4H",
"matchingMethod": "Selected",
"groupByEntities": null,
"groupByAlertDetails": null,
"groupByCustomDetails": [
"SiteId",
"ISPName"
]
}
},
"eventGroupingSettings": {
"aggregationKind": "AlertPerResult"
},
"alertDetailsOverride": {
"alertDisplayNameFormat": "UniFi Packet Loss: {{ISPName}} - {{TotalPacketLoss}} events",
"alertDescriptionFormat": "Packet loss on {{ISPName}} for site {{SiteId}}. Events: {{TotalPacketLoss}}."
},
"customDetails": {
"SiteId": "SiteId",
"ISPName": "ISPName",
"ISPAsn": "ISPAsn",
"TotalPacketLoss": "TotalPacketLoss",
"EventCount": "EventCount",
"AvgLatencyMs": "AvgLatencyMs"
},
"entityMappings": null,
"sentinelEntitiesMappings": null
}
}
]
}