收集 Zscaler Tunnel 日志

支持的平台:

本文档介绍了如何通过设置 Google Security Operations Feed 来导出 Zscaler 隧道日志,以及日志字段如何映射到 Google SecOps Unified Data Model (UDM) 字段。

如需了解详情,请参阅 Google SecOps 数据注入概览。

典型部署包括 Zscaler Tunnel 和 Google SecOps Webhook Feed,后者配置为向 Google SecOps 发送日志。每个客户部署都可能有所不同,并且可能更复杂。

部署包含以下组件:

  • Zscaler 隧道:您从中收集日志的平台。

  • Google SecOps Feed:从 Zscaler 隧道提取日志并将日志写入 Google SecOps 的 Google SecOps Feed。

  • Google SecOps:保留和分析日志。

注入标签用于标识将原始日志数据标准化为结构化 UDM 格式的解析器。本文档中的信息适用于具有 ZSCALER_TUNNEL 标签的解析器。

准备工作

确保您满足以下前提条件:

  • 拥有 Zscaler Internet Access 控制台的访问权限。如需了解详情,请参阅 Secure Internet and SaaS Access ZIA 帮助。
  • Zscaler 隧道版本 1.0 或版本 2.0
  • 部署架构中的所有系统都使用世界协调时间 (UTC) 时区进行配置。
  • 在 Google Security Operations 中完成 Feed 设置所需的 API 密钥。如需了解详情,请参阅设置 API 密钥。

设置 Feed

如需配置此日志类型,请按以下步骤操作:

  1. 前往 SIEM 设置 > Feed。
  2. 点击添加新 Feed。
  3. 点击 Zscaler Feed 包。
  4. 找到所需的日志类型,然后点击添加新 Feed。
  5. 为以下输入参数输入值:

    • 来源类型:Webhook(推荐)
    • 拆分定界符:用于分隔日志行的字符。如果不使用定界符,请留空。

    高级选项

    • Feed 名称:用于标识 Feed 的预填充值。
    • 资产命名空间:与 Feed 关联的命名空间。
    • 提取标签:应用于相应 Feed 中所有事件的标签。
  6. 点击创建 Feed。

如需详细了解如何为该产品系列中的不同日志类型配置多个 Feed,请参阅按产品配置 Feed。

设置 Zscaler 隧道

  1. 在 Zscaler Internet Access 控制台中,依次前往 Administration > Nanolog Streaming Service > Cloud NSS Feeds。
  2. 点击 Add Cloud NSS Feed。
  3. 在 Feed 名称字段中输入 Feed 的名称。
  4. 在 NSS 类型中选择 NSS for Tunnel。
  5. 从状态列表中选择状态,以启用或停用 NSS Feed。
  6. 将 SIEM 速率下拉菜单中的值保留为无限制。如需因许可或其他限制而抑制输出流,请更改该值。
  7. 在 SIEM 类型列表中,选择其他。
  8. 在 OAuth 2.0 身份验证列表中,选择已停用。
  9. 根据 SIEM 的最佳实践,在最大批次大小中输入单个 HTTP 请求载荷的大小限制(例如 512 KB)。
  10. 在 API 网址中,按照以下格式输入 Chronicle API 端点的 HTTPS 网址:

    https://<CHRONICLE_REGION>-chronicle.googleapis.com/v1alpha/projects/<GOOGLE_PROJECT_NUMBER>/locations/<LOCATION>/instances/<CUSTOMER_ID>/feeds/<FEED_ID>:importPushLogs
    
    • CHRONICLE_REGION:Google SecOps 实例托管的区域(例如 US)。
    • GOOGLE_PROJECT_NUMBER: Google Cloud 项目编号。
    • LOCATION:Google SecOps 区域(例如美国)。
    • CUSTOMER_ID:Chronicle 客户 ID。
    • FEED_ID:在创建的新 Webhook 的 Feed 界面上显示的 Feed ID。

    API 网址示例:

    https://us-chronicle.googleapis.com/v1alpha/projects/12345678910/locations/US/instances/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/feeds/yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy:importPushLogs
    
  11. 点击添加 HTTP 标头,然后按以下格式添加 HTTP 标头:

    • Header 1:Key1: X-goog-api-key 和 Value1:在 Google Cloud的 API 凭据中生成的 API 密钥。
    • Header 2:Key2: X-Webhook-Access-Key 和 Value2:在 Webhook 的“SECRET KEY”上生成的 API 密钥。
  12. 在日志类型列表中选择隧道。

  13. 在 Feed 输出类型列表中,选择 JSON。

  14. 停用 JSON 数组表示法。

  15. 将Feed 转义字符设置为 , \ "。

  16. 如需向 Feed 输出格式添加新字段,请在 Feed 输出类型列表中选择自定义。

  17. 复制并粘贴 Feed 输出格式,然后添加新字段。确保键名称与实际字段名称一致。

    以下是默认的Feed 输出格式:

    • 对于 IKE 第 1 阶段:

      \{ "sourcetype" : "zscalernss-tunnel", "event" : \{"datetime":"%s{datetime}","Recordtype":"%s{tunnelactionname}","tunneltype":"IPSEC IKEV %d{ikeversion}","user":"%s{vpncredentialname}","location":"%s{elocationname}","sourceip":"%s{sourceip}","destinationip":"%s{destvip}","sourceport":"%d{srcport}","destinationport":"%d{dstport}","lifetime":"%d{lifetime}","ikeversion":"%d{ikeversion}","spi_in":"%lu{spi_in}","spi_out":"%lu{spi_out}","algo":"%s{algo}","authentication":"%s{authentication}","authtype":"%s{authtype}","recordid":"%d{recordid}"\}\}
      
    • 对于 IKE 第 2 阶段:

      \{ "sourcetype" : "zscalernss-tunnel", "event" : \{"datetime":"%s{datetime}","Recordtype":"%s{tunnelactionname}","tunneltype":"IPSEC IKEV %d{ikeversion}","user":"%s{vpncredentialname}","location":"%s{elocationname}","sourceip":"%s{sourceip}","destinationip":"%s{destvip}","sourceport":"%d{srcport}","sourceportstart":"%d{srcportstart}","destinationportstart":"%d{destportstart}","srcipstart":"%s{srcipstart}","srcipend":"%s{srcipend}","destinationipstart":"%s{destipstart}","destinationipend":"%s{destipend}","lifetime":"%d{lifetime}","ikeversion":"%d{ikeversion}","lifebytes":"%d{lifebytes}","spi":"%d{spi}","algo":"%s{algo}","authentication":"%s{authentication}","authtype":"%s{authtype}","protocol":"%s{protocol}","tunnelprotocol":"%s{tunnelprotocol}","policydirection":"%s{policydirection}","recordid":"%d{recordid}"\}\}
      
    • 对于隧道事件:

      \{ "sourcetype" : "zscalernss-tunnel", "event" : \{"datetime":"%s{datetime}","Recordtype":"%s{tunnelactionname}","tunneltype":"%s{tunneltype}","user":"%s{vpncredentialname}","location":"%s{elocationname}","sourceip":"%s{sourceip}","destinationip":"%s{destvip}","sourceport":"%d{srcport}","event":"%s{event}","eventreason":"%s{eventreason}","recordid":"%d{recordid}"\}\}
      
    • 示例:

      \{ "sourcetype" : "zscalernss-tunnel", "event" : \{"datetime":"%s{datetime}","Recordtype":"%s{tunnelactionname}","tunneltype":"%s{tunneltype}","user":"%s{vpncredentialname}","location":"%s{elocationname}","sourceip":"%s{sourceip}","destinationip":"%s{destvip}","sourceport":"%d{srcport}","txbytes":"%lu{txbytes}","rxbytes":"%lu{rxbytes}","dpdrec":"%d{dpdrec}","recordid":"%d{recordid}"\}\}
      
  18. 在时区列表中,为输出文件中的时间字段选择时区。默认情况下,时区设置为您组织的时区。

  19. 查看配置的设置。

  20. 点击保存以测试连接。如果连接成功,系统会显示一个绿色对勾标记,并显示消息测试连接成功:正常 (200)。

如需详细了解 Google SecOps Feed,请参阅 Google SecOps Feed 文档。如需了解每种 Feed 类型的要求,请参阅按类型划分的 Feed 配置。

如果您在创建 Feed 时遇到问题,请与 Google SecOps 支持团队联系。

支持的 Zscaler 隧道日志格式

Zscaler Tunnel 解析器支持 JSON 格式的日志。

支持的 Zscaler Tunnel 示例日志

  • JSON

    {
      "sourcetype": "zscalernss-tunnel",
      "event": {
        "datetime": "Sun Jan 21 06:17:00 2024",
        "Recordtype": "Tunnel Samples",
        "tunneltype": "IPSec IKEv2",
        "user": "dummy-user@dummydomain.net",
        "location": "PLWSE06",
        "sourceip": "198.51.100.0",
        "destinationip": "198.51.100.1",
        "sourceport": "0",
        "txbytes": "12560",
        "rxbytes": "0",
        "dpdrec": "0",
        "recordid": "7326416289073594372"
      }
    }
    

UDM 映射表

字段映射参考信息:ZSCALER_TUNNEL

下表列出了 ZSCALER_TUNNEL 日志类型的日志字段及其对应的 UDM 字段。

Log field UDM mapping Logic
algo additional.fields[algo]
authtype additional.fields[authtype]
authentication additional.fields[authentication]
dd additional.fields[dd]
day additional.fields[day]
destinationportstart additional.fields[destinationportstart]
dpdrec additional.fields[dpdrec]
eventreason additional.fields[eventreason]
hh additional.fields[hh]
ikeversion additional.fields[ikeversion]
lifebytes additional.fields[lifebytes]
mm additional.fields[mm]
mon additional.fields[mon]
mth additional.fields[mth]
olocationname principal.location.name
ovpncredentialname principal.user.userid and principal.user.email_addresses if regular expression match ^.+@.+$
ss additional.fields[ss]
sourcetype additional.fields[sourcetype]
spi_in additional.fields[spi_in]
spi_out additional.fields[spi_out]
sourceportstart additional.fields[sourceportstart]
tz additional.fields[tz]
tunnelprotocol additional.fields[tunnelprotocol]
tunneltype additional.fields[tunneltype]
vendorname additional.fields[vendorname]
yyyy additional.fields[yyyy]
spi additional.fields[spi]
event metadata.description
datetime metadata.event_timestamp
metadata.event_type If (the srcipstart log field value is not empty or the srcipend log field value is not empty or the sourceip log field value is not empty) and (the destinationipstart log field value is not empty or the destinationip log field value is not empty or the destinationipend log field value is not empty), then the metadata.event_type UDM field is set to NETWORK_CONNECTION.

Else, if the srcipstart log field value is not empty or the srcipend log field value is not empty or the sourceip log field value is not empty, then the metadata.event_type UDM field is set to STATUS_UPDATE.

Else, the metadata.event_type UDM field is set to GENERIC_EVENT.
Recordtype metadata.product_event_type
recordid metadata.product_log_id
metadata.product_name The metadata.product_name UDM field is set to ZSCALER_TUNNEL.
metadata.vendor_name The metadata.vendor_name UDM field is set to ZSCALER.
network.direction If the policydirection log field value matches the regular expression pattern (?i)Inbound, then the network.direction UDM field is set to INBOUND.

Else, if the policydirection log field value matches the regular expression pattern (?i)Outbound, then the network.direction UDM field is set to OUTBOUND.
protocol network.ip_protocol If the protocol log field value contain one of the following values, then the protocol log field is mapped to the network.ip_protocol UDM field.
  • TCP
  • EIGRP
  • ESP
  • ETHERIP
  • GRE
  • ICMP
  • IGMP
  • IP6IN4
  • PIM
  • UDP
  • VRRP
rxbytes network.received_bytes
rxpackets network.received_packets
txbytes network.sent_bytes
txpackets network.sent_packets
lifetime network.session_duration.seconds
srcipstart principal.ip
sourceip principal.ip
srcipend principal.ip
location principal.location.name
sourceport principal.port
user principal.user.userid and principal.user.email_addresses if regular expression match ^.+@.+$
destinationipstart target.ip
destinationip target.ip
destinationipend' target.ip
destinationport target.port

更新日志

查看相应解析器的更新日志

需要更多帮助?获得社区成员和 Google SecOps 专业人士的解答。