Detection rules › Panther

ZIA Log Streaming Disabled

Severity
medium
Log types
Zscaler.ZIA.AdminAuditLog
Reference
https://help.zscaler.com/zia/about-nss-feeds
Source
github.com/panther-labs/panther-analysis

This rule detects when ZIA log streaming was disabled.

MITRE ATT&CK coverage

Rule body yaml

AnalysisType: rule
RuleID: ZIA.Log.Streaming.Disabled
Description: This rule detects when ZIA log streaming was disabled.
DisplayName: ZIA Log Streaming Disabled
Runbook: Verify that this change was planned. If not, make sure to restore previous settings.
Reference: https://help.zscaler.com/zia/about-nss-feeds
Enabled: true
Filename: zia_log_streaming_disabled.py
Severity: Medium
Reports:
  MITRE ATT&CK:
    - TA0005:T1562.008 # Disable or Modify Cloud Logs
LogTypes:
  - Zscaler.ZIA.AdminAuditLog
DedupPeriodMinutes: 60
Threshold: 1
Tests:
  - Name: Log streaming disabled (NSS deleted)
    ExpectedResult: true
    Log:
      {
        "event": {
          "action": "DELETE",
          "adminid": "admin@test.zscalerbeta.net",
          "auditlogtype": "ZIA",
          "category": "NSS",
          "clientip": "1.2.3.4",
          "errorcode": "None",
          "interface": "UI",
          "postaction": { },
          "preaction": {
            "cloudNss": true,
            "cloudNssSiemConfiguration": {
              "connectionHeaders": [
                "123:123"
              ],
              "connectionURL": "https://logs.company.net/http/a7adc684-f65c-42af-9519-0a0786656f20",
              "lastSuccessFullTest": 0,
              "maxBatchSize": 512,
              "nssType": "NSS_FOR_WEB",
              "oAuthAuthentication": false,
              "siemType": "OTHER",
              "testConnectivityCode": 0
            },
            "customEscapedCharacter": [
              "ASCII_44",
              "ASCII_92",
              "ASCII_34"
            ],
            "duplicateLogs": 0,
            "epsRateLimit": 0,
            "feedOutputFormat": "\\{ \"sourcetype\" : \"zscalernss-web\", \"event\" : \\{\"datetime\":\"%d{yy}-%02d{mth}-%02d{dd} %02d{hh}:%02d{mm}:%02d{ss}\",\"reason\":\"%s{reason}\",\"event_id\":\"%d{recordid}\",\"protocol\":\"%s{proto}\",\"action\":\"%s{action}\",\"transactionsize\":\"%d{totalsize}\",\"responsesize\":\"%d{respsize}\",\"requestsize\":\"%d{reqsize}\",\"urlcategory\":\"%s{urlcat}\",\"serverip\":\"%s{sip}\",\"requestmethod\":\"%s{reqmethod}\",\"refererURL\":\"%s{ereferer}\",\"useragent\":\"%s{eua}\",\"product\":\"NSS\",\"location\":\"%s{elocation}\",\"ClientIP\":\"%s{cip}\",\"status\":\"%s{respcode}\",\"user\":\"%s{elogin}\",\"url\":\"%s{eurl}\",\"vendor\":\"Zscaler\",\"hostname\":\"%s{ehost}\",\"clientpublicIP\":\"%s{cintip}\",\"threatcategory\":\"%s{malwarecat}\",\"threatname\":\"%s{threatname}\",\"filetype\":\"%s{filetype}\",\"appname\":\"%s{appname}\",\"app_status\":\"%s{app_status}\",\"pagerisk\":\"%d{riskscore}\",\"threatseverity\":\"%s{threatseverity}\",\"department\":\"%s{edepartment}\",\"urlsupercategory\":\"%s{urlsupercat}\",\"appclass\":\"%s{appclass}\",\"dlpengine\":\"%s{dlpeng}\",\"urlclass\":\"%s{urlclass}\",\"threatclass\":\"%s{malwareclass}\",\"dlpdictionaries\":\"%s{dlpdict}\",\"fileclass\":\"%s{fileclass}\",\"bwthrottle\":\"%s{bwthrottle}\",\"contenttype\":\"%s{contenttype}\",\"unscannabletype\":\"%s{unscannabletype}\",\"deviceowner\":\"%s{deviceowner}\",\"devicehostname\":\"%s{devicehostname}\",\"keyprotectiontype\":\"%s{keyprotectiontype}\"\\}\\}\n",
            "feedStatus": "ENABLED",
            "id": 2898,
            "jsonArrayToggle": true,
            "name": "test-feed-2",
            "nssFeedType": "JSON",
            "nssFilter": {
              "securityFeedFilter": false
            },
            "nssLogType": "WEBLOG",
            "timeZone": "GMT",
            "userObfuscation": "DISABLED"
          },
          "recordid": "371",
          "resource": "test-feed-2",
          "result": "SUCCESS",
          "subcategory": "NSS_FEED",
          "time": "2024-11-04 16:34:34.000000000"
        },
        "sourcetype": "zscalernss-audit"
      }
  - Name: NSS created
    ExpectedResult: false
    Log:
      {
        "event": {
          "action": "CREATE",
          "adminid": "admin@test.zscalerbeta.net",
          "auditlogtype": "ZIA",
          "category": "NSS",
          "clientip": "1.2.3.4",
          "errorcode": "None",
          "interface": "UI",
          "postaction": {
            "cloudNss": true,
            "cloudNssSiemConfiguration": {
              "clientSecret": "******",
              "connectionHeaders": [
                "123:123"
              ],
              "connectionURL": "https://logs.company.net/http/a7adc684-f65c-42af-9519-0a0786656f20",
              "lastSuccessFullTest": 0,
              "maxBatchSize": 512,
              "nssType": "NSS_FOR_WEB",
              "oAuthAuthentication": false,
              "siemType": "OTHER",
              "testConnectivityCode": 0
            },
            "customEscapedCharacter": [
              "ASCII_44",
              "ASCII_92",
              "ASCII_34"
            ],
            "duplicateLogs": 0,
            "epsRateLimit": 0,
            "feedOutputFormat": "\\{ \"sourcetype\" : \"zscalernss-web\", \"event\" : \\{\"datetime\":\"%d{yy}-%02d{mth}-%02d{dd} %02d{hh}:%02d{mm}:%02d{ss}\",\"reason\":\"%s{reason}\",\"event_id\":\"%d{recordid}\",\"protocol\":\"%s{proto}\",\"action\":\"%s{action}\",\"transactionsize\":\"%d{totalsize}\",\"responsesize\":\"%d{respsize}\",\"requestsize\":\"%d{reqsize}\",\"urlcategory\":\"%s{urlcat}\",\"serverip\":\"%s{sip}\",\"requestmethod\":\"%s{reqmethod}\",\"refererURL\":\"%s{ereferer}\",\"useragent\":\"%s{eua}\",\"product\":\"NSS\",\"location\":\"%s{elocation}\",\"ClientIP\":\"%s{cip}\",\"status\":\"%s{respcode}\",\"user\":\"%s{elogin}\",\"url\":\"%s{eurl}\",\"vendor\":\"Zscaler\",\"hostname\":\"%s{ehost}\",\"clientpublicIP\":\"%s{cintip}\",\"threatcategory\":\"%s{malwarecat}\",\"threatname\":\"%s{threatname}\",\"filetype\":\"%s{filetype}\",\"appname\":\"%s{appname}\",\"app_status\":\"%s{app_status}\",\"pagerisk\":\"%d{riskscore}\",\"threatseverity\":\"%s{threatseverity}\",\"department\":\"%s{edepartment}\",\"urlsupercategory\":\"%s{urlsupercat}\",\"appclass\":\"%s{appclass}\",\"dlpengine\":\"%s{dlpeng}\",\"urlclass\":\"%s{urlclass}\",\"threatclass\":\"%s{malwareclass}\",\"dlpdictionaries\":\"%s{dlpdict}\",\"fileclass\":\"%s{fileclass}\",\"bwthrottle\":\"%s{bwthrottle}\",\"contenttype\":\"%s{contenttype}\",\"unscannabletype\":\"%s{unscannabletype}\",\"deviceowner\":\"%s{deviceowner}\",\"devicehostname\":\"%s{devicehostname}\",\"keyprotectiontype\":\"%s{keyprotectiontype}\"\\}\\}\n",
            "feedStatus": "ENABLED",
            "id": 2898,
            "jsonArrayToggle": true,
            "name": "test-feed-2",
            "nssFeedType": "JSON",
            "nssFilter": {
              "securityFeedFilter": false
            },
            "nssLogType": "WEBLOG",
            "timeZone": "GMT",
            "userObfuscation": "DISABLED"
          },
          "preaction": {
            "cloudNss": true,
            "cloudNssSiemConfiguration": {
              "connectionHeaders": [
                "123:123"
              ],
              "connectionURL": "https://logs.company.net/http/a7adc684-f65c-42af-9519-0a0786621f20",
              "maxBatchSize": 524288,
              "nssType": "NSS_FOR_WEB",
              "oAuthAuthentication": false,
              "siemType": "OTHER"
            },
            "customEscapedCharacter": [
              "ASCII_44",
              "ASCII_92",
              "ASCII_34"
            ],
            "duplicateLogs": 0,
            "epsRateLimit": 0,
            "feedOutputFormat": "\\{ \"sourcetype\" : \"zscalernss-web\", \"event\" : \\{\"datetime\":\"%d{yy}-%02d{mth}-%02d{dd} %02d{hh}:%02d{mm}:%02d{ss}\",\"reason\":\"%s{reason}\",\"event_id\":\"%d{recordid}\",\"protocol\":\"%s{proto}\",\"action\":\"%s{action}\",\"transactionsize\":\"%d{totalsize}\",\"responsesize\":\"%d{respsize}\",\"requestsize\":\"%d{reqsize}\",\"urlcategory\":\"%s{urlcat}\",\"serverip\":\"%s{sip}\",\"requestmethod\":\"%s{reqmethod}\",\"refererURL\":\"%s{ereferer}\",\"useragent\":\"%s{eua}\",\"product\":\"NSS\",\"location\":\"%s{elocation}\",\"ClientIP\":\"%s{cip}\",\"status\":\"%s{respcode}\",\"user\":\"%s{elogin}\",\"url\":\"%s{eurl}\",\"vendor\":\"Zscaler\",\"hostname\":\"%s{ehost}\",\"clientpublicIP\":\"%s{cintip}\",\"threatcategory\":\"%s{malwarecat}\",\"threatname\":\"%s{threatname}\",\"filetype\":\"%s{filetype}\",\"appname\":\"%s{appname}\",\"app_status\":\"%s{app_status}\",\"pagerisk\":\"%d{riskscore}\",\"threatseverity\":\"%s{threatseverity}\",\"department\":\"%s{edepartment}\",\"urlsupercategory\":\"%s{urlsupercat}\",\"appclass\":\"%s{appclass}\",\"dlpengine\":\"%s{dlpeng}\",\"urlclass\":\"%s{urlclass}\",\"threatclass\":\"%s{malwareclass}\",\"dlpdictionaries\":\"%s{dlpdict}\",\"fileclass\":\"%s{fileclass}\",\"bwthrottle\":\"%s{bwthrottle}\",\"contenttype\":\"%s{contenttype}\",\"unscannabletype\":\"%s{unscannabletype}\",\"deviceowner\":\"%s{deviceowner}\",\"devicehostname\":\"%s{devicehostname}\",\"keyprotectiontype\":\"%s{keyprotectiontype}\"\\}\\}\n",
            "feedStatus": "ENABLED",
            "id": 0,
            "jsonArrayToggle": true,
            "name": "test-feed-2",
            "nssFeedType": "JSON",
            "nssFilter": {
              "securityFeedFilter": false
            },
            "nssLogType": "WEBLOG",
            "siemConfiguration": { },
            "timeZone": "GMT"
          },
          "recordid": "370",
          "resource": "test-feed-2",
          "result": "SUCCESS",
          "subcategory": "NSS_FEED",
          "time": "2024-11-04 16:33:48.000000000"
        },
        "sourcetype": "zscalernss-audit"
      }

Detection logic

Condition

event.errorcode eq "None"
event.result eq "SUCCESS"
event.action eq "DELETE"
event.category eq "NSS"

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
event.actioneq
  • DELETE
event.categoryeq
  • NSS
event.errorcodeeq
  • None
event.resulteq
  • SUCCESS

Output fields

Fields the rule emits when it matches. Chronicle authors list these in the outcome block; they appear on the detection and $risk_score drives alerting. Sentinel / Defender XDR rules build them up through project / summarize / extend stages. Sentinel maps these into alert fields via entityMappings and customDetails; Defender XDR custom detections surface them as alert fields directly.

FieldSource
actionevent.action
admin_idevent.adminid
categoryevent.category
client_ipevent.clientip
preactionevent.preaction
postactionevent.postaction
connectionURLevent.preaction.cloudNssSiemConfiguration.connectionURL