Zscaler Private Access (ZPA) - Unexpected session duration encountered
Describe the bug Analytics rule appears to be no longer valid. https://github.com/Azure/Azure-Sentinel/blob/master/Solutions/Zscaler%20Private%20Access%20(ZPA)/Analytic%20Rules/ZscalerZPAUnexpectedSessionDuration.yaml
To Reproduce Steps to reproduce the behavior:
- Configure ZPA timeout policy (e.g. 4 hours)
- Enable analytics rule on Sentinel
- Wait for lookback period (e.g. 24 hours)
- Multiple alerts triggered by various users (e.g. Session ID would be the same for each user)
Expected behavior Few or none alerts triggered
Additional context Opened a case with Zscaler Support (Case Number: 05699828) on same Session ID and their response:
Unfortunately, there is currently no method to track user reauthentication events based on the 4-hour timeout policy using the User Status or any other logs available within the Zscaler portal.
Pending Zscaler response if they can provide an update to this analytics rule.
@v-sudkharat we had a call with Zscaler support and they told us it is not possible to detect the timeout based on the forwarded User Activity logs.
May we know who provided this rule initially and if the creator can provide clarity to the validity of this rule?
Hi @hgtok , Thanks for flagging this issue, we will investigate this issue and get back to you with some updates. Thanks!
Hey @hgtok ,
Apologies for the delayed response. I was reviewing point 4 in your reproduction steps, and I wanted to ask for some clarification so I can better understand and reproduce the issue. You mentioned: “Multiple alerts triggered by various users (e.g., Session ID would be the same for each user).”
Could you please clarify what you observed? Are multiple users being assigned the same Session ID? OR Is a single user/session triggering multiple alerts for the same Session ID?
This distinction will help narrow down where the issue originates (the ZPA logs, the parser, or the analytics rule logic).
Additionally, if possible, could you provide a screenshot or sample snippet of the affected logs/alerts? Seeing an example would help me understand the behavior more quickly and work on identifying the root cause.
Hello @hgtok , this is a gentle reminder that we’re awaiting your response on this issue. If you still need it to remain open, please reply within the next 2 days. Otherwise, we will proceed to close the issue after that time. Thanks!
Hi @v-kasghosh , I'll get back to you with the relevant information.
@v-kasghosh FYI there is no longer a NetworkSessionId field.
pls refer to these docs for the latest fields: help.zscaler.com/zpa/understanding-user-activity-log-fields help.zscaler.com/zpa/understanding-user-status-log-fields
we assume the correct field is SessionID and would provide our observation again.
Hey @hgtok ,
Thank you for your feedback. We will look into this further.
Hey @hgtok ,
I'm sharing the updated analytic query with you:
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, SessionID
| sort by timestampstart asc;
let closed_sessions =
ZPAEvent
| where TimeGenerated > ago(dt_lookBack)
| where DvcAction == 'close'
| summarize timestampend = max(TimeGenerated) by DstUserName, SrcIpAddr, SessionID
| sort by timestampend asc;
open_sessions
| join (closed_sessions) on DstUserName, SrcIpAddr, SessionID
| extend duration = timestampend - timestampstart
| where duration > time_treshhold
| where DstUserName !has "ZPA LSS"
| sort by timestampstart asc
| extend IPCustomEntity = SrcIpAddr, AccountCustomEntity = DstUserName
Could you please review it and let us know if this resolves the issue? Once you confirm, we’ll move forward with repackaging the solution so the updated rule will be available in the content hub.
Thanks!
hey @hgtok @yongxiangwong2 ,
Do you have any updates on this? We're still waiting for your response.
@v-kasghosh
-
SessionIDdoes not seems to be correct, as it picking up too many results that exceeded the company policy of 4 hours -
ConnectionIDseem to be a better fit as they are within the expected policy of 4 hours
Hey @hgtok ,
Thank you for sharing your information. We will look into it further and update you once we have more details.
Hey @hgtok , Could you please share more details on whether replacing SessionID with ConnectionID is providing the expected results in your environment? This will help us determine the correct direction for updating (or reconsidering) the analytic rule. Thanks in advance for the clarification.
@v-kasghosh yes, by using ConnectionID, we have reduced the false positives.
Do note that in Zscaler Web UI, sometimes ConnectionID is mispresented by SessionID, and vice versa. We confirmed this with Zscaler Support. The way to verify is that ConnectionID would contain a comma ','.
Hey @hgtok ,
Thank you for confirming. We have raised PR #13425 , and after completing the necessary testing, the PR will be merged After that updated solution will then be available in the content hub. Thank you for your cooperation!