Zscaler NSS
Copy link

Zscaler is a software as a service (SaaS) web proxy with an “on-premises” NSS component that retrieves the logs from the cloud and pulls them into the local network for log aggregators, such as the SIEM (InsightIDR) Collector.

Zscaler NSS product logs can contain information about hosts and accounts, in addition to the source address. When setting up Zscaler NSS as an event source, you will have the ability to specify attribution options.

To set up Zscaler NSS, you’ll need to:

  1. Review Before you Begin and note any requirements.
  2. Configure Zscaler NSS to send data to your Collector.
  3. Configure SIEM (InsightIDR) to collect data from the event source.
  4. Verify the configuration works.

Before You Begin
Copy link

You must prepare Zscaler NSS to forward logs to the SIEM (InsightIDR) Collector.

You can find additional information on how to configure Zscaler NSS here: https://help.zscaler.com/zia/documentation-knowledgebase/analytics/nss/nss-deployment-guides .

ℹ️

SIEM (InsightIDR) supports Web, Firewall and DNS logs

While Zscaler NSS supports multiple log types, SIEM (InsightIDR) currently only has parsers for certain formats, depending on the type of log:

You must set up a separate Zscaler NSS event source for each NSS feed you’d like to send to SIEM (InsightIDR). If you’d like to send Web, Firewall and DNS logs to SIEM (InsightIDR), you should set up three Zscaler NSS event sources.

Configure Zscaler NSS to send data to SIEM (InsightIDR)
Copy link

The Zscaler logs must arrive in a certain format depending on the type of log for SIEM (InsightIDR) to correctly parse them.

Forward Web Logs
Copy link

In Zscaler, select LEEF as the format when setting up your NSS feed. Then, paste the following format into the Feed Output Format field:

%s{mon} %02d{dd} %02d{hh}:%02d{mm}:%02d{ss} zscaler-nss: LEEF:1.0|Zscaler|NSS|4.1|%s{reason}|cat=%s{action}\tdevTime=%s{mon} %02d{dd} %d{yy} %02d{hh}:%02d{mm}:%02d{ss} %s{tz}\tdevTimeFormat=MMM dd yyyy HH:mm:ss z\tsrc=%s{cip}\tdst=%s{sip}\tsrcPostNAT=%s{cintip}\trealm=%s{location}\tusrName=%s{login}\tsrcBytes=%d{reqsize}\tdstBytes=%d{respsize}\trole=%s{dept}\tpolicy=%s{reason}\turl=%s{eurl}\trecordid=%d{recordid}\tbwthrottle=%s{bwthrottle}\tuseragent=%s{ua}\treferer=%s{ereferer}\thostname=%s{ehost}\tappproto=%s{proto}\turlcategory=%s{urlcat}\turlsupercategory=%s{urlsupercat}\turlclass=%s{urlclass}\tappclass=%s{appclass}\tappname=%s{appname}\tmalwaretype=%s{malwarecat}\tmalwareclass=%s{malwareclass}\tthreatname=%s{threatname}\triskscore=%d{riskscore}\tdlpdict=%s{dlpdict}\tdlpeng=%s{dlpeng}\tfileclass=%s{fileclass}\tfiletype=%s{filetype}\treqmethod=%s{reqmethod}\trespcode=%s{respcode}\tcontenttype=%s{contenttype}\tunscannabletype=%s{unscannabletype}\tdeviceowner=%s{deviceowner}\tdevicehostname=%s{devicehostname}\tbypassedtraffic=%d{bypassed_traffic}\n

Forward Firewall Logs
Copy link

In Zscaler, select JSON as the format when setting up your NSS feed. Then, paste the following format into the Feed Output Format field:

\{ "sourcetype": "zscalernss-fw", "event":\{"datetime":"%s{time}","user":"%s{login}","locationname":"%s{location}","cdport":"%d{cdport}","csport":"%d{csport}","csip":"%s{csip}","cdip":"%s{cdip}","action":"%s{action}","proto":"%s{ipproto}","inbytes":"%ld{inbytes}","outbytes":"%ld{outbytes}","deviceowner":"%s{deviceowner}","devicehostname":"%s{devicehostname}","bypassedsession":"%d{bypassed_session}"\}\}

These are the minimum required fields needed to parse Firewall logs in SIEM (InsightIDR). You can also add additional fields within the event section if you’d like to send other information.

Forward DNS Logs
Copy link

In Zscaler, select JSON as the format when setting up your NSS feed. Then, paste the following format into the Feed Output Format field:

\{ "sourcetype": "zscalernss-dns", "event":\{"datetime":"%s{time}","user":"%s{login}","location":"%s{location}","reqaction":"%s{reqaction}","dns_reqtype":"%s{reqtype}","dns_req":"%s{req}","srv_dport":"%d{sport}","clt_sip":"%s{cip}","srv_dip":"%s{sip}"\}\}

These are the minimum required fields needed to parse DNS logs in SIEM (InsightIDR). You can also add additional fields within the event section if you’d like to send other information.

Configure SIEM (InsightIDR) to collect data from the event source
Copy link

After you complete the prerequisite steps and configure the event source to send data, you must add the event source in SIEM (InsightIDR).

Task 1: Select Zscaler NSS
Copy link

To configure the new event source in SIEM (InsightIDR):

  1. From the Command Home, go to Data Connectors > Data Collectors.
  2. Go to the Event Sources tab, then select Add Event Source.
  3. Do one of the following:
    • Search for Zscaler NSS in the event sources search bar.
    • In the Product Type filter, select Web Proxy.
  4. Select the Zscaler NSS event source tile.

Task 2: Set up your collection method
Copy link

There are two methods of collecting data from Zscaler NSS; through a webhook or through a collector.

Webhook

SIEM (InsightIDR) allows data collection from products and systems that can send events through webhook requests (HTTP POST body method). A webhook event source can have one or more URLs associated with it. These unique URLs are used by the third party products as the destination of the webhook requests.

These limits apply to each POST request sent to the webhook:

Request limitValue
Maximum uncompressed request size10 MB
Maximum compressed request size100 MB
Maximum uncompressed size of a compressed request100 MB
Event count for each requestNo limit (previously 10,000)
Maximum size of a single event100,000 characters
⚠️

Do not share unique URLs

The URLs associated with webhook event sources are unique and should be protected to prevent unauthorized users from sending data to the event source.

Webhook requirements
Copy link

ℹ️

Webhook data formatting

The type of data sent should be expressed by the Content-Type header used by the requests. If no header is included in the request, the system will attempt to determine whether the contents are JSON or plain text.

SIEM (InsightIDR) supports these data formats for webhook event sources:

  • Plain text - Webhook requests containing plain text are processed with newline characters separating individual event lines.

  • JSON - Webhook requests containing JSON data are supported natively. If the contents are an array of events, the elements of the array are treated as individual events. Otherwise, the entire JSON request body will be treated as a single event.

    • For example, this JSON data will be interpreted as two events automatically:
    [ { "log": "event 1"}, { "log": "event 2"} ]
    • If the events are contained within a field in the JSON object, the JSON Events Key field can be configured to indicate which field contains the events. In this example, the JSON Events Key is set to resources to identify that the contents should be read from that field within the JSON. Periods can be used to identify a nested field, for example path.to.events.
    { "type": "AuditLogEntry", "size": 2, "resources": [ { "log": "event 1" }, { "log": "event 2" } ] }
  • NDJSON - Webhook requests containing newline delimited JSON will have multiple JSON objects, separated by newline characters. Each line will be treated as individual events. The JSON Events Key may be specified if needed, as described in the JSON example.

  • URL encoded form values - Webhook requests containing form values will translate the form data’s key plus value pairs into a JSON presentation.

To configure webhook collection:

  1. In the Add Event Source panel, select Run On Webhook.
  2. Name your event source.
  3. Optionally, configure the JSON Events Key if needed.
  4. Select Copy to copy the Webhook URL for use in the product you wish to configure to send events to SIEM (InsightIDR).
  5. Select Generate a new Webhook URL if you want to add another URL. This can also be used if the existing URL needs to be replaced.
  6. Select Save.

Test the configuration
Copy link

You can test if logs can be sent to the event source using a curl command. The following examples work for Windows, Mac and Linux operating systems. Ensure you replace the placeholder with your new Webhook URL:

curl --verbose <your-webhook-URL> --header "Content-type:application/json" --data "{\"message\":\"Something else happened\",\"user\":\"jsmith\",\"hostname\":\"server1\"}" curl --verbose <your-webhook-URL> --header "Content-type:application/text" --data "Raw text message"

Collector

To configure collector collection:

  1. In the Add Event Source panel, select Run On Collector.
  2. Name your event source and choose your collector.
  3. Select a collection method and specify a port and a protocol.
    • Optionally choose to Encrypt the event source if choosing TCP by downloading the Rapid7 Certificate.
  4. Choose the timezone that matches the location of your event source logs.
  5. Optionally choose to send unparsed logs.
  6. Select an attribution source.
  7. Select Save.

Test the configuration
Copy link

Complete the following steps to view your logs and ensure events are making it to the Collector:

  1. Click Data Collection in the left menu of SIEM (InsightIDR) and navigate to the Event Sources tab. Find the new event source that was just created and click the View Raw Log button. If you see log messages in the box, then this shows that logs are flowing to the Collector.
  2. Click Log Search in the left menu of SIEM (InsightIDR).
  3. Select the applicable Log Sets and the Log Names within them. The Log Name will be the name you gave to your event source. Zscaler logs flow into the Web Proxy Activity log set when the log is generated from a web proxy event.