Back
Id4f7b9e6c-5d1a-4392-8c2b-3e4f5a6b7c8d
RulenameUniFi Site Manager: Console firmware likely security-relevant
DescriptionIdentifies UniFi console / gateway devices (UDM, Cloud Key, USG, UXG, gateway) running firmware behind a major or minor version of the available release. Major/minor firmware jumps on consoles routinely include security advisory fixes (e.g. UniFi Security Advisory Bulletins). Patch-level updates are excluded since those are typically minor non-security bug fixes covered by the lower-severity FirmwareUpdateAvailable rule.
SeverityHigh
TacticsInitialAccess
TechniquesT1190
Required data connectorsUniFiSiteManagerConnectorDefinition
KindScheduled
Query frequency6h
Query period6h
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/UniFi%20Site%20Manager%20%28CCF%29/Analytic%20Rules/UniFiCloudConsoleSecurityFirmwareGap.yaml
Version1.0.0
Arm template4f7b9e6c-5d1a-4392-8c2b-3e4f5a6b7c8d.json
Deploy To Azure
// Detects consoles/gateways with a major-or-minor firmware Version gap vs the available release.
// Patch-level gaps (e.g. 5.1.11 -> 5.1.12) are excluded - covered by FirmwareUpdateAvailable at Low severity.
Unifi_SiteManager_Devices_CL
| where TimeGenerated > ago(6h)
| summarize arg_max(TimeGenerated, *) by Id
| where IsConsole == true
| where FirmwareStatus == "updateAvailable"
| where isnotempty(Version) and isnotempty(UpdateAvailable)
| extend
    currentMajor = toint(extract(@"^(\d+)\.", 1, Version)),
    currentMinor = toint(extract(@"^\d+\.(\d+)", 1, Version)),
    availableMajor = toint(extract(@"^(\d+)\.", 1, UpdateAvailable)),
    availableMinor = toint(extract(@"^\d+\.(\d+)", 1, UpdateAvailable))
| where isnotnull(currentMajor) and isnotnull(availableMajor)
| where (availableMajor > currentMajor) or (availableMajor == currentMajor and availableMinor > currentMinor)
| extend GapType = iff(availableMajor > currentMajor, "major", "minor")
| extend
    TimeGenerated = now(),
    Activity = strcat('Console ', Name, ' running ', Version, ' - likely security-relevant ', GapType, ' update available to ', UpdateAvailable)
| project
    TimeGenerated,
    DeviceId = Id,
    DeviceName = Name,
    Model = Model,
    ProductLine = ProductLine,
    CurrentVersion = Version,
    AvailableVersion = UpdateAvailable,
    GapType,
    Activity
entityMappings:
- entityType: Host
  fieldMappings:
  - identifier: HostName
    columnName: DeviceName
  - identifier: NetBiosName
    columnName: DeviceId
name: 'UniFi Site Manager: Console firmware likely security-relevant'
kind: Scheduled
triggerOperator: gt
status: Available
subTechniques: []
queryPeriod: 6h
requiredDataConnectors:
- connectorId: UniFiSiteManagerConnectorDefinition
  dataTypes:
  - Unifi_SiteManager_Devices_CL
tactics:
- InitialAccess
query: |
  // Detects consoles/gateways with a major-or-minor firmware Version gap vs the available release.
  // Patch-level gaps (e.g. 5.1.11 -> 5.1.12) are excluded - covered by FirmwareUpdateAvailable at Low severity.
  Unifi_SiteManager_Devices_CL
  | where TimeGenerated > ago(6h)
  | summarize arg_max(TimeGenerated, *) by Id
  | where IsConsole == true
  | where FirmwareStatus == "updateAvailable"
  | where isnotempty(Version) and isnotempty(UpdateAvailable)
  | extend
      currentMajor = toint(extract(@"^(\d+)\.", 1, Version)),
      currentMinor = toint(extract(@"^\d+\.(\d+)", 1, Version)),
      availableMajor = toint(extract(@"^(\d+)\.", 1, UpdateAvailable)),
      availableMinor = toint(extract(@"^\d+\.(\d+)", 1, UpdateAvailable))
  | where isnotnull(currentMajor) and isnotnull(availableMajor)
  | where (availableMajor > currentMajor) or (availableMajor == currentMajor and availableMinor > currentMinor)
  | extend GapType = iff(availableMajor > currentMajor, "major", "minor")
  | extend
      TimeGenerated = now(),
      Activity = strcat('Console ', Name, ' running ', Version, ' - likely security-relevant ', GapType, ' update available to ', UpdateAvailable)
  | project
      TimeGenerated,
      DeviceId = Id,
      DeviceName = Name,
      Model = Model,
      ProductLine = ProductLine,
      CurrentVersion = Version,
      AvailableVersion = UpdateAvailable,
      GapType,
      Activity
description: |
  Identifies UniFi console / gateway devices (UDM, Cloud Key, USG, UXG, gateway) running firmware behind a major or minor version of the available release. Major/minor firmware jumps on consoles routinely include security advisory fixes (e.g. UniFi Security Advisory Bulletins). Patch-level updates are excluded since those are typically minor non-security bug fixes covered by the lower-severity FirmwareUpdateAvailable rule.
severity: High
incidentConfiguration:
  groupingConfiguration:
    lookbackDuration: P1D
    enabled: true
    reopenClosedIncident: false
    matchingMethod: AllEntities
  createIncident: true
id: 4f7b9e6c-5d1a-4392-8c2b-3e4f5a6b7c8d
triggerThreshold: 0
queryFrequency: 6h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/UniFi%20Site%20Manager%20%28CCF%29/Analytic%20Rules/UniFiCloudConsoleSecurityFirmwareGap.yaml
version: 1.0.0
relevantTechniques:
- T1190
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "workspace": {
      "type": "String"
    }
  },
  "resources": [
    {
      "apiVersion": "2024-01-01-preview",
      "id": "[concat(resourceId('Microsoft.OperationalInsights/workspaces/providers', parameters('workspace'), 'Microsoft.SecurityInsights'),'/alertRules/4f7b9e6c-5d1a-4392-8c2b-3e4f5a6b7c8d')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/4f7b9e6c-5d1a-4392-8c2b-3e4f5a6b7c8d')]",
      "properties": {
        "alertRuleTemplateName": "4f7b9e6c-5d1a-4392-8c2b-3e4f5a6b7c8d",
        "customDetails": null,
        "description": "Identifies UniFi console / gateway devices (UDM, Cloud Key, USG, UXG, gateway) running firmware behind a major or minor version of the available release. Major/minor firmware jumps on consoles routinely include security advisory fixes (e.g. UniFi Security Advisory Bulletins). Patch-level updates are excluded since those are typically minor non-security bug fixes covered by the lower-severity FirmwareUpdateAvailable rule.\n",
        "displayName": "UniFi Site Manager: Console firmware likely security-relevant",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Host",
            "fieldMappings": [
              {
                "columnName": "DeviceName",
                "identifier": "HostName"
              },
              {
                "columnName": "DeviceId",
                "identifier": "NetBiosName"
              }
            ]
          }
        ],
        "incidentConfiguration": {
          "createIncident": true,
          "groupingConfiguration": {
            "enabled": true,
            "lookbackDuration": "P1D",
            "matchingMethod": "AllEntities",
            "reopenClosedIncident": false
          }
        },
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/UniFi%20Site%20Manager%20%28CCF%29/Analytic%20Rules/UniFiCloudConsoleSecurityFirmwareGap.yaml",
        "query": "// Detects consoles/gateways with a major-or-minor firmware Version gap vs the available release.\n// Patch-level gaps (e.g. 5.1.11 -> 5.1.12) are excluded - covered by FirmwareUpdateAvailable at Low severity.\nUnifi_SiteManager_Devices_CL\n| where TimeGenerated > ago(6h)\n| summarize arg_max(TimeGenerated, *) by Id\n| where IsConsole == true\n| where FirmwareStatus == \"updateAvailable\"\n| where isnotempty(Version) and isnotempty(UpdateAvailable)\n| extend\n    currentMajor = toint(extract(@\"^(\\d+)\\.\", 1, Version)),\n    currentMinor = toint(extract(@\"^\\d+\\.(\\d+)\", 1, Version)),\n    availableMajor = toint(extract(@\"^(\\d+)\\.\", 1, UpdateAvailable)),\n    availableMinor = toint(extract(@\"^\\d+\\.(\\d+)\", 1, UpdateAvailable))\n| where isnotnull(currentMajor) and isnotnull(availableMajor)\n| where (availableMajor > currentMajor) or (availableMajor == currentMajor and availableMinor > currentMinor)\n| extend GapType = iff(availableMajor > currentMajor, \"major\", \"minor\")\n| extend\n    TimeGenerated = now(),\n    Activity = strcat('Console ', Name, ' running ', Version, ' - likely security-relevant ', GapType, ' update available to ', UpdateAvailable)\n| project\n    TimeGenerated,\n    DeviceId = Id,\n    DeviceName = Name,\n    Model = Model,\n    ProductLine = ProductLine,\n    CurrentVersion = Version,\n    AvailableVersion = UpdateAvailable,\n    GapType,\n    Activity\n",
        "queryFrequency": "PT6H",
        "queryPeriod": "PT6H",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "InitialAccess"
        ],
        "techniques": [
          "T1190"
        ],
        "templateVersion": "1.0.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}