Microsoft Sentinel Analytic Rules
cloudbrothers.infoAzure Sentinel RepoToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Zscaler - Connections by dormant user

Back
Id66bc77ee-3e45-11ec-9bbc-0242ac130002
RulenameZscaler - Connections by dormant user
DescriptionDetects ZPA connections by dormant user.
SeverityHigh
TacticsPersistence
TechniquesT1078
Required data connectorsCustomLogsAma
ZscalerPrivateAccess
KindScheduled
Query frequency1h
Query period14d
Trigger threshold0
Trigger operatorgt
Source Urihttps://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Zscaler Private Access (ZPA)/Analytic Rules/ZscalerZPAConnectionsByDormantUser.yaml
Version1.0.1
Arm template66bc77ee-3e45-11ec-9bbc-0242ac130002.json
Deploy To Azure
let dt_lastlogintime = 14d;
let activeUsers =
ZPAEvent 
| where TimeGenerated > ago(dt_lastlogintime)
| where DvcAction == 'open'
| summarize lastLoginTime = max(TimeGenerated) by DstUserName
| summarize makelist(DstUserName);
ZPAEvent
| where DstUserName !in~ (activeUsers)
| summarize EventCount = count() by DstUserName
| project-away EventCount
| extend AccountCustomEntity = DstUserName
relevantTechniques:
- T1078
name: Zscaler - Connections by dormant user
requiredDataConnectors:
- dataTypes:
  - ZPAEvent
  connectorId: ZscalerPrivateAccess
- datatypes:
  - ZPA_CL
  connectorId: CustomLogsAma
entityMappings:
- fieldMappings:
  - identifier: Name
    columnName: AccountCustomEntity
  entityType: Account
triggerThreshold: 0
id: 66bc77ee-3e45-11ec-9bbc-0242ac130002
tactics:
- Persistence
version: 1.0.1
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Zscaler Private Access (ZPA)/Analytic Rules/ZscalerZPAConnectionsByDormantUser.yaml
queryPeriod: 14d
kind: Scheduled
queryFrequency: 1h
severity: High
status: Available
description: |
    'Detects ZPA connections by dormant user.'
query: |
  let dt_lastlogintime = 14d;
  let activeUsers =
  ZPAEvent 
  | where TimeGenerated > ago(dt_lastlogintime)
  | where DvcAction == 'open'
  | summarize lastLoginTime = max(TimeGenerated) by DstUserName
  | summarize makelist(DstUserName);
  ZPAEvent
  | where DstUserName !in~ (activeUsers)
  | summarize EventCount = count() by DstUserName
  | project-away EventCount
  | extend AccountCustomEntity = DstUserName  
triggerOperator: gt
{
  "$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/66bc77ee-3e45-11ec-9bbc-0242ac130002')]",
      "kind": "Scheduled",
      "name": "[concat(parameters('workspace'),'/Microsoft.SecurityInsights/66bc77ee-3e45-11ec-9bbc-0242ac130002')]",
      "properties": {
        "alertRuleTemplateName": "66bc77ee-3e45-11ec-9bbc-0242ac130002",
        "customDetails": null,
        "description": "'Detects ZPA connections by dormant user.'\n",
        "displayName": "Zscaler - Connections by dormant user",
        "enabled": true,
        "entityMappings": [
          {
            "entityType": "Account",
            "fieldMappings": [
              {
                "columnName": "AccountCustomEntity",
                "identifier": "Name"
              }
            ]
          }
        ],
        "OriginalUri": "https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Zscaler Private Access (ZPA)/Analytic Rules/ZscalerZPAConnectionsByDormantUser.yaml",
        "query": "let dt_lastlogintime = 14d;\nlet activeUsers =\nZPAEvent \n| where TimeGenerated > ago(dt_lastlogintime)\n| where DvcAction == 'open'\n| summarize lastLoginTime = max(TimeGenerated) by DstUserName\n| summarize makelist(DstUserName);\nZPAEvent\n| where DstUserName !in~ (activeUsers)\n| summarize EventCount = count() by DstUserName\n| project-away EventCount\n| extend AccountCustomEntity = DstUserName\n",
        "queryFrequency": "PT1H",
        "queryPeriod": "P14D",
        "severity": "High",
        "status": "Available",
        "subTechniques": [],
        "suppressionDuration": "PT1H",
        "suppressionEnabled": false,
        "tactics": [
          "Persistence"
        ],
        "techniques": [
          "T1078"
        ],
        "templateVersion": "1.0.1",
        "triggerOperator": "GreaterThan",
        "triggerThreshold": 0
      },
      "type": "Microsoft.OperationalInsights/workspaces/providers/alertRules"
    }
  ]
}