收集 Sophos Extended Detection and Response 日志

支持的环境:

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

准备工作

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

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

获取 Google SecOps 注入身份验证文件

  1. 登录 Google SecOps 控制台。
  2. 前往 SIEM 设置 > 收集代理
  3. 下载数据注入身份验证文件

    • 将文件安全地保存在将安装 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](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](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/config.yaml 目录或 Windows 上的安装目录中。
    • 使用文本编辑器(例如 nanovi 或记事本)打开该文件。
  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:
        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_EDR'
        raw_log_field: body
        ingestion_labels:
    
    service:
      pipelines:
        logs/source0__chronicle_w_labels-0:
          receivers:
            - udplog
          exporters:
            - chronicle/chronicle_w_labels
    
  • 根据基础架构中的需要替换端口和 IP 地址。
  • <customer_id> 替换为实际的客户 ID。
  • /path/to/ingestion-authentication-file.json 更新为在第 1 步中保存身份验证文件的文件路径。

重启 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)的 Download Python
  3. 安装 Python。

    • 在 Windows 上:

      1. 运行安装程序。
      2. 选中标有 Add Python to PATH 的复选框。
      3. 点击 Install Now
    • 在 Mac 上:

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

下载 Sophos 集成脚本

  1. 前往 Sophos Central SIEM 集成 GitHub 代码库 的 GitHub 页面。
  2. 依次点击绿色的代码按钮 > 下载 ZIP
  3. 提取 ZIP 文件。

设置脚本配置

  1. 使用文本编辑器查找打开 config.ini 文件。
  2. 修改配置文件:

    • API 令牌:输入之前从 Sophos Central 复制的 API 密钥。
    • Syslog 服务器详细信息:输入 Syslog 服务器的详细信息。
    • 主机:输入 Bindplane 代理 IP 地址。
    • 端口:输入 Bindplane 端口号。
    • 协议:输入 UDP(您也可以根据设置使用 TCPTLS )。
  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. 在“开始”菜单中输入 Task Scheduler ,打开任务计划程序。
  2. 点击创建任务

  3. 常规 标签页中:

    • 为任务命名;例如 Sophos EDR 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 映射 逻辑
name metadata.description 直接映射
rt metadata.event_timestamp 解析为 ISO8601
has_principal metadata.event_type 已映射:trueNETWORK_UNCATEGORIZEDtrueSTATUS_UPDATEtrue → `STATUS_STARTUP...
has_principal_user metadata.event_type 已映射:trueUSER_UNCATEGORIZED
has_target_user metadata.event_type 已映射:trueUSER_CREATION
type metadata.event_type 映射的值(共 9 个,例如 ADSyncFILE_SYNC、`UpdateRebootRequired/RESTARTING/Update...
type metadata.product_event_type 直接映射
source_info.ip principal.asset.ip 已合并
group principal.group.group_display_name 直接映射
source_info.ip principal.ip 已合并
item.descriptor principal.process.file.names 已合并
appSha256 principal.process.file.sha256 直接映射
suser principal.user.userid 直接映射
sr_action security_result.action 已合并
severity security_result.severity 直接映射
detection_identity_name security_result.threat_feed_name 直接映射
threat security_result.threat_name 直接映射
dhost target.asset.hostname 直接映射
data.fileName target.file.full_path 直接映射
filePath target.file.full_path 直接映射
dhost target.hostname 直接映射
id target.process.pid 直接映射
endpoint_id_label target.resource.attribute.labels 已合并
endpoint_type_label target.resource.attribute.labels 已合并
customer_id target.resource.id 直接映射
type target.resource.resource_type 已映射:ScheduledDataUploadResumedTASKScheduledDailyLimitExceededTASK
duid target.user.userid 直接映射
不适用 metadata.event_type 常量:NETWORK_UNCATEGORIZED
不适用 metadata.product_name 常量:Sophos EDR
不适用 metadata.vendor_name 常量:SOPHOS
不适用 target.resource.resource_type 常量:TASK

更新日志

查看此解析器的更新日志

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