Zscaler - Unexpected ZPA session duration
| Id | e07846e0-43ad-11ec-81d3-0242ac130003 |
| Rulename | Zscaler - Unexpected ZPA session duration |
| Description | Detects Unexpected ZPA session duration. |
| Severity | Medium |
| Tactics | InitialAccess |
| Techniques | T1078 T1133 |
| Required data connectors | CustomLogsAma |
| Kind | Scheduled |
| Query frequency | 1h |
| Query period | 24h |
| Trigger threshold | 0 |
| Trigger operator | gt |
| Source Uri | https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Zscaler Private Access (ZPA)/Analytic Rules/ZscalerZPAUnexpectedSessionDuration.yaml |
| Version | 1.0.2 |
| Arm template | e07846e0-43ad-11ec-81d3-0242ac130003.json |
let dt_lookBack = 24h;
let time_treshhold = timespan(08:00:00);
let open_sessions =
ZPAEvent
| where TimeGenerated > ago(dt_lookBack)
| where DvcAction == 'open'
| summarize timestampstart = min(TimeGenerated) by DstUserName, SrcIpAddr, NetworkSessionId
| sort by timestampstart asc;
let closed_sessions =
ZPAEvent
| where TimeGenerated > ago(dt_lookBack)
| where DvcAction == 'close'
| summarize timestampend = max(TimeGenerated) by DstUserName, SrcIpAddr, NetworkSessionId
| sort by timestampend asc;
open_sessions
| join (closed_sessions) on DstUserName, SrcIpAddr, NetworkSessionId
| extend duration = timestampend - timestampstart
| where duration > time_treshhold
| where DstUserName !has "ZPA LSS"
| sort by timestampstart asc
| extend IPCustomEntity = SrcIpAddr, AccountCustomEntity = DstUserName
queryPeriod: 24h
query: |
let dt_lookBack = 24h;
let time_treshhold = timespan(08:00:00);
let open_sessions =
ZPAEvent
| where TimeGenerated > ago(dt_lookBack)
| where DvcAction == 'open'
| summarize timestampstart = min(TimeGenerated) by DstUserName, SrcIpAddr, NetworkSessionId
| sort by timestampstart asc;
let closed_sessions =
ZPAEvent
| where TimeGenerated > ago(dt_lookBack)
| where DvcAction == 'close'
| summarize timestampend = max(TimeGenerated) by DstUserName, SrcIpAddr, NetworkSessionId
| sort by timestampend asc;
open_sessions
| join (closed_sessions) on DstUserName, SrcIpAddr, NetworkSessionId
| extend duration = timestampend - timestampstart
| where duration > time_treshhold
| where DstUserName !has "ZPA LSS"
| sort by timestampstart asc
| extend IPCustomEntity = SrcIpAddr, AccountCustomEntity = DstUserName
name: Zscaler - Unexpected ZPA session duration
entityMappings:
- fieldMappings:
- columnName: AccountCustomEntity
identifier: Name
entityType: Account
- fieldMappings:
- columnName: IPCustomEntity
identifier: Address
entityType: IP
queryFrequency: 1h
OriginalUri: https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Zscaler Private Access (ZPA)/Analytic Rules/ZscalerZPAUnexpectedSessionDuration.yaml
requiredDataConnectors:
- connectorId: CustomLogsAma
datatypes:
- ZPA_CL
description: |
'Detects Unexpected ZPA session duration.'
kind: Scheduled
version: 1.0.2
status: Available
severity: Medium
relevantTechniques:
- T1078
- T1133
triggerOperator: gt
triggerThreshold: 0
tactics:
- InitialAccess
id: e07846e0-43ad-11ec-81d3-0242ac130003