Back
Id2dafed9a-a8ea-4696-82ac-63ec6e5a3dab
RulenameSonicWall CSE - Device trust level dropped to AlwaysDeny
DescriptionA device’s SonicWall Cloud Secure Edge (CSE) trust level changed to AlwaysDeny, so the device

is denied access to protected resources. Causes include failed trust factors (for example

disk encryption or firewall turned off), no trust profile matching the device (“Default”),

or an administrator ban. Alerts once per change: the trust state repeats on every Service

Tunnel event, so only TrustScoring events are evaluated, and an evaluation that stays at

AlwaysDeny does not alert again.

Evaluates events by when they reached Sentinel, so events that arrive late (connector

delay or a backfill) are evaluated once, when they arrive. The query period is 2 days to

include backfilled events, which keep their own time for up to 48 hours.
SeverityMedium
TacticsDefenseEvasion
TechniquesT1562
Required data connectorsSonicWallCSEEvents
KindScheduled
Query frequency1h
Query period2d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/SonicWall%20Cloud%20Secure%20Edge/Analytic%20Rules/SonicWallCSEDeviceTrustAlwaysDeny.yaml
Version1.1.0
Arm template2dafed9a-a8ea-4696-82ac-63ec6e5a3dab.json
Deploy To Azure
let RunWindow = 1h;
CSEEvents
| where EventType == "TrustScoring" and isnotempty(DeviceSerialNumber)
| order by DeviceSerialNumber asc, EventTime asc
| extend PreviousLevel = iff(prev(DeviceSerialNumber) == DeviceSerialNumber, prev(TrustLevel), "")
| where TrustLevel == "AlwaysDeny" and PreviousLevel != "AlwaysDeny"
| where IngestedAt > ago(RunWindow)
| project TimeGenerated, EventTime, Action, DeviceSerialNumber, DeviceName, DevicePlatform, UserEmail,
    PreviousLevel, TrustLevel, TrustScore, TrustProfileName, FailedFactors, EventId
| extend
    AccountName = tostring(split(UserEmail, "@")[0]),
    UPNSuffix = tostring(split(UserEmail, "@")[1]),
    HostName = coalesce(DeviceName, DeviceSerialNumber),
    FailedFactorList = strcat_array(FailedFactors, ", ")
customDetails:
  FailedFactors: FailedFactorList
  PreviousLevel: PreviousLevel
  TrustProfile: TrustProfileName
alertDetailsOverride:
  alertDescriptionFormat: 'Trust level changed from {{PreviousLevel}} to AlwaysDeny. Failed factors: {{FailedFactorList}}.'
  alertDisplayNameFormat: 'SonicWall CSE: device {{HostName}} trust level AlwaysDeny'
severity: Medium
requiredDataConnectors:
- connectorId: SonicWallCSEEvents
  dataTypes:
  - CSEEvents_CL
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/SonicWall%20Cloud%20Secure%20Edge/Analytic%20Rules/SonicWallCSEDeviceTrustAlwaysDeny.yaml
queryFrequency: 1h
entityMappings:
- fieldMappings:
  - identifier: HostName
    columnName: HostName
  entityType: Host
- fieldMappings:
  - identifier: FullName
    columnName: UserEmail
  - identifier: Name
    columnName: AccountName
  - identifier: UPNSuffix
    columnName: UPNSuffix
  entityType: Account
kind: Scheduled
relevantTechniques:
- T1562
triggerOperator: gt
queryPeriod: 2d
query: |
  let RunWindow = 1h;
  CSEEvents
  | where EventType == "TrustScoring" and isnotempty(DeviceSerialNumber)
  | order by DeviceSerialNumber asc, EventTime asc
  | extend PreviousLevel = iff(prev(DeviceSerialNumber) == DeviceSerialNumber, prev(TrustLevel), "")
  | where TrustLevel == "AlwaysDeny" and PreviousLevel != "AlwaysDeny"
  | where IngestedAt > ago(RunWindow)
  | project TimeGenerated, EventTime, Action, DeviceSerialNumber, DeviceName, DevicePlatform, UserEmail,
      PreviousLevel, TrustLevel, TrustScore, TrustProfileName, FailedFactors, EventId
  | extend
      AccountName = tostring(split(UserEmail, "@")[0]),
      UPNSuffix = tostring(split(UserEmail, "@")[1]),
      HostName = coalesce(DeviceName, DeviceSerialNumber),
      FailedFactorList = strcat_array(FailedFactors, ", ")
name: SonicWall CSE - Device trust level dropped to AlwaysDeny
triggerThreshold: 0
version: 1.1.0
id: 2dafed9a-a8ea-4696-82ac-63ec6e5a3dab
description: |
  'A device's SonicWall Cloud Secure Edge (CSE) trust level changed to AlwaysDeny, so the device
  is denied access to protected resources. Causes include failed trust factors (for example
  disk encryption or firewall turned off), no trust profile matching the device ("Default"),
  or an administrator ban. Alerts once per change: the trust state repeats on every Service
  Tunnel event, so only TrustScoring events are evaluated, and an evaluation that stays at
  AlwaysDeny does not alert again.
  Evaluates events by when they reached Sentinel, so events that arrive late (connector
  delay or a backfill) are evaluated once, when they arrive. The query period is 2 days to
  include backfilled events, which keep their own time for up to 48 hours.'
tactics:
- DefenseEvasion
{
  "$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/2dafed9a-a8ea-4696-82ac-63ec6e5a3dab')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/2dafed9a-a8ea-4696-82ac-63ec6e5a3dab')]",
      "properties": {
        "alertDetailsOverride": {
          "alertDescriptionFormat": "Trust level changed from {{PreviousLevel}} to AlwaysDeny. Failed factors: {{FailedFactorList}}.",
          "alertDisplayNameFormat": "SonicWall CSE: device {{HostName}} trust level AlwaysDeny"
        },
        "alertRuleTemplateName": "2dafed9a-a8ea-4696-82ac-63ec6e5a3dab",
        "customDetails": {
          "FailedFactors": "FailedFactorList",
          "PreviousLevel": "PreviousLevel",
          "TrustProfile": "TrustProfileName"
        },
        "description": "'A device's SonicWall Cloud Secure Edge (CSE) trust level changed to AlwaysDeny, so the device\nis denied access to protected resources. Causes include failed trust factors (for example\ndisk encryption or firewall turned off), no trust profile matching the device (\"Default\"),\nor an administrator ban. Alerts once per change: the trust state repeats on every Service\nTunnel event, so only TrustScoring events are evaluated, and an evaluation that stays at\nAlwaysDeny does not alert again.\nEvaluates events by when they reached Sentinel, so events that arrive late (connector\ndelay or a backfill) are evaluated once, when they arrive. The query period is 2 days to\ninclude backfilled events, which keep their own time for up to 48 hours.'\n",
        "displayName": "SonicWall CSE - Device trust level dropped to AlwaysDeny",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Host",
            "fieldMappings": [
              {
                "columnName": "HostName",
                "identifier": "HostName"
              }
            ]
          },
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "UserEmail",
                "identifier": "FullName"
              },
              {
                "columnName": "AccountName",
                "identifier": "Name"
              },
              {
                "columnName": "UPNSuffix",
                "identifier": "UPNSuffix"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/SonicWall%20Cloud%20Secure%20Edge/Analytic%20Rules/SonicWallCSEDeviceTrustAlwaysDeny.yaml",
        "query": "let RunWindow = 1h;\nCSEEvents\n| where EventType == \"TrustScoring\" and isnotempty(DeviceSerialNumber)\n| order by DeviceSerialNumber asc, EventTime asc\n| extend PreviousLevel = iff(prev(DeviceSerialNumber) == DeviceSerialNumber, prev(TrustLevel), \"\")\n| where TrustLevel == \"AlwaysDeny\" and PreviousLevel != \"AlwaysDeny\"\n| where IngestedAt > ago(RunWindow)\n| project TimeGenerated, EventTime, Action, DeviceSerialNumber, DeviceName, DevicePlatform, UserEmail,\n    PreviousLevel, TrustLevel, TrustScore, TrustProfileName, FailedFactors, EventId\n| extend\n    AccountName = tostring(split(UserEmail, \"@\")[0]),\n    UPNSuffix = tostring(split(UserEmail, \"@\")[1]),\n    HostName = coalesce(DeviceName, DeviceSerialNumber),\n    FailedFactorList = strcat_array(FailedFactors, \", \")\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "P2D",
        "severity": "Medium",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "DefenseEvasion"
        ],
        "techniques": [
          "T1562"
        ],
        "templateVersion": "1.1.0",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}