{
  "version": "Notebook/1.0",
  "items": [
    {
      "type": 1,
      "content": {
        "json": "**NOTE**: This data connector depends on a parser based on Kusto Function **ZPAEvent** to work as expected. [Follow steps to get this Kusto Function](https://aka.ms/sentinel-zpa-parser)"
      },
      "name": "text - 2"
    },
    {
      "type": 9,
      "content": {
        "version": "KqlParameterItem/1.0",
        "parameters": [
          {
            "id": "b5159ec9-d0a5-42ca-8ba1-f6d883ab823b",
            "version": "KqlParameterItem/1.0",
            "name": "TimeRange",
            "type": 4,
            "value": {
              "durationMs": 2592000000
            },
            "typeSettings": {
              "selectableValues": [
                {
                  "durationMs": 3600000
                },
                {
                  "durationMs": 43200000
                },
                {
                  "durationMs": 86400000
                },
                {
                  "durationMs": 604800000
                },
                {
                  "durationMs": 2592000000
                },
                {
                  "durationMs": 7776000000
                }
              ]
            },
            "timeContext": {
              "durationMs": 0
            },
            "timeContextFromParameter": "TimeRange"
          }
        ],
        "style": "pills",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces"
      },
      "name": "parameters - 1"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZPAEvent \r\n| where DvcAction == 'open'\r\n| summarize count() by  SrcGeoCountry",
        "size": 3,
        "title": "Top Countries",
        "timeContext": {
          "durationMs": 0
        },
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "piechart",
        "tileSettings": {
          "titleContent": {
            "columnMatch": "SourceUserName",
            "formatter": 9,
            "formatOptions": {
              "palette": "blue"
            }
          },
          "subtitleContent": {
            "columnMatch": "SourceUserName",
            "formatter": 12,
            "formatOptions": {
              "palette": "blue"
            }
          },
          "leftContent": {
            "columnMatch": "SourceUserName",
            "formatter": 9,
            "formatOptions": {
              "palette": "blue"
            }
          },
          "rightContent": {
            "columnMatch": "SourceIP",
            "formatter": 1,
            "formatOptions": {}
          },
          "showBorder": false,
          "size": "auto"
        },
        "chartSettings": {
          "showMetrics": false,
          "showLegend": true
        }
      },
      "customWidth": "25",
      "name": "query - 4",
      "styleSettings": {
        "maxWidth": "30"
      }
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZPAEvent\r\n| where isnotempty(DvcAction)\r\n| summarize count() by DvcAction",
        "size": 3,
        "title": "Connection status",
        "timeContext": {
          "durationMs": 0
        },
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "piechart"
      },
      "customWidth": "25",
      "name": "Connection status",
      "styleSettings": {
        "margin": "40",
        "padding": "40",
        "maxWidth": "50"
      }
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZPAEvent\n| make-series TotalEvents = count() default = 0 on TimeGenerated from {TimeRange:start} to {TimeRange:end} step {TimeRange:grain};",
        "size": 0,
        "title": "Events over time",
        "color": "magenta",
        "timeContext": {
          "durationMs": 0
        },
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "timechart"
      },
      "customWidth": "50",
      "name": "query - 4"
    },
    {
      "type": 12,
      "content": {
        "version": "NotebookGroup/1.0",
        "groupType": "editable",
        "items": [
          {
            "type": 3,
            "content": {
              "version": "KqlItem/1.0",
              "query": "ZPAEvent\r\n| where DvcAction == 'open'\r\n| summarize EventCount = count() by SrcIpAddr\r\n| top 10 by EventCount",
              "size": 0,
              "title": "Top Source IP",
              "timeContext": {
                "durationMs": 0
              },
              "timeContextFromParameter": "TimeRange",
              "queryType": 0,
              "resourceType": "microsoft.operationalinsights/workspaces",
              "visualization": "barchart"
            },
            "customWidth": "50",
            "name": "query - 0",
            "styleSettings": {
              "maxWidth": "100"
            }
          },
          {
            "type": 3,
            "content": {
              "version": "KqlItem/1.0",
              "query": "ZPAEvent\r\n  | where DvcAction has \"close\"\r\n  | summarize Reason = count() by EventResult",
              "size": 3,
              "title": "Connection close reasons",
              "timeContext": {
                "durationMs": 604800000
              },
              "queryType": 0,
              "resourceType": "microsoft.operationalinsights/workspaces",
              "visualization": "piechart"
            },
            "customWidth": "50",
            "name": "query - 3",
            "styleSettings": {
              "maxWidth": "50"
            }
          }
        ]
      },
      "name": "group - 5"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZPAEvent\r\n  | summarize url = count()by UrlHostname",
        "size": 2,
        "title": "Top urlhostname requests",
        "timeContext": {
          "durationMs": 604800000
        },
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "barchart"
      },
      "name": "query - 6"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "ZPAEvent\r\n| summarize TrafficVolume = sum(tolong(SrcBytes)) by DstUserName\r\n| join kind = inner (ZPAEvent\r\n | make-series Trend = count() default = 0 on TimeGenerated from {TimeRange:start} to {TimeRange:end} step {TimeRange:grain} by DstUserName)\r\n on DstUserName\r\n| project-away DstUserName1, TimeGenerated\r\n| project User = DstUserName, ['Traffic(MB)'] = TrafficVolume/1000000, Trend\r\n| order by ['Traffic(MB)']\r\n| take 8\r\n",
        "size": 1,
        "title": "Top VPN Traffic (per user)",
        "timeContext": {
          "durationMs": 2592000000
        },
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "tiles",
        "gridSettings": {
          "formatters": [
            {
              "columnMatch": "Trend",
              "formatter": 10,
              "formatOptions": {
                "palette": "blue"
              }
            }
          ]
        },
        "tileSettings": {
          "titleContent": {
            "columnMatch": "User",
            "formatter": 1,
            "formatOptions": {}
          },
          "leftContent": {
            "columnMatch": "Traffic(MB)",
            "formatter": 12,
            "formatOptions": {
              "palette": "auto"
            },
            "numberFormat": {
              "unit": 17,
              "options": {
                "style": "decimal",
                "useGrouping": false,
                "maximumFractionDigits": 2,
                "maximumSignificantDigits": 3
              }
            }
          },
          "secondaryContent": {
            "columnMatch": "Trend",
            "formatter": 10,
            "formatOptions": {
              "palette": "blue"
            }
          },
          "showBorder": false
        },
        "chartSettings": {
          "group": "User",
          "createOtherGroup": 0
        }
      },
      "name": "query - 5"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "let listIPs =\nZPAEvent \n| where TimeGenerated > ago(30d)\n| where DvcAction == 'open'\n| summarize ListofIPs = make_set(SrcIpAddr) by DstUserName\n| project ListofIPs;\nlet dt_lookBack = 24h;\nZPAEvent\n| where TimeGenerated > ago(dt_lookBack)\n| where isnotempty(SrcIpAddr)\n| where SrcIpAddr !in (listIPs)\n| summarize EventCount = count() by DstUserName, SrcIpAddr\n| extend Message = \"VPN connection from new IP\"\n| project-away EventCount\n",
        "size": 1,
        "title": "New VPN Users",
        "timeContext": {
          "durationMs": 2592000000
        },
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "table"
      },
      "name": "query - 2"
    },
    {
      "type": 3,
      "content": {
        "version": "KqlItem/1.0",
        "query": "SecurityAlert\r\n| where AlertName has 'VPN'\r\n| extend Severity = AlertSeverity\r\n| extend RuleName = AlertName\r\n| project RuleName, Severity\r\n\r\n",
        "size": 0,
        "title": "Latest Alerts",
        "timeContext": {
          "durationMs": 2592000000
        },
        "timeContextFromParameter": "TimeRange",
        "queryType": 0,
        "resourceType": "microsoft.operationalinsights/workspaces",
        "visualization": "table"
      },
      "customWidth": "50",
      "name": "query - 4"
    }
  ],
  "fromTemplateId": "sentinel-ZscalerZPAWorkbook",
  "$schema": "https://github.com/Microsoft/Application-Insights-Workbooks/blob/master/schema/workbook.json"
}