Zscaler Microsoft Sentinel Deployment Guide FINAL
Zscaler Microsoft Sentinel Deployment Guide FINAL
MICROSOFT SENTINEL
DEPLOYMENT GUIDE
Contents
Terms and Acronyms 7
Trademark Notice 8
About This Document 9
Zscaler Overview 9
Audience 9
Software Versions 9
Request for Comments 9
Zscaler and Microsoft Introduction 10
ZIA Overview 10
Zscaler Resources 10
Microsoft Sentinel Overview 11
Microsoft Sentinel Resources 11
Document Prerequisites 11
Syslog, CEF, and LEEF 12
Syslog 12
CEF 13
LEEF 13
Zscaler Logging Architecture 14
NSS 14
About Cloud-To-Cloud Log Streaming 15
ZIA Log Feeds 15
Configuring Sentinel for Cloud NSS-Based Log Ingestion 16
Step 1. In the Azure Portal, Create a Log Analytics Workspace,
and Add Microsoft Sentinel to the Workspace 16
Step 2: In the Azure Portal, Create a Data Collection Endpoint 18
Acronym Definition
AMA Azure Monitor Agent
CEF Common Event Format
GRE Generic Routing Encapsulation (RFC2890)
JWT JSON Web Token
LEEF Log Event Extended Format
LSS Log Streaming Service (For ZPA)
NSG Network Service Group (Azure)
NSS Nanolog Streaming Service (For ZIA)
SOC Security Operations Center
SSH Secure Socket Shell
SSL Secure Socket Layer (RFC6101)
TLS Transport Layer Security (RFC5246)
Vnet Virtual Network (Azure)
ZIA Zscaler Internet Access (Zscaler)
ZPA Zscaler Private Access (Zscaler)
Trademark Notice
© 2023 Zscaler, Inc. All rights reserved. Zscaler™ and other trademarks listed at zscaler.com/legal/trademarks are either (i)
registered trademarks or service marks or (ii) trademarks or service marks of Zscaler, Inc. in the United States and/or other
countries. Any other trademarks are the properties of their respective owners.
Zscaler Overview
Zscaler (NASDAQ: ZS) enables the world’s leading organizations to securely transform their networks and applications for
a mobile and cloud-first world. ZIA and ZPA, create fast, secure connections between users and applications, regardless
of device, location, or network. Zscaler delivers its services 100% in the cloud and offers the simplicity, enhanced
security, and improved user experience that traditional appliances or hybrid solutions can’t match. Used in more than
185 countries, Zscaler operates a massive, global cloud security platform that protects thousands of enterprises and
government agencies from cyberattacks and data loss. To learn more, see Zscaler’s website or follow Zscaler on Twitter @
zscaler.
Microsoft Overview
Microsoft (Nasdaq: MSFT), Microsoft develops and licenses consumer and enterprise software. It is known for its
Windows operating systems and Office productivity suite. The company is organized into three equally sized broad
segments: productivity and business processes (legacy Microsoft Office, cloud-based Office 365, Exchange, SharePoint,
Skype, LinkedIn, Dynamics), intelligence cloud (infrastructure- and platform-as-a-service offerings Azure, Windows Server
OS, SQL Server), and more personal computing (Windows Client, Xbox, Bing search, display advertising, and Surface
laptops, tablets, and desktops).
Audience
This guide is for network administrators, endpoint and IT administrators, and security analysts responsible for deploying,
monitoring, and managing enterprise security systems. For additional product and company resources, refer to the
Appendix sections:
• Zscaler Resources
• Microsoft Sentinel Resources
• Appendix A: Requesting Zscaler Support
Software Versions
This document was written using ZIA v5.7, NSS v4.0.4, Linux Ubuntu Server 18.04 LTS (any Linux version should work), and
the latest Microsoft Sentinel version as of January 2020.
ZIA Overview
ZIA is a secure internet and web gateway delivered as a service from the cloud. Think of ZIA as a secure internet on-
ramp—just make Zscaler your next hop to the internet via one of the following methods:
• Setting up a tunnel (GRE or IPSec) to the closest Zscaler data center (for offices).
• Forwarding traffic via our lightweight Zscaler Client Connector or PAC file (for mobile employees).
No matter where users connect—a coffee shop in Milan, a hotel in Hong Kong, or a VDI instance in South Korea—they get
identical protection. ZIA sits between your users and the internet and inspects every transaction inline across multiple
security techniques (even within SSL).
You get full protection from web and internet threats. The Zscaler cloud platform supports Cloud Firewall, IPS,
Sandboxing, DLP, and Browser Isolation, allowing you to start with the services you need now and activate others as your
needs grow.
ZPA Overview
ZPA is a cloud service that provides secure remote access to internal applications running on a cloud or data center using
a Zero Trust framework. With ZPA, applications are never exposed to the internet, making them completely invisible
to unauthorized users. The service enables the applications to connect to users via inside-out connectivity rather than
extending the network to them.
ZPA provides a simple, secure, and effective way to access internal applications. Access is based on policies created by
the IT administrator within the ZPA Admin Portal and hosted within the Zscaler cloud. On each user device, software
called Zscaler Client Connector is installed. Zscaler Client Connector ensures the user’s device posture and extends a
secure microtunnel out to the Zscaler cloud when a user attempts to access an internal application.
Zscaler Resources
The following table contains links to Zscaler resources based on general topic areas.
Name Definition
ZIA Help Portal Help articles for ZIA.
ZPA Help Portal Help articles for ZPA.
NSS Deployment Guide Help article for NSS deployment.
NSS Troubleshooting Guide Help article for NSS troubleshooting.
Deploy NSS on Microsoft Azure Help article on deploying NSS on Azure.
Web Logs Help article on Zscaler web logs.
Firewall Logs Help article on Zscaler firewall logs.
DNS Logs Help article on Zscaler DNS logs.
Tunnel Logs Help article on Zscaler tunnel logs.
Zscaler NSS Azure Resource Manager Repository with an ARM template for deploying Zscaler NSS in Azure cloud.
(ARM) Template
Zscaler Tools Troubleshooting, security and analytics, and browser extensions that help
Zscaler determine your security needs.
Name Definition
Zscaler Training and Certification Training designed to help you maximize Zscaler products.
Submit a Zscaler Support Ticket Zscaler Support portal for submitting requests and issues.
• Collect data at cloud scale across all users, devices, applications, and infrastructure, both on-premises and in multiple
clouds.
• Detect previously undetected threats and minimize false positives using Microsoft’s analytics and unparalleled threat
intelligence.
• Investigate threats with artificial intelligence, and hunt for suspicious activities at scale, tapping into years of
cybersecurity work at Microsoft.
• Respond to incidents rapidly with built-in orchestration and automation of common tasks.
For more information on Azure, refer to the Microsoft Azure website or follow them on Twitter @microsoft.
Name Definition
Zscaler Private Access connector Help article on using ZPA with Microsoft Sentinel.
for Microsoft Sentinel
Microsoft Sentinel Documentation Article with use cases to get started using Microsoft Sentinel.
Azure support Support portal for Azure problems and help.
Sentinel Query Language Kusto query overview.
Reference
Document Prerequisites
To use this document, the following prerequisites are required:
• ZIA:
• An active instance of ZIA 5.7 or later.
• A working deployment of NSS (if not, see Understanding Nanolog Streaming Service for more information).
• Administrator login credentials to ZIA.
• Microsoft Sentinel:
• Administrator login credentials to Microsoft Azure.
• Active subscription with Microsoft Sentinel.
Syslog
Syslog has been used for many decades. Over time, new standards were created to define new message formats and
support new use cases. Briefly, a Syslog message has the following structure (in order): a header, structured data (SD), and
a message. In this section, the Syslog header and Syslog message (the body of the message) are explained.
RFC 3164 is considered the original BSD structure from 2001. The following is an example log message:
• Syslog Header:
• <34> is a priority number. It represents the sum of the facility number multiplied by eight and severity. In this
case, facility=3 (Auth) and severity=4 (Critical).
• Oct 11 22:14:15 is the timestamp. It doesn’t include the year, time zone, and sub-second information.
• mymachine is a host name where the message was written.
• su is a tag. Typically, this is the process name – sometimes having a PID (e.g., su[1234]).
• Syslog Message:
• The remainder of the message (MSG) is everything after the su tag.
The new (2009) Syslog format (RFC 5424) is three parts: "Syslog Header," "Structured Data," and the actual log "message."
• The dashes are places for the PID, message ID, and other structured data.
CEF
Common Event Format (CEF) is an open log management standard that improves the interoperability of security-related
information from different security and network devices and applications.
LEEF
Log Event Extended Format (LEEF) is a customized event format created by IBM QRadar. It is designed to describe
(network) security events and uses encoding and transport like those used by CEF. However, the two formats differ in the
number and types of fields.
When customers use ZIA or ZPA, every customer-initiated transaction that traverses Zscaler generates a corresponding
log message. These logs messages are retained by Zscaler for six months (or longer through a paid-for service). Customers
can view and search these logs using the dashboard of the ZIA or ZPA Admin Portal.
NSS
Log messages are stored within Nanolog. When an organization deploys NSS for various log feeds, each NSS opens a
secure tunnel to the Nanolog in the Zscaler cloud. The Nanolog then streams copies of the logs to each NSS in a highly
compressed format to reduce bandwidth footprint. The original logs are retained on the Nanolog.
When an NSS receives the logs from the Nanolog, it unscrambles them, applies the configured filters to exclude
unwanted logs, converts the filtered logs to the configured output format so they are parsed by your security information
and event management (SIEM), and then streams the logs to your SIEM over a raw TCP connection.
Zscaler NSS is required for customers who want to send these logs to a SIEM (on-premises or in-the-cloud). Think of NSS
as an intermediate log gateway. NSS uses a virtual machine (VM) to stream traffic logs in real time from ZIA.
Although Syslog usually uses UDP and destination port 514, NSS only supports TCP. By using TCP, NSS can detect
Clipboard-list if the SIEM becomes unavailable by the loss of the TCP connection. In the event of a failure, NSS queues log
messages until the SIEM returns (subject to storage).
Step 1. In the Azure Portal, Create a Log Analytics Workspace, and Add Microsoft
Sentinel to the Workspace
1. Log in to the Azure portal.
2. Go to Microsoft Sentinel.
3. Click Create.
5. The Create Log Analytics workspace wizard appears. In the Create Log Analytics workspace wizard:
a. Under the Resource group field, click Create new.
b. Enter a Name (e.g., test-1-RG).
c. Click OK.
d. Under Instance details, enter a Name (e.g., test-1-WS) and select a Region.
e. Click Review + Create, then click Create. You are redirected to the Add Microsoft Sentinel to a workspace
page and a success message appears.
6. Click Refresh to see your newly created workspace.
You are redirected to the Microsoft Sentinel | News & guides page and a success message appears.
1. Go to Monitor.
d. Click Review + create, then click Create. You are redirected to the Data Collection Endpoints page and a
success message appears.
5. Click Refresh to see your newly created DCE.
7. On the Overview page under Essentials, copy and save the Logs Ingestion URI, which is required for adding a Cloud
NSS feed in the ZIA Admin Portal.
Step 3. In the Azure Portal, Register an Azure Active Directory Application and
Create a Client Secret
To register an Active Directory (AD) application and create a client secret:
4. On the Register an application page, enter a Name (e.g., test-1-app), then click Register.
You are redirected to the application’s overview page and a success message appears.
5. On the Overview page under Essentials, copy and save the Application (client) ID and the Directory (tenant) ID,
which are required for adding a Cloud NSS feed in the ZIA Admin Portal.
b. Click New client secret. The Add a client secret window is displayed.
7. Click Add to close the window. You are redirected to the Certificates & secrets page and a success message
appears.
8. On the Certificates & Secrets page, copy and save the client secret Value, which is required for adding a Cloud NSS
feed in the ZIA Admin Portal.
Step 4. In the Azure Portal, Create a Table and Data Collection Rule
To create a table and data collection rule (DCR) in Azure:
4. Click the Create drop-down menu and select New custom log (DCR-based). The Create a custom log wizard is
displayed.
c. In the Create a new data collection rule window, enter a Name for the DCR (e.g., test-1-DCR).
f. Click Next. You are prompted to upload a sample of logs in JSON format.
g. Based on the type of Cloud NSS feed you want to add, copy one of the following log samples to a .log file, then
upload the file as directed in the Create a custom log wizard.
Sample of Web Logs:
[{ "sourcetype" : "zscalernss-web", "TimeGenerated":"2023-02-17 22:55:01",
"act":"Blocked", "reason":"Blocked", "app":"HTTPS", "dhost":"www.etsy.com",
"dst":"104.94.233.143", "src":"10.2.3.4", "sourceTranslatedAddress":"40.83.138.250",
"in":"50", "out":"10", "request":"www.1etsy.com/dac/common/web-toolkit/
scoped/scoped_responsive_base.20220526203537%2csite-chrome/deprecated/global-
nav.20220526203537%2ccommon/web-toolkit/a11y_colors/overrides.20220526203537.
css", "requestContext":"www.1etsy.com/c/clothing-and-shoes?ref=catnav-10923",
"outcome":"200", "requestClientApplication":"Mozilla/5.0 (Windows NT 6.2; Win64; x64;
rv:16.0.1) Gecko/20121011 Firefox/21.0.1", "requestMethod":"GET", "suser":"test3@
bd-dev.com", "spriv":"Road Warrior", "externalId":"8106135709380313090",
"fileType":"GZIP ", "destinationServiceName":"Etsy", "cat":"Professional Services",
"deviceDirection":"1", "cn1":"10", "cn1Label":"riskscore", "cs1":"General
Clipboard-list PDF files add line breaks to preserve the source text formatting. When copying code from a PDF into the Feed
Output Format, you must remove any line breaks from the text.
Copy the code text and paste it into this tool (or one similar) to remove the line breaks. When cleaned, copy the
code from the tool and paste it into the Feed Output Format.
Clipboard-list PDF files add line breaks to preserve the source text formatting. When copying code from a PDF into the Feed
Output Format, you must remove any line breaks from the text.
Copy the code text and paste it into this tool (or one similar) to remove the line breaks. When cleaned, copy the
code from the tool and paste it into the Feed Output Format.
"DeviceProduct":"NSSDNSlog"},
Copy the code text and paste it into this tool (or one similar) to remove the line breaks. When cleaned, copy the
code from the tool and paste it into the Feed Output Format.
After you upload the sample file, the logs populate in the Create a custom log wizard and a success message
appears.
requestContext = tostring(requestContext),
DeviceAction = tostring(act) ,
ApplicationProtocol = tostring(app) ,
DestinationHostName = tostring(dhost) ,
DestinationIP = tostring(dst) ,
SourceIP = tostring(src) ,
RequestURL = tostring(request),
out = toint(out),
SentBytes = tolong(out),
ReceivedBytes = tolong("in"),
RequestClientApplication = tostring(requestClientApplication),
RequestMethod = tostring(requestMethod),
SourceUserName = tostring(suser),
SourceUserPrivileges = tostring(spriv),
ExternalID = toint(externalId),
ExtID = tostring(externalId),
FileType = tostring(fileType),
DestinationServiceName = tostring(destinationServiceName),
CommunicationDirection = tostring(deviceDirection),
rulelabel = tostring(rulelabel) ,
ruletype = tostring(ruletype),
urlclass = tostring(urlclass),
devicemodel = tostring(devicemodel),
DeviceVendor = tostring(DeviceVendor),
DeviceProduct = tostring(DeviceProduct),
DeviceEventClassID=tostring(act),
EventOutcome = tostring(outcome) ,
Reason = tostring(reason) ,
Activity = tostring(reason),
SourceTranslatedAddress = tostring(sourceTranslatedAddress)
Clipboard-list PDF files add line breaks to preserve the source text formatting. When copying code from a PDF into the Feed
Output Format, you must remove any line breaks from the text.
Copy the code text and paste it into this tool (or one similar) to remove the line breaks. When cleaned, copy the
code from the tool and paste it into the Feed Output Format.
DeviceAction = tostring(act) ,
DeviceEventClassID=tostring(act) ,
DestinationIP = tostring(dst) ,
SourceIP = tostring(src) ,
SourcePort = toint(spt) ,
DestinationPort = toint(dpt) ,
DeviceTranslatedAddress = tostring(deviceTranslatedAddress),
SourceTranslatedAddress = tostring(sourceTranslatedAddress),
DestinationTranslatedAddress = tostring(destinationTranslatedAddress),
DestinationTranslatedPort = toint(destinationTranslatedPort),
SourceTranslatedPort = toint(sourceTranslatedPort),
DeviceTranslatedPort = toint(deviceTranslatedPort),
SentBytes = tolong(out),
ReceivedBytes = tolong(inbytes),
Protocol = tostring(proto),
SourceUserName = tostring(suser),
SourceUserPrivileges = tostring(spriv),
CommunicationDirection = tostring(deviceDirection),
rulelabel = tostring(reason) ,
DeviceVendor = tostring(DeviceVendor),
DeviceProduct = tostring(DeviceProduct),
Activity = tostring(act),
Reason = tostring(reason)
Clipboard-list PDF files add line breaks to preserve the source text formatting. When copying code from a PDF into the Feed
Output Format, you must remove any line breaks from the text.
Copy the code text and paste it into this tool (or one similar) to remove the line breaks. When cleaned, copy the
code from the tool and paste it into the Feed Output Format.
SourceUserName = tostring(suser),
DeviceAction = tostring(act) ,
DeviceEventClassID=tostring(act) ,
DestinationIP = tostring(dst) ,
SourceIP = tostring(src) ,
SourceUserPrivileges = tostring(spriv),
DestinationPort = toint(dpt) ,
rulelabel = tostring(rulelabel) ,
DeviceVendor = tostring(DeviceVendor),
DeviceProduct = tostring(DeviceProduct),
DeviceName = tostring(dvchost),
Activity = tostring(act),
Reason = tostring(rulelabel),
cat = tostring(cat),
SourceUserID = tostring(suid)
Clipboard-list PDF files add line breaks to preserve the source text formatting. When copying code from a PDF into the Feed
Output Format, you must remove any line breaks from the text.
Copy the code text and paste it into this tool (or one similar) to remove the line breaks. When cleaned, copy the
code from the tool and paste it into the Feed Output Format.
j. Click Run.
k. Click Apply. You are redirected to the Create a custom log wizard.
l. Click Next.
m. Click Create.
You are redirected to the Tables page in your workspace and a success message appears.
Step 5. Using Azure Cloud Shell, Change the Table’s Output Stream
In this step, you make two REST API calls: GET to fetch your table’s properties and PUT to change the table’s outputStream
so that logs are sent to a Common Event Format (CEF) table instead of a custom log (CL) table. To make the API calls:
1. Go to Monitor.
2. In the left-side navigation, go to Settings > Data Collection Rules.
c. Copy the ImmutableId value and _CL table name and save for later use in adding a Cloud NSS feed in the ZIA
Admin Portal.
8. Paste the Resource ID of your DCR in the Cloud Shell prompt. See the following example.
subscriptions/XX97bd2b-d3ea-4XXX-8f78-81962bea4bXX/resourceGroups/test-1-RG/providers/
Microsoft.Insights/dataCollectionRules/test-1-DCR?api-version=2021-09-01-preview
10. Assign the output to a variable (e.g., $v1) and run the $v1.Content command.
11. Copy the entire output and paste it into a text editor. Paste the output as plain text to prevent formatting issues.
12. In the text editor, modify the value of outputStream from your custom log table name to Microsoft-
CommonSecurityLog.
For example, "outputStream": "Custom-table_1_web_CL" is modified to the following: "outputStream":
"Microsoft-CommonSecurityLog".
13. Copy the entire modified output in the text editor.
14. In Cloud Shell, assign a second variable (e.g., $v2), then paste the modified output into the prompt. Ensure that you
add single quotes (‘) around the pasted content.
16. Run the same GET command to ensure the outputStream value shows Microsoft-CommonSecurityLog.
1. In Monitor > Data Collection Rules, select the DCR you created (e.g., test-1-DCR).
b. Click Next.
c. Click Select members.
d. In the Select members window, search for and select the Azure AD application you created (e.g., test-1-app).
You might need to type the app name in its entirety if it does not display in the drop-down menu.
You are redirected to the Access control (IAM) page and a success message appears.
Replace the values shown in red with those from your deployment:
https://test-1-dce-XXw5.eastus-1.ingest.monitor.azure.com/dataCollectionRules/dcr-
XXabc28ce0514dXXX55766bdc7328XX/streams/Custom-table_1_web_CL?api-version=2021-11-01-
preview)
• HTTP Headers:
• Key 1: Enter Content-Type
• Value 1: Enter application/json
• Feed Output Type: Select JSON.
• JSON Array Notation: Enable this setting.
• Feed Escape Character: Enter "\,
Clipboard-list PDF files add line breaks to preserve the source text formatting. When copying code from a PDF into the Feed
Output Format, you must remove any line breaks from the text.
Copy the code text and paste it into this tool (or one similar) to remove the line breaks. When cleaned, copy the
code from the tool and paste it into the Feed Output Format.
• Feed Output Format: See the following feed output formats by log type.
• For Cloud NSS Feeds for Web Logs, copy and paste the pre-populated Feed Output Format with the following:
\{"sourcetype" : "zscalernss-web", "TimeGenerated":"%d{yy}-%02d{mth}-%02d{dd}
%02d{hh}:%02d{mm}:%02d{ss}", "act":"%s{action}", "reason":"%s{reason}",
"app":"%s{proto}", "dhost":"%s{ehost}", "dst":"%s{sip}", "src":"%s{cip}", "sou
rceTranslatedAddress":"%s{cintip}", "in":"%d{respsize}", "out":"%d{reqsize}",
"request":"%s{eurl}", "requestContext":"%s{ereferer}", "outcome":"%s{respcode}", "requ
estClientApplication":"%s{ua}", "requestMethod":"%s{reqmethod}", "suser":"%s{login}",
"spriv":"%s{location}", "externalId":"%d{recordid}", "fileType":"%s{filetype} ", "de
stinationServiceName":"%s{appname}", "cat":"%s{urlcat}", "deviceDirection":"1",
"cn1":"%d{riskscore}", "cn1Label":"riskscore", "cs1":"%s{dept}", "cs1Label":"dept",
"cs2":"%s{urlcat}", "cs2Label":"urlcat", "cs3":"%s{malwareclass}",
"cs3Label":"malwareclass", "cs4":"%s{malwarecat}", "cs4Label":"malwarecat",
"cs5":"%s{threatname}", "cs5Label":"threatname", "cs6":"%s{bamd5}",
"cs6Label":"md5hash", "rulelabel":"%s{rulelabel}", "ruletype":"%s{ruletype}",
"urlclass":"%s{urlclass}", "DeviceVendor":"Zscaler" , "DeviceProduct":"NSSWeblog" ,"de
vicemodel":"%s{devicemodel}", "flexString1":"%s{devicemodel}", "flexString1Label":"devic
emodel", "flexString2":"%s{urlclass}", "flexString2Label":"urlclass"\}
• For Cloud NSS Feeds for Firewall Logs, copy and paste the pre-populated Feed Output Format with the
following:
\{ "sourcetype" : "zscaler-nss-fw", "TimeGenerated":"%02d{yy}-%02d{mth}-
%02d{dd} %02d{hh}:%02d{mm}:%02d{ss}", "act":"%s{action}", "suser":"%s{login}",
"src":"%s{csip}", "spt":"%d{csport}", "dst":"%s{cdip}", "dpt":"%d{cdport}", "deviceT
ranslatedAddress":"%s{ssip}", "deviceTranslatedPort":"%d{ssport}", "destinationTran
slatedAddress":"%s{sdip}", "destinationTranslatedPort":"%d{sdport}", "sourceTransla
tedAddress":"%s{tsip}", "sourceTranslatedPort":"%d{tsport}", "proto":"%s{ipproto}",
"flexString2Label":"ttype" , "flexString2":"%s{ttype}", "dnat":"%s{dnat}",
"stateful":"%s{stateful}", "spriv":"%s{location}", "reason":"%s{rulelabel}",
"inbytes":"%ld{inbytes}", "out":"%ld{outbytes}", "deviceDirection":"1",
"cs1":"%s{dept}", "cs1Label":"dept" , "cs2":"%s{nwsvc}", "cs2Label":"nwService" ,
"cs3":"%s{nwapp}", "cs3Label":"nwApp" , "cs4":"%s{aggregate}", "cs4Label":"aggregated"
, "cs5":"%s{threatcat}", "cs5Label":"threatcat" , "cs6":"%s{threatname}",
"cs6Label":"threatname" , "cn1":"%d{durationms}", "cn1Label":"durationms" ,
"cn2":"%d{numsessions}", "cn2Label":"numsessions" , "flexString1Label":"destCountry" ,
"flexString1":"%s{destcountry}", "cfp1Label":"avgduration" , "cfp1":"%d{avgduration}",
"DeviceVendor":"Zscaler" , "DeviceProduct":"NSSFWlog"\}
• For Cloud NSS Feeds for DNS Logs, copy and paste the pre-populated Feed Output Format with the
following:
\{"sourcetype":"zscaler-nss-fw","TimeGenerated":"%02d{yy}-%02d{mth}-%02d{dd}
%02d{hh}:%02d{mm}:%02d{ss}", "suser":"%s{login}","act":"%s{action}", "rulelabel":
"%s{rulelabel}" ,"cat":"%s{domcat}", "cs1":"%s{dept}","cs1Label":"department",
"cs2":"%s{reqaction}","cs2Label":"reqaction","cs3":"%s{resaction}","cs3Label":
"resaction","cs4":"%s{reqtype}","cs4Label":"dns_reqtype","cs5":"%s{req}","cs5Label":
"dns_req","cs6":"%s{res}","cs6Label":"dns_resp","cn1":"%d{durationms}","cn1Label":
"durationms","flexString1":"%s{reqrulelabel}","flexString1Label":"reqrulelabel","fl
exString2":"%s{resrulelabel}","flexString2Label":"resrulelabel", "cat":"%s{domcat
}","src":"%s{cip}","dst":"%s{sip}", "dpt":"%d{sport}","spriv":"%s{location}","su
id":"%s{deviceowner}", "dvchost":"%s{devicehostname}","DeviceVendor":"Zscaler" ,
"DeviceProduct":"NSSDNSlog"\}
Clipboard-list PDF files add line breaks to preserve the source text formatting. When copying code from a PDF into the Feed
Output Format, you must remove any line breaks from the text.
Copy the code text and paste it into this tool (or one similar) to remove the line breaks. When cleaned, copy the
code from the tool and paste it into the Feed Output Format.
##################
### Step 0: set parameters required for the rest of the script
##################
##################
### Step 1: obtain a bearer token used later to authenticate against the DCE
##################
$scope= [System.Web.HttpUtility]::UrlEncode("https://monitor.azure.com//.default")
$body = "client_id=$appId&scope=$scope&client_secret=$appSecret&grant_type=client_
credentials";
$headers = @{"Content-Type"="application/x-www-form-urlencoded"};
$uri = "https://login.microsoftonline.com/$tenantId/oauth2/v2.0/token"
##################
##################
$staticData = @"
"@;
##################
### Step 3: send the data to Log Analytics via the DCE.
##################
$body = $staticData;
$uri = "$dceEndpoint/dataCollectionRules/$dcrImmutableId/streams/Custom-XXnss3_table_
CL?api-version=2021-11-01-preview"
3. Click Run.
4. Return to your Log Analytics workspace and click Workbooks in the left-side navigation.
5. On the Templates tab, search for a Zscaler workbook among the following:
a. Zscaler Firewall
b. Zscaler Office 365 Apps
c. Zscaler Threats
d. Zscaler Web Overview
6. Click Save to save the workbook to a location (e.g., East US).
Logging in to ZIA
First, set up the Zscaler side of this service. Log in to Zscaler using your administrator account. If you are unable to log in
using your administrator account, contact Zscaler Support.
Configuring NSS
exclamation-triangle Log messages sent between Zscaler NSS and Azure data connector are not encrypted.
Zscaler strongly recommends that you spin up your NSS in the same Vnet as the Azure data connector VM so
that plain text log messages traffic doesn’t leave your Vnet.
If you are deploying NSS in a different network, use an external mechanism (e.g., IPSec tunnel) to encrypt plain
text communication between NSS and the Azure data connector VM.
Configuring NSS
AfterIflogging
you areinto ZIA, adda an
deploying newNSS
NSSserver and NSS feed. To navigate to the Nanolog Streaming section of ZIA:
in Azure:
Clipboard-list
Go to Administration
1. Zscaler > Cloud
NSS Azure Resource Configuration
Manager > Nanolog
(ARM) Template wasStreaming
developedService.
to automate setting up an NSS in Azure.
This avoids the need for manually running PowerShell scripts.
2. Follow the instructions in the NSS Deployment Guide help (based on your deployment type) to set up web and
firewall NSS.can take up to one hour to finish.
Deployment
Access the Zscaler NSS ARM Template from the Zscaler GitHub repository.
After deploying the ARM template deployment, check the IP address using "ifconfig -a". Configure another IP in
the same network range. NSS requires two interfaces in same subnet.
Connect to the NSS VM using SSH and execute the following commands as root user. Change the IPs as needed
to fit your environment.
Figure 74. Verify NSS server state in the ZIA Admin Portal
1. SIEM IP Address: The public IPv4 address of your Microsoft Sentinel data connector.
2. SIEM TCP Port: 514.
3. Feed Output Type: Set to Custom from the drop-down menu.
4. In this version of ZIA (v5.7 or later), the feed format must interoperate with Sentinel. Refer to Edit NSS Feed (Web) for
the details.
Clipboard-list When configuring the log feed to Sentinel, add ",\= to the Feed Escape Character field.
Go to Activation from the left-side navigation, and then click Activate to commit your changes.
Figure 79. This VM is a Syslog server and runs Azure’s data connector
You can select an existing resource group or you can create a new one.
1. To create a new resource group, click Create new, and give it a name. This example uses Ubuntu Server 18.04 LTS.
A new security group is automatically created by Azure with your resource group tied to it. Open the auto-created
network security group.
Next, select the Inbound security rules option and configure the following rules to allow inbound connections.
For testing purposes, any source IP can connect to this data connector VM on port 514. Post testing, restrict this
Clipboard-list access to the NSS source IP only.
For testing purposes, any source IP can connect to this data connector VM on port 22. Post testing, restrict this
Clipboard-list access to the trusted management source IP only.
Figure 89. Name, add, and link resource group to the workspace
Click OK.
1. Select a Linux machine (in any cloud or on-premises) that acts as a proxy between your security solution and
Sentinel. Use the previously set up VM.
2. Install an Azure monitoring agent (CEF connector) on this Linux box.
3. Log in to the VM setup using SSH and run the command highlighted in the following image.
"Installation completed" and the netstat output show that the Syslog server and Azure collector agent (Ruby scripts) are
running.
You can filter by selecting options towards the top of the page or by clicking individual entries.
Figure 100. This VM is a Syslog server and runs Azure’s data connector
You can bind to an existing resource group, or you can create a new one.
1. To create a new resource group, click Create new, and give it a name. This example uses Ubuntu Server 18.04 LTS.
A new security group is automatically created by Azure with your resource group tied to it. Open the auto-created
network security group.
Next, select the Inbound Security Rules option and configure the following rules to allow inbound connections.
• Protocol and port TCP/22033 from your Zscaler LSS App Connector IP.
• Protocol and port TCP/22 from your trusted network or management station.
Review the following sections to see how to configure each rule separately.
For testing purposes, any source IP can connect to this ZPA data connector VM on port 22033. Post testing,
Clipboard-list restrict this access to the LSS App Connector source IP only.
For testing purposes, any source IP can connect to this data connector VM on port 22. Post testing,
Clipboard-list restrict this access to the trusted management source IP only.
Figure 110. Name, add, and link resource group to the workspace
Click OK.
Select the machine on which to install the agent and then click Connect. This would be the Ubuntu VM that you created
in previous few steps.
9. Generate the ZPA logs. They are displayed after a few minutes under the respective Microsoft Sentinel instance.
Many of these alerts and incidents conform to recurring patterns that you can address by specific and defined sets of
remediation actions. Analysts are also tasked with basic remediation and investigation of the incidents they do manage to
address. You can automate many of these activities. Automating tasks allows SOCs more time for productivity, efficiency,
and investigative activity.
This playbook is a collection of remediation actions that you run from Microsoft Sentinel to help automate and
orchestrate your threat response. It can be run in two ways:
• For articles with use cases to get started using Microsoft Sentinel, see Microsoft Sentinel Documentation.
• For Support portal for Microsoft Sentinel Playbooks, see Security, Orchestration, Automation, and Response (SOAR).
Document Prerequisites
ZIA:
• An Azure Active Directory license and tenant, or an individual account with a valid payment method, are required to
access Azure and deploy resources.
• After you have a subscription, you’ll need the relevant permissions to begin using your subscription.
• A Log Analytics workspace is required to house all of the data that Microsoft Sentinel investigates and uses for its
detections, analytics, and other features.
• Zscaler recommends that when you set up your Microsoft Sentinel workspace, create a resource group that’s
dedicated to Microsoft Sentinel and the resources that Microsoft Sentinel uses, including the Log Analytics workspace,
any playbooks, workbooks, and so on.
Zscaler provides secured access to Cloud Service API and Sandbox Submission API using different authentication
schemes:
The instructions in this document and the Microsoft Sentinel Playbooks have been developed to leverage the OAuth 2.0
model for authentication to the Cloud Service API.
In this model, client applications make API calls to the cloud service API using an access token obtained from the
authorization server in exchange for their credentials. Therefore, the clients access the cloud service API resources on their
behalf without requiring any user interaction.
1. A client requests an access token from the authorization server. A client application registered with the authorization
server sends an authorization request with its credentials (i.e., client ID and client secret) to the authorization server.
In addition to the client credentials, the authorization request must specify the required scope and the grant type.
2. The authorization server authenticates the client and provides an access token. The authorization server validates
the client’s credentials and provides the client with a signed JSON Web Token (JWT) access token upon successful
authorization. The response from the authorization server contains the access token, token type (bearer token), and
the token expiry time.
3. The client sends the access token to the resource server. The client sends an API request to the resource server (i.e.,
cloud service API) with the signed JWT access token in the request authorization header.
4. The resource server grants access to protected resources. The following series of events take place before the
resource server (i.e., cloud service API) can accept the API request:
a. The Zscaler service extracts the JWT access token from the API request header and decodes the token to fetch
information such as the key ID, algorithm, scope, client ID, audience, expiry, and other configured values.
b. The Zscaler service cryptographically verifies the signature of the JWT token using the authorization server’s
public key.
c. If the JWT signature verification is successful, the Zscaler service validates the JWT’s scope claim, which is in
<Zscaler Cloud Name>::<Org ID>::<API Role> format. The <API Role> value in the scope is used to authorize the
API request. This value must match with one of the API Roles configured in the ZIA Admin Portal. If no match is
found, the API request is rejected.
d. Finally, the Zscaler service grants the client application access to the requested API resources.
• You must have an API subscription. If you do not have a subscription, submit a Zscaler Support ticket.
• You must have the API Roles configured in the ZIA Admin Portal.
• You must have your client applications registered on your authorization server (i.e., PingFederate, Okta, or Azure AD)
with the required scope and configured appropriately. This document walks you through the required setup using
Entra ID (formerly known as Azure AD).
• You must have your OAuth 2.0 authorization server added to the ZIA Admin Portal.
Logging in to ZIA
First, set up the Zscaler side of this service. Log in to the ZIA Admin Portal. If you are unable to log in using your
Administrator Account, contact Support.
3. Add an API role named Sentinel-Playbooks and enable the configuration shown in the following figure.
4. Click Save.
5. Activate the changes.
For each API role configured in the ZIA Admin Portal, you must complete the steps in the following sections to set up
OAuth 2.0 authorization using Entra ID.
You must create two app registrations in the Microsoft Entra ID:
6. Click Register. The application is registered, and the application’s Overview page is displayed.
7. Copy the Application (client) ID value from the Overview page and save it for later use.
8. Go to Owners.
9. Click Add owners and add yourself as an owner.
c. Click Add a scope under Scopes defined by this API. The Add a Scope section appears.
6. To authorize the client application, click Add a client application under Authorized client applications.
7. In the Client ID field, enter the Application (client) ID from the ZIA API client application and select the required
scope under Authorized scopes.
8. Click Add application.
9. Click App roles on the left-side navigation and then click Create app role.
After the app role is created, go to the Manifest page from the left-side navigation and ensure that the app role you
configured appears in the appRoles field within the JSON fields.
11. Click Owners, select Add owners, and add yourself as an owner.
Configure the ZIA API Client Application to access the ZIA API Web Service Application
To configure the ZIA API Client Application permissions to use the ZIA API Web Service Application:
c. Under Select permissions, select the API Role that was created in Configure the ZIA API Web Service
Application).
These values are required for configuring the OAuth 2.0 authorization server in the ZIA Admin Portal, as explained in the
subsequent section.
1. Go to the Postman website and download the app for your OS (i.e., Windows, macOS, or Linux).
2. Install the app.
3. After installation, open the app and log in using your account.
4. Download the latest version of the cloud service API collection file from the Reference Guide. Click Try in Postman to
download the collection.
5. From the main window in Postman, click Import.
6. In the Import window that appears, select your Postman collection file, or drag the file to the selection area.
After the file is imported, a new folder with the name used within the Postman collection file (e.g., cloud service API)
is displayed within Collections.
7. Ensure that No Environment is selected in the environment drop-down menu on the top right, and then click the
Environment quick look icon.
8. Click Add.
9. On the New Environment tab that appears, complete the following steps:
a. Enter a descriptive name for the environment (e.g., ZIA – zscalertwo.net).
b. Create a new variable the base URL.
• Under Variable, enter url.
• For Type, leave as default.
• For Initial Value, enter the URL found in your ZIA Dashboard, under Administration > Cloud Service API
Security.
10. Go to Collections > Cloud service API > URL Categories > GET URL Categories – Get all. Under Authorization,
select OAuth 2.0 from the drop-down menu.
11. Ensure the environment you have created is selected in the top right. Under Configure New Token, complete the
following:
a. For Access Token URL, enter {{tokenURL}}
b. For Client ID, enter {{clientId}}
c. For Client Secret, enter {{clientSecret}}
d. For Score, enter {{scope}}
12. Click Get New Access Token, and then select Use Token. This is your access token, which must be sent in the API
calls made to the ZIA API service. You can present the access token in the request Authorization header using the
bearer authentication scheme along with the token expiration time.
13. Click Send and receive a response back with a list of all URL categories configured in your tenant.
These include:
• Zscaler-Oauth2-Authentication: This provides the authentication module which allows a Playbook to authentication
to the ZIA API service using OAuth 2.0.
• Zscaler-Oauth2-DenylistURL: Add URLs to the ATP Blocked Malicious URLs list.
• Zscaler-Oauth2-BlockIP: Block an IP by adding to a URL category.
• Zscaler-Oauth2-BlockURL: Block a URL by adding to a URL category.
• Zscaler-Oauth2-LookupIP: Lookup the categories related to an IP.
• Zscaler-Oauth2-LookupSandboxReport: Lookup a Sandbox Report using a MD5 Hash.
• Zscaler-Oauth2-LookupURL: Lookup the categories related to a URL.
• Zscaler-Oauth2-UndenylistURL: Remove URLs from the ATP Blocked Malicious URLs list.
• Zscaler-Oauth2-UnblockIP: Remove an IP from a URL category.
• Zscaler-Oauth2-UnblockURL: Remove a URL from a URL category.
• Zscaler-Oauth2-AllowlistURL: Add URL to the ATP allowlist.
For more information about playbook automation responses, refer to the Microsoft Sentinel Playbook documentation.
The rest of this guide demonstrates the process of deploying the Playbook templates into Microsoft Sentinel.
3. Select Settings > API permissions > Configured permissions > Grant admin consent for Zscaler Lab and select the
zscalertwo.net API.
4. Select the resource group that contains your playbooks and select Apply.
5. Select the key vault you just created, and select Access control (IAM).
e. Click Create.
1. Download the Zscaler-Oauth2-Authentication playbook from the Zscaler GitHub repo for Microsoft Sentinel
Playbooks.
2. Go to the Zscaler-Oauth2-Authentication folder, review the README.md file, and click Deploy to Azure.
3. Select the subscription, resource group, and region to which the template is deployed.
4. Click Review + create, then Create.
5. Go to Azure Services > Logic apps. The imported logic app appears on your list of logic apps.
6. Select the Zscaler-Oauth2-Authentication playbook and select Identity. Verify that the system-assigned identity is
on (turn it on if it isn’t).
7. Go to Azure Services > Key Vault and select the Key vault you created in Configuring an Azure Key Vault.
10. Under Members, for Assign access to, select Managed Identity.
11. Under Select Managed Identities, select Logic app (1) from the drop-down menu, and enter the Zscaler-Oauth2-
Authentication.
18. Select the HTTP step, and in the Body replace the client_id with your client_id from ZIA API Client Application and
the scope with the scope with the Application ID URI from your ZIA API Web Service Application, appended with
./default.
For example: api://c0636925-82fa-49e1-be49-72afb0a9fd59/.default
19. Test the Logic App by going to Run Trigger and clicking Run. When successful, you see an Outputs step under Parse
JSON with an access_token header.
1. Download the Zscaler-Oauth2-BlockIP playbook from the Zscaler GitHub repo for Microsoft Sentinel Playbooks.
2. Go to the Zscaler-Oauth2-BlockIP folder, review the README.md file, and click Deploy to Azure.
3. Select your subscription, resource group, and region you want to deploy the template to.
4. Click Review + create, then click Create.
5. Go to Azure Services > Logic apps and your imported logic app appears on your list of logic apps.
6. To authorize the connection, select the Zscaler-Oauth2-BlockIP logic app, then go to Logic app designer and select
the Entities – Get IPs step. In that step, click Change connection.
The playbook has been configured to add an IP to the Other Miscellaneous category. To change this, modify the
Microsoft Logic app designer step Define URL Category. To change the ZIA base URL for this playbook, you can modify
the Microsoft Logic app designer step Define Base URL.
1. Download the Zscaler-Oauth2-BlacklistURL playbook, from the Zscaler GitHub repo for Microsoft Sentinel
Playbooks.
2. Navigate to the Zscaler-Oauth2-BlacklistURL folder, review the README.md file, and click Deploy to Azure.
3. Select your subscription, resource group, and region to which you want to deploy the template.
4. Click Review + create, then click Create.
5. Go to Azure Services > Logic apps and your imported logic app appears on your list of logic apps.
6. To authorize the connection, select the Zscaler-Oauth2-BlacklistURL logic app, then go to Logic app designer and
select the Entities – Get URLs step. In that step, click Change Connection.
To change the ZIA base URL for this playbook, you can modify the Logic app designer step Define Base URL.
©2023 Zscaler, Inc. All rights reserved. 128
ZSCALER AND MICROSOFT SENTINEL DEPLOYMENT GUIDE
1. Download the Zscaler-Oauth2-BlockURL playbook from the Zscaler GitHub repo for Microsoft Sentinel Playbooks.
2. Go to the Zscaler-Oauth2-BlockURL folder, review the README.md file, and click Deploy to Azure.
3. Select the subscription, resource group, and region to which you want to deploy the template.
4. Click Review + create, then Create.
5. Navigate to Azure Services > Logic apps and your imported logic app appears on the list of logic apps.
6. To authorize the connection, select the Zscaler-Oauth2-BlockURL logic app, then go to Logic app designer and
select the Entities – Get URLs step. In that step, click Change connection.
1. Download the Zscaler-Oauth2-LookupIP playbook from the Zscaler GitHub repo for Microsoft Sentinel Playbooks.
2. Go to the Zscaler-Oauth2-LookupIP folder, review the README.md file, and click Deploy to Azure.
3. Select the subscription, resource group, and region to which you want to deploy the template.
4. Click Review + create, then Create.
5. Go to Azure Services > Logic apps and your imported logic app appears on your list of logic apps.
6. To authorize the connection, select the Zscaler-Oauth2-LookupIP logic app, then go to Logic app designer and
select the Entities – Get IPs step. In that step, click Change connection.
2. Download the Zscaler-Oauth2-LookupSandboxReport playbook from the Zscaler GitHub repo for Microsoft
Sentinel Playbooks.
3. Go to the Zscaler-Oauth2-LookupSandboxReport folder, review the README.md file, and click Deploy to Azure.
4. Select your subscription, resource group, and region to which you want to deploy the template.
5. Click Review + create, then Create.
6. Go to Azure Services > Logic apps and your imported logic app appears on your list of logic apps.
7. To authorize the connection, select the Zscaler-Oauth2-LookupSandboxReport logic app, then go to Logic app
designer and select the Microsoft Sentinel incident step. In that step, click Change connection.
1. Download the Zscaler-Oauth2-LookupURL playbook from the Zscaler GitHub repo for Microsoft Sentinel Playbooks.
2. Navigate to the Zscaler-Oauth2-LookupURL folder, review the README.md file, and click the Deploy to Azure.
3. Select your subscription, resource group, and region to which you want to deploy the template.
4. Click Review + create, then Create.
5. Go to Azure Services > Logic apps and your imported logic app appears on your list of logic apps.
6. To authorize the connection, select the Zscaler-Oauth2-LookupURL logic app, then go to Logic app designer and
select the Entities – Get URLs step.
7. Click Change connection.
To change the ZIA base URL for this playbook, you can modify the Microsoft Logic app designer step Initialize variable -
Define Base URL.
1. Download the Zscaler-Oauth2-UnblacklistURL playbook from the Zscaler GitHub repo for Microsoft Sentinel
Playbooks.
2. Go to the Zscaler-Oauth2-UnblacklistURL folder, review the README.md file, and click Deploy to Azure.
3. Select your subscription, resource group, and region to which you want to deploy the template.
4. Click Review + create, then Create.
5. Go to Azure Services > Logic apps and your imported logic app appears on your list of logic apps.
6. To authorize the connection, select the Zscaler-Oauth2-UnblacklistURL logic app, then go to Logic app designer and
select the Entities – Get URLs step. In that step, click Change connection.
1. Download the Zscaler-Oauth2-UnblockIP playbook from the Zscaler GitHub repo for Microsoft Sentinel Playbooks.
2. Go to the Zscaler-Oauth2-UnblockIP folder, review the README.md file, and click Deploy to Azure.
3. Select your subscription, resource group, and region to which you want to deploy the template.
4. Click Review + create, then Create.
5. Go to Azure Services > Logic apps and your imported logic app appears on your list of logic apps.
6. To authorize the connection, select the Zscaler-Oauth2-UnblockIP logic app, then go to Logic app designer and
select the Entities – Get IPs step.
7. Click Change connection.
The playbook has been configured to remove an IP in the Other Miscellaneous category. To change it, modify the
Microsoft Logic app designer step Define URL Category. To change the ZIA base URL for this playbook, you can modify
the Microsoft Logic app designer step Define Base URL.
1. Download the Zscaler-Oauth2-UnblockURL playbook from the Zscaler GitHub repo for Microsoft Sentinel
Playbooks.
2. Navigate to the Zscaler-Oauth2-UnblockURL folder, review the README.md file, and click Deploy to Azure.
3. Select your subscription, resource group, and region to which you want to deploy the template.
4. Click Review + create, then Create.
5. Go to Azure Services > Logic apps and the imported logic app appears on your list of logic apps.
6. To authorize the connection, select the Zscaler-Oauth2-UnblockURL logic app, then go to Logic app designer and
select the Entities – Get URLs step.
7. Click Change connection.
To change the ZIA base URL for this playbook, you can modify the Microsoft Logic app designer step Define Base URL. To
change the URL category for this playbook, you can modify the Microsoft Logic app designer step Define URL category.
1. Download the Zscaler-Oauth2-WhitelistURL playbook from the Zscaler GitHub repo for Microsoft Sentinel
Playbooks.
2. Go to the Zscaler-Oauth2-WhitelistURL folder, review the README.md file, and click Deploy to Azure.
3. Select your subscription, resource group, and region to which you want to deploy the template.
4. Click Review + create, then Create.
5. Navigate to Azure Services > Logic apps and your imported logic app appears on your list of logic apps.
6. To authorize the connection, select the Zscaler-Oauth2-WhitelistURL logic app, then go to Logic app designer and
select the Entities – Get URLs step.
7. Click Change connection.
To change the ZIA base URL for this playbook, you can modify the Microsoft Logic app designer step Define Base URL.
To contact Zscaler Support, go to Administration > Settings > and then click Company Profile.
Figure 238. Collecting details to open support case with Zscaler TAC
Save Company ID
Copy the Company ID if you are using ZIA Admin Portal. Copy the tenant ID if you are using ZPA Admin Portal.