适用于 Windows 的 Google Security Operations 转发器可执行文件

本文档介绍如何在 Microsoft Windows 上安装和配置 Google Security Operations 转发器。

自定义配置文件

Google Cloud 会根据您在部署之前提交的信息,为您提供 Google Security Operations 转发器的可执行文件和可选配置文件。可执行文件只能在运行配置文件的主机上运行。每个可执行文件都包含您网络上的 Google Security Operations 转发器实例的专属配置。如果您需要更改配置,请与 Google Security Operations 支持团队联系。

系统要求

下面是一些常规建议。如需了解专门针对您的系统的建议,请与 Google 安全运营支持团队联系。

  • Windows Server 版本:以下版本的 Microsoft Windows Server 支持 Google Security Operations 转发器:

    • 2008 R2

    • 2012 R2

    • 2016

  • RAM:每种收集的数据类型 1.5 GB。例如,端点检测和响应 (EDR)、DNS 和 DHCP 都是单独的数据类型。这三项都需要 4.5 GB 的 RAM 才能收集。

  • CPU:2 个 CPU 足以处理每秒 (EPS) 以下 10,000 个事件(适用于所有数据类型的总计)。如果您预期转发的 EPS 超过 10000,则需要 4 到 6 个 CPU。

  • 磁盘:无论 Google Security Operations 转发器处理多少数据,100 MB 的磁盘空间都已足够。默认情况下,Google Security Operations 转发器不会缓冲到磁盘。您可以通过在配置文件中添加 write_to_disk_buffer_enabledwrite_to_disk_dir_path 参数来缓冲磁盘。

    例如:

    - <collector>:
         common:
             ...
             write_to_disk_buffer_enabled: true
             write_to_disk_dir_path: <var>your_path</var>
             ...
    

Google IP 地址范围

在设置 Google Security Operations 转发器配置时(例如在设置防火墙配置时),您可能需要打开 IP 地址范围。Google 无法提供具体的 IP 地址列表。 不过,您可以获取 Google IP 地址范围

验证防火墙配置

如果您在 Google Security Operations 转发器容器和互联网之间设置了防火墙或经过身份验证的代理,则它们需要使用规则来允许访问以下 Google Cloud 主机:

连接类型 目标 端口
TCP malachiteingestion-pa.googleapis.com 443
TCP asia-northeast1-malachiteingestion-pa.googleapis.com 443
TCP asia-south1-malachiteingestion-pa.googleapis.com 443
TCP asia-southeast1-malachiteingestion-pa.googleapis.com 443
TCP australia-southeast1-malachiteingestion-pa.googleapis.com 443
TCP europe-malachiteingestion-pa.googleapis.com 443
TCP europe-west2-malachiteingestion-pa.googleapis.com 443
TCP europe-west3-malachiteingestion-pa.googleapis.com 443
TCP europe-west6-malachiteingestion-pa.googleapis.com 443
TCP europe-west12-malachiteingestion-pa.googleapis.com 443
TCP me-central1-malachiteingestion-pa.googleapis.com 443
TCP me-central2-malachiteingestion-pa.googleapis.com 443
TCP me-west1-malachiteingestion-pa.googleapis.com 443
TCP northamerica-northeast2-malachiteingestion-pa.googleapis.com 443
TCP accounts.google.com 443
TCP gcr.io 443
TCP oauth2.googleapis.com 443
TCP storage.googleapis.com 443

您可以按照以下步骤检查与 Google Cloud 的网络连接:

  1. 以管理员权限启动 Windows PowerShell(点击开始,输入 PowerShell,右键点击 Windows PowerShell,然后点击以管理员身份运行)。

  2. 运行以下命令。TcpTestSucceeded 应返回 true。

    C:\> test-netconnection <host> -port <port>

    例如:

    C:\> test-netconnection malachiteingestion-pa.googleapis.com -port 443
    ComputerName     : malchiteingestion-pa.googleapis.com
    RemoteAddress    : 198.51.100.202
    RemotePort       : 443
    InterfaceAlias   : Ethernet
    SourceAddress    : 10.168.0.2
    TcpTestSucceeded : True
    

您还可以使用 Google Security Operations 转发器来检查网络连接:

  1. 以管理员权限启动命令提示符(点击开始,输入 Command Prompt,右键点击命令提示符,然后点击以管理员身份运行)。

  2. 如需验证网络连接,请使用 -test 选项运行 Google Security Operations 转发器。

    C:\> .\chronicle_forwarder.exe -test
    Verify network connection succeeded!
    

在 Windows 上安装 Google Security Operations 转发器

在 Windows 上,Google Security Operations 转发器可执行文件需要作为服务进行安装。

  1. chronicle_forwarder.exe 文件和配置文件复制到工作目录。

  2. 以管理员权限启动命令提示符(点击开始,输入 Command Prompt,右键点击命令提示符,然后点击以管理员身份运行)。

  3. 如需安装该服务,请导航到您在第 1 步中创建的工作目录并运行以下命令:

    C:\> .\chronicle_forwarder.exe -install -config FILE_NAME
    

    FILE_NAME 替换为提供给您的配置文件的名称。

    该服务将安装到 C:\Windows\system32\ChronicleForwarder 中。

  4. 如需启动该服务,请运行以下命令:

    C:\> sc.exe start chronicle_forwarder
    

验证 Google Security Operations 转发器是否正在运行

Google Security Operations 转发器应在端口 443 上打开网络连接,并且您的数据应该会在几分钟内显示在 Google Security Operations 网页界面中。

您可以使用以下任一方法验证 Google Security Operations 转发器是否正在运行:

  • 任务管理器:依次转到进程标签页 > 后台进程 > chronicle_forwarder

  • 资源监控器:在网络标签页上,chronicle_forwarder.exe 应用应列在网络活动(每当 chronicle_forwarder.exe 应用连接到 Google Cloud 时)、TCP 连接下和监听端口下。

查看转发器日志

Google Security Operations 转发器日志文件存储在 C:\Windows\Temp 文件夹中。日志文件以 chronicle_forwarder.exe.win-forwarder 开头。日志文件提供各种信息,包括转发器的启动时间和开始向 Google Cloud 发送数据的时间。

卸载 Google Security Operations 转发器

如需卸载 Google Security Operations 转发器服务,请完成以下步骤:

  1. 在管理员模式下打开命令提示符。

  2. 停止 Google Security Operations 转发器服务:

    SERVICE_NAME: chronicle_forwarder
    TYPE               : 10  WIN32_OWN_PROCESS
    STATE              : 4  RUNNING (STOPPABLE, PAUSABLE, ACCEPTS_SHUTDOWN)
    WIN32_EXIT_CODE    : 0  (0x0)
    SERVICE_EXIT_CODE  : 0  (0x0)
    CHECKPOINT         : 0x0
    WAIT_HINT          : 0x0
    
  3. 转到 C:\Windows\system32\ChronicleForwarder 目录并卸载 Google Security Operations 转发器服务:C:\> .\chronicle_forwarder.exe -uninstall

升级 Google Security Operations 转发器

如需在升级 Google Security Operations 转发器的同时继续使用当前配置文件,请完成以下步骤:

  1. 在管理员模式下打开命令提示符。

  2. 将您的配置文件从 C:\Windows\system32\ChronicleForwarder 目录复制到另一个目录。

  3. 停止 Google Security Operations 转发器:

    C:\> sc.exe stop chronicle_forwarder
    
  4. 卸载 Google Security Operations 转发器服务和应用:

    C:\> .\chronicle_forwarder.exe --uninstall
    
  5. 删除 C:\windows\system32\ChronicleForwarder 目录中的所有文件。

  6. 将新的 chronicle_forwarder.exe 应用和原始配置文件复制到工作目录。

  7. 从工作目录中运行以下命令:

    C:\> .\chronicle_forwarder.exe -install -config configFileProvidedToYou
    
  8. 启动服务:

    C:\ sc.exe start chronicle_forwarder
    

收集 Splunk 数据

与 Google Security Operations 支持团队联系,以更新您的 Google Security Operations 转发器配置文件,将您的 Splunk 数据转发到 Google Cloud。

收集 Syslog 数据

Google Security Operations 转发器可以作为 Syslog 服务器运行,这意味着您可以将任何支持通过 TCP 或 UDP 连接发送 Syslog 数据的设备或服务器配置为将其数据转发到 Google Security Operations 转发器。您可以精确控制设备或服务器向 Google Security Operations 转发器发送哪些数据,然后 Google Security Operations 转发器会将数据转发到 Google Cloud。

Google Security Operations 转发器配置文件可针对每种转发数据指定要监控的端口(例如端口 10514)。默认情况下,Google Security Operations 转发器接受 TCP 和 UDP 连接。与 Google Security Operations 支持团队联系,以更新您的 Google Security Operations 转发器配置文件以支持 syslog。

切换数据压缩

日志压缩可减少将日志传输到 Google Security Operations 时的网络带宽消耗。但是,压缩可能会导致 CPU 使用率增加。 CPU 使用率和带宽之间的权衡取决于许多因素,包括日志数据类型、这些数据的可压缩性、运行转发器的主机上的 CPU 周期可用性,以及减少网络带宽消耗的需求。

例如,基于文本的日志可以很好地压缩,可以在降低 CPU 使用率的情况下显著节省带宽。但是,原始数据包的加密载荷不能很好地压缩,并且会产生更高的 CPU 使用率。

由于转发器提取的大多数日志类型都高效压缩,因此默认启用日志压缩以减少带宽消耗。但是,如果增加的 CPU 使用量超过了带宽节省的优势,您可以在 Google Security Operations 转发器配置文件中将 compression 字段设置为 false 来停用压缩功能,如以下示例所示:

  compression: false
  url: malachiteingestion-pa.googleapis.com:443
  identity:
  identity:
  collector_id: 10479925-878c-11e7-9421-10604b7abba1
  customer_id: abcd4bb9-878b-11e7-8455-12345b7cb5c1
  secret_key: |
  {
    "type": "service_account",
  ...

为 syslog 配置启用 TLS

您可以为与 Google Security Operations 转发器的 syslog 连接启用传输层安全协议 (TLS)。在 Google Security Operations 转发器配置文件中,指定证书和证书密钥的位置,如以下示例所示:

证书 C:/opt/chronicle/external/certs/edb3ae966a7bbe1f.pem
certificate_key C:/opt/chronicle/external/certs/forwarder.key

根据显示的示例,Google Security Operations 转发器配置将修改为如下配置:

  collectors:
- syslog:
    common:
      enabled: true
      data_type: WINDOWS_DNS
      data_hint:
      batch_n_seconds: 10
      batch_n_bytes: 1048576
  tcp_address: 0.0.0.0:10515
  connection_timeout_sec: 60
  certificate: "C:/opt/chronicle/external/certs/edb3ae966a7bbe1f.pem"
  certificate_key: "C:/opt/chronicle/external/certs/forwarder.key"

您可以在配置目录下创建证书目录,并将证书文件存储在该目录下。

收集数据包数据

在 Windows 系统上,Google Security Operations 转发器可以使用 Npcap 直接从网络接口捕获数据包。

系统捕获数据包并将其发送到 Google Cloud,而不是日志条目。捕获仅从本地接口完成。

与 Google Security Operations 支持团队联系,以更新您的 Google Security Operations 转发器配置文件以支持数据包捕获。

如需运行数据包捕获 (PCAP) 转发器,您需要以下各项:

  • 在 Microsoft Windows 主机上安装 Npcap。

  • 向 Google Security Operations 转发器授予 root 权限或管理员权限,以监控网络接口。

  • 无需命令行选项。

  • 安装 Npcap 时,启用 WinPcap 兼容模式。

如需配置 PCAP 转发器,Google Cloud 需要用于捕获数据包的接口的 GUID。在计划安装 Google Security Operations 转发器的机器上(服务器或监听 span 端口的机器)运行 getmac.exe,并将输出发送到 Google Security Operations。

或者,您可以修改配置文件。找到 PCAP 部分,然后将接口旁边显示的 GUID 值替换为运行 getmac.exe 时显示的 GUID。

例如,以下是原始 PCAP 部分:

 common:
       enabled: true
 data_type: PCAP_DNS
       batch_n_seconds: 10
   batch_n_bytes: 1048576
     interface: \Device\NPF_{1A7E7C8B-DD7B-4E13-9637-0437AB1A12FE}
   bpf: udp port 53

运行 getmac.exe 后的输出如下所示:

C:\>getmac.exe
  Physical Address    Transport Name
  ===========================================================================
  A4-73-9F-ED-E1-82   \Device\Tcpip_{2E0E9440-ABFF-4E5B-B43C-E188FCAD1234}

最后,下面是修订后的 PCAP 部分以及新的 GUID:

- pcap:
       common:
     enabled: true
         data_type: PCAP_DNS
     batch_n_seconds: 10
         batch_n_bytes: 1048576
       interface: \Device\NPF_{2E0E9440-ABFF-4E5B-B43C-E188FCAD9734}
     bpf: udp port 53

收集 WebProxy 数据

Google Security Operations 转发器可以使用 Npcap 直接从网络接口捕获 WebProxy 数据并将其发送到 Google Cloud。

如需为您的系统启用 WebProxy 数据捕获功能,请与 Google Security Operations 支持团队联系。

在运行 WebProxy 转发器之前,请执行以下操作:

  1. 在 Microsoft Windows 主机上安装 Npcap。在安装过程中启用 WinPcap 兼容模式。

  2. 向 Google Security Operations 转发器授予 root 权限或管理员权限,以监控网络接口。

  3. 如需配置 WebProxy 转发器,Google Cloud 需要用于捕获 WebProxy 数据包的接口的 GUID。

    在要安装 Google Security Operations 转发器的机器上运行 getmac.exe,并将输出发送到 Google Security Operations。或者,您可以修改配置文件。找到 WebProxy 部分,然后将接口旁边显示的 GUID 替换为运行 getmac.exe 后显示的 GUID。

    修改 Google Security Operations 转发器配置 (FORWARDER_NAME.conf) 文件,如下所示:

      - webproxy:
        common:
            enabled : true
            data_type: <Your LogType>
            batch_n_seconds: 10
            batch_n_bytes: 1048576
          interface: \Device\NPF_{2E0E9440-ABFF-4E5B-B43C-E188FCAD9734}
          bpf: tcp and dst port 80