收集 Sophos Endpoint 日志

支持的语言:

本文档介绍了如何使用 Bindplane 代理收集 Sophos Endpoint(以前称为 Sophos AV/Intercept X)日志。解析器会将 JSON 日志转换为统一数据模型 (UDM)。它会从嵌套的 JSON 结构中提取字段,将其映射到 UDM 字段,并根据 type 字段执行事件分类,从而为不同的 Sophos AV 事件类型丰富数据,添加具体细节和操作。

准备工作

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

  • Google SecOps 实例
  • Windows 2016 或更高版本,或者具有 systemd 的 Linux 主机
  • 一台能够持续运行 Python 的额外 Windows 或 Linux 机器
  • 如果通过代理运行,请确保防火墙端口根据 Bindplane 代理要求处于开放状态
  • 对 Sophos Central 管理控制台的特权访问权限

获取 Bindplane 代理的 Google SecOps 凭证

如需向 Google SecOps 验证 Bindplane 代理的身份,请选择以下方法之一:

  • 新部署:使用 Chronicle API(选项 1)。
  • 旧版部署:继续使用数据注入身份验证文件(方法 2),直到 Ingestion API 于 2027 年 7 月 20 日停用。
  1. 登录 Google Cloud 控制台,然后选择与您的 Google SecOps 实例关联的 Google Cloud 项目。
  2. 前往 IAM 和管理 > 服务账号。
  3. 点击创建服务账号。
  4. 提供以下配置详细信息:
    • 服务账号名称:输入账号的名称(例如 bindplane-ingest)。
    • 服务账号说明:输入说明(例如 Bindplane agent log ingestion)。
  5. 点击创建并继续。
  6. 在向此服务账号授予对项目的访问权限部分,点击选择角色,然后选择 Chronicle Editor。
  7. 点击继续,然后点击完成。
  8. 点击您创建的服务账号,然后前往密钥标签页。
  9. 依次点击添加密钥 > 创建新密钥。
  10. 选择 JSON,然后点击创建。密钥文件会下载到您的计算机上。
  11. 将密钥文件另存为 Bindplane 收集器目录(Linux 上的 /opt/observiq-otel-collector/ingestion-auth.json 或 Windows 上的 C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json)中的 ingestion-auth.json,或更新 config.yaml 中的 creds_file_path 以匹配您保存该文件的路径。
  12. 前往 IAM 和管理 > 设置,然后复制项目编号。您需要此信息才能配置导出器。

方法 2:下载数据注入身份验证文件(旧版)

  1. 登录 Google SecOps 控制台。
  2. 依次前往 SIEM 设置 > 收集代理。
  3. 下载数据注入身份验证文件。
  4. 将文件安全地保存在将安装 Bindplane 代理的系统上。

获取 Google SecOps 客户 ID

  1. 登录 Google SecOps 控制台。
  2. 前往 SIEM 设置 > 个人资料。
  3. 复制并保存组织详细信息部分中的客户 ID。

安装 Bindplane 代理

按照以下说明在 Windows 或 Linux 操作系统上安装 Bindplane 代理。

Windows 安装

  1. 以管理员身份打开命令提示符或 PowerShell。
  2. 运行以下命令:

    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
    

Linux 安装

  1. 打开具有 root 或 sudo 权限的终端。
  2. 运行以下命令:

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    

其他安装资源

如需了解其他安装选项,请参阅此安装指南。

配置 Bindplane 代理以接收 Syslog 并将其发送到 Google SecOps

  1. 访问配置文件:
    • 找到 config.yaml 文件。通常,它位于 Linux 上的 /opt/observiq-otel-collector/ 目录中,或 Windows 上的安装目录中。
    • 使用文本编辑器(例如 nano、vi 或记事本)打开该文件。
  2. 按如下方式修改 config.yaml 文件:

    receivers:
      udplog:
        # Replace the port and IP address as required
        listen_address: "0.0.0.0:514"
    
    exporters:
      chronicle/chronicle_w_labels:
        protocol: https
        # Region of your instance, for example us, europe, asia-southeast1
        location: <LOCATION>
        # Project number of the Google Cloud project linked to the instance
        project: '<PROJECT_NUMBER>'
        compression: gzip
        # Adjust the path to the credentials file you downloaded in Step 1
        creds_file_path: '/path/to/ingestion-authentication-file.json'
        # Replace with your actual customer ID from Step 2
        customer_id: <customer_id>
        endpoint: chronicle.googleapis.com
        # Add optional ingestion labels for better organization
        log_type: 'SOPHOS_AV'
        raw_log_field: body
        ingestion_labels:
    
    service:
      pipelines:
        logs/source0__chronicle_w_labels-0:
          receivers:
            - udplog
          exporters:
            - chronicle/chronicle_w_labels
    
  3. 根据基础架构的要求替换端口和 IP 地址。

  4. 将 <LOCATION> 替换为 Google SecOps 实例的区域(例如 us、europe 或 asia-southeast1)。导出器会使用此值作为 chronicle.googleapis.com 的前缀。

  5. 将 <PROJECT_NUMBER> 替换为 IAM 和管理 > 设置中的项目编号。

  6. 将 <customer_id> 替换为实际客户 ID。

  7. 将 /path/to/ingestion-authentication-file.json 更新为在第 1 步中保存服务账号密钥文件(选项 1)的文件路径。

旧版提取 API

  • 如果您使用选项 2 中的数据注入身份验证文件,请将 exporters 代码块替换为以下内容。将 creds_file_path 设置为提取身份验证文件的路径,如果您的实例位于美国境外,请将 malachiteingestion-pa.googleapis.com 替换为您的区域端点(例如 europe-malachiteingestion-pa.googleapis.com)。

    exporters:
      chronicle/chronicle_w_labels:
        compression: gzip
        # Adjust the path to the credentials file you downloaded in Step 1
        creds_file_path: '/path/to/ingestion-authentication-file.json'
        # Replace with your actual customer ID from Step 2
        customer_id: <customer_id>
        endpoint: malachiteingestion-pa.googleapis.com
        # Add optional ingestion labels for better organization
        log_type: 'SOPHOS_AV'
        raw_log_field: body
        ingestion_labels:
    

重启 Bindplane 代理以应用更改

  1. 如需在 Linux 中重启 Bindplane 代理,请运行以下命令:

    sudo systemctl restart bindplane-agent
    
  2. 如需在 Windows 中重启 Bindplane 代理,您可以使用服务控制台,也可以输入以下命令:

    net stop BindPlaneAgent && net start BindPlaneAgent
    

配置 Sophos Central API 访问权限

  1. 登录 Sophos Central Admin。
  2. 依次选择全局设置 > API 令牌管理。
  3. 点击添加令牌以创建新令牌。
  4. 输入令牌名称,然后点击保存。系统会显示所提供令牌的 API 令牌摘要。
  5. 在 API 令牌摘要部分中,点击复制以复制 API 访问网址和标头。

在其他机器上安装 Python

  1. 打开网络浏览器,然后前往 Python 网站。
  2. 点击适用于您的操作系统(Windows 或 Mac)的下载 Python。
  3. 安装 Python。

    • 在 Windows 上:
      1. 运行安装程序。
      2. 勾选 Add Python to PATH(将 Python 添加到 PATH)复选框。
      3. 点击立即安装。
    • 在 Mac 上:

      1. Python 可能已安装,如果没有,您可以使用终端安装最新版本。
      2. 打开终端,然后输入以下命令:
      python --version
      

下载 Sophos 集成脚本

  1. 前往 Sophos Central SIEM 集成 GitHub 代码库的 GitHub 页面。
  2. 依次点击绿色“Code”按钮 >“Download ZIP”。
  3. 解压 ZIP 文件。

设置脚本配置

  1. 找到 config.ini 文件,并使用文本编辑器将其打开。
  2. 修改配置文件:
    • API 令牌:输入之前从 Sophos Central 复制的 API 密钥。
    • Syslog 服务器详细信息:输入 Syslog 服务器的详细信息。
    • 主机:输入 Bindplane IP 地址。
    • 端口:输入 Bindplane 端口号。
    • 协议:输入 UDP(您也可以使用 TCP 或 TLS,具体取决于您的设置)。
  3. 保存文件。

运行脚本

  1. 前往脚本文件夹。

    • 在 Windows 上:

      1. 按 Windows 键,然后输入 cmd。
      2. 点击命令提示符。
      3. 前往脚本文件夹:
      cd C:UsersYourNameDownloadsSophos-Central-SIEM-Integration
      
    • 在 macOS 上:

      1. 依次前往应用 > 实用程序。
      2. 打开终端。
      3. 前往脚本文件夹:
      cd /Users/YourName/Downloads/Sophos-Central-SIEM-Integration
      
  2. 运行脚本:

    • 输入以下命令以启动脚本:

      python siem.py
      

将脚本设置为在 Windows 上持续运行(使用任务计划程序):

  1. 在“开始”菜单中输入任务计划程序,打开任务计划程序。
  2. 点击创建任务。
  3. 在常规标签页中:
    • 为任务命名,例如 Sophos AV Log Export。
  4. 在触发器标签页中:
    • 点击新建,然后将任务设置为每天或启动时运行(具体取决于您的偏好)。
  5. 在操作标签页中:
    • 点击新建,然后选择启动计划。
    • 浏览 python.exe 可执行文件(通常位于 C:PythonXXpython.exe)。
    • 在添加参数字段中,输入脚本的路径,例如 C:UsersYourNameDownloadsSophos-Central-SIEM-Integrationsiem.py。
  6. 点击确定以保存任务。

在 Mac 上将脚本设置为自动持续运行(使用 Cron 作业):

  1. 打开终端。
  2. 输入 crontab -e,然后按 Enter。
  3. 在文件末尾添加一个新行:

    * * * * * /usr/bin/python /Users/YourName/Downloads/Sophos-Central-SIEM-Integration/siem.py
    
  4. 保存并退出编辑器。

UDM 映射表

日志字段 UDM 映射 逻辑
s_ip intermediary.ip 已合并
description metadata.description 直接映射
name metadata.description 直接映射
security_result.description metadata.description 已重命名/已映射
end metadata.event_timestamp 解析为 RFC 3339
ts metadata.event_timestamp 已解析为 RFC 3339
action metadata.event_type 已映射:unknown → NETWORK_CONNECTION、allowed → SCAN_PROCESS、blocked → `SCAN_PROC…
e_type metadata.event_type 映射的值(共 11 个,例如 NonCompliant → SCAN_HOST、SavDisabled → `SETTING_MODIFIC…
type metadata.event_type 映射的值(共 13 个,例如 Event::Endpoint::NonCompliant → SCAN_HOST、`Event::Endpoin…
e_type metadata.product_event_type 直接映射
type metadata.product_event_type 直接映射
action network.direction 已映射:warned → OUTBOUND,unknown → OUTBOUND
e_type network.direction 已映射:WindowsFirewall::Blocked → OUTBOUND
type network.direction 已映射:Event::Endpoint::WindowsFirewall::Blocked → OUTBOUND
action network.ip_protocol 已映射:warned → TCP,unknown → TCP
appSha256 principal.file.sha256 直接映射
dhost principal.hostname 直接映射
host principal.hostname 直接映射
source_info.ip principal.ip 已合并
src_ip principal.ip 已合并
id principal.resource.id 直接映射
suser principal.user.user_display_name 直接映射
suser principal.user.userid 直接映射
user principal.user.userid 直接映射
user_id principal.user.userid 直接映射
endpoint_id_label security_result.about.labels 已合并
endpoint_type_label security_result.about.labels 已合并
action security_result.action 映射的值(共 5 个,例如 allow → sec_action、unknown → sec_action、allowed → `…
sec_action security_result.action 已合并
group security_result.category_details 已合并
sub_cat security_result.category_details 已合并
desc security_result.description 直接映射
e_type security_result.description 已映射:(UpdateRebootRequired/ServiceNotRunning/NonCompliant/OutOfDate) → `security_result…
type security_result.description 已映射:Event::Endpoint::(UpdateRebootRequired/ServiceNotRunning/NonCompliant/OutOfDate) →…
rule security_result.rule_name 直接映射
rules security_result.rule_name 直接映射
severity security_result.severity 映射的值(共 6 个,例如 low → LOW、low → MEDIUM、low → HIGH)
security_result.description security_result.summary 已重命名/映射
application target.application 直接映射
endpoint_id target.asset_id 直接映射
f_path target.file.full_path 直接映射
f_size target.file.size 已重命名/映射
dhost target.hostname 直接映射
host target.hostname 直接映射
application target.process.file.full_path 直接映射
customer_id target.resource.id 直接映射
e_type target.resource.name Mapped: SavDisabled → Real time protection, OutOfDate → Device Registration, `Regist…
p_device target.resource.name 直接映射
scan_name target.resource.name 直接映射
type target.resource.name 已映射:Event::Endpoint::SavDisabled → Real time protection,`Event::Endpoint::OutOfDate…
action target.resource.type 已映射:blocked → Device,restricted to read-only → Device
e_type target.resource.type 映射的值(总共 5 个,例如 SavDisabled → SETTING、OutOfDate → SETTING、“已注册…
type target.resource.type 映射的值(总共 5 个,例如 Event::Endpoint::SavDisabled → SETTING、`Event::Endpoint::O…
url target.url 直接映射
duid target.user.userid 直接映射
suser target.user.userid 直接映射
user target.user.userid 直接映射
不适用 metadata.event_type 常量:GENERIC_EVENT
不适用 metadata.product_name 常量:Sophos Anti-Virus
不适用 metadata.vendor_name 常量:Sophos
不适用 network.direction 常量:OUTBOUND
不适用 network.ip_protocol 常量:TCP
不适用 security_result.description 常量:security_result.summary
不适用 security_result.severity 常量:LOW
不适用 target.resource.name 常量:Real time protection
不适用 target.resource.type 常量:SETTING

更新日志

查看此解析器的更新日志

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