收集 Microsoft SharePoint (Office 365) 日志

支持的平台:

本文档介绍了如何使用 Bindplane 将 Microsoft SharePoint (Office 365) 日志收集到 Google Security Operations 中。

Microsoft SharePoint 是一个基于网络的协作平台,可与 Microsoft 361 集成。SharePoint 审核日志会捕获用户活动,包括文件操作、文件夹活动、共享操作、列表操作和网站管理操作。这些日志通过 Microsoft Defender for Cloud Apps SIEM 代理进行访问,该代理从 SharePoint Online 和 OneDrive for Business 中检索审核数据,并以 syslog 格式将其流式传输到本地接收器。

准备工作

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

  • Google SecOps 实例
  • Windows Server 2016 或更高版本,或者具有 systemd 的 Linux 主机
  • 如果通过代理运行,请确保防火墙端口处于开放状态
  • 具有 SharePoint Online 的 Microsoft 365 租户
  • Microsoft Defender for Cloud Apps 许可(包含在 Microsoft 365 E5 中或作为附加服务提供)
  • Microsoft Defender 门户中的“全局管理员”或“安全管理员”角色
  • 一台安装了 Java 8 或更高版本的 Windows 或 Linux 服务器,用于运行 SIEM 代理(可以与 Bindplane 位于同一主机上)
  • 在 Microsoft 365 中启用统一审核日志记录

启用统一审核日志记录

在 Microsoft Defender for Cloud Apps 可以捕获 SharePoint 审核数据之前,必须为您的 Microsoft 365 租户启用统一审核日志记录。

  1. 登录 Microsoft Purview 合规性门户
  2. 前往审核
  3. 如果系统提示,请点击开始记录用户和管理员活动。 注意:启用统一审核日志记录后,内容最多可能需要 12 小时才能变为可用状态。
  • 或者,您也可以使用 PowerShell 启用统一审核日志记录:

    Connect-ExchangeOnline
    Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true
    

获取 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" /quiet
    
  3. 等待安装完成。

  4. 运行以下命令,验证安装是否成功:

    sc query observiq-otel-collector
    

    该服务应显示为 正在运行

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
    
  3. 等待安装完成。

  4. 运行以下命令,验证安装是否成功:

    sudo systemctl status observiq-otel-collector
    

    该服务应显示为有效(正在运行)

其他安装资源

如需了解其他安装选项和问题排查信息,请参阅 Bindplane 代理安装指南

配置 Bindplane 代理以注入 syslog 并将其发送到 Google SecOps

找到配置文件

  • Linux

    sudo nano /etc/bindplane-agent/config.yaml
    
  • Windows

    notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
    

修改配置文件

  • config.yaml 的全部内容替换为以下配置:

    receivers:
      udplog:
        listen_address: "0.0.0.0:514"
    
    exporters:
      chronicle/sharepoint:
        compression: gzip
        creds_file_path: '/etc/bindplane-agent/ingestion-auth.json'
        customer_id: '<CUSTOMER_ID>'
        endpoint: malachiteingestion-pa.googleapis.com
        log_type: SHAREPOINT
        raw_log_field: body
    
    service:
      pipelines:
        logs/sharepoint_to_chronicle:
          receivers:
            - udplog
          exporters:
            - chronicle/sharepoint
    

配置参数

替换以下占位符:

  • 导出器配置

    • <CUSTOMER_ID>:在上一步中复制的 Google SecOps 客户 ID
    • creds_file_path:数据注入身份验证文件的完整路径:
      • Linux/etc/bindplane-agent/ingestion-auth.json
      • WindowsC:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
    • 端点:区域端点网址:
      • 美国malachiteingestion-pa.googleapis.com
      • 欧洲europe-malachiteingestion-pa.googleapis.com
      • 亚洲asia-southeast1-malachiteingestion-pa.googleapis.com
      • 如需查看完整列表,请参阅区域级端点

保存配置文件

  • 修改后,保存文件:
    • Linux:依次按 Ctrl+OEnterCtrl+X
    • Windows:依次点击文件 > 保存

重启 Bindplane 代理以应用更改

如需在 Linux 中重启 Bindplane 代理,请执行以下操作:

  1. 运行以下命令:

    sudo systemctl restart observiq-otel-collector
    
  2. 验证服务是否正在运行:

    sudo systemctl status observiq-otel-collector
    
  3. 检查日志是否存在错误:

    sudo journalctl -u observiq-otel-collector -f
    

如需在 Windows 中重启 Bindplane 代理,请执行以下操作:

  1. 请从下列选项中选择一项:

    • 以管理员身份运行命令提示符或 PowerShell:
    net stop observiq-otel-collector && net start observiq-otel-collector
    
    • 服务控制台:
      1. Win+R,输入 services.msc,然后按 Enter 键。
      2. 找到 observIQ OpenTelemetry 收集器
      3. 右键点击并选择重新启动
  2. 验证服务是否正在运行:

    sc query observiq-otel-collector
    
  3. 检查日志是否存在错误:

    type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
    

配置 Microsoft Defender for Cloud Apps SIEM 代理以转发 SharePoint 日志

Microsoft SharePoint Online 是一项云服务,不具备内置的 syslog 转发功能。如需通过 syslog 转发 SharePoint 审核日志,请使用 Microsoft Defender for Cloud Apps SIEM 代理,该代理会从 Defender for Cloud Apps 中检索提醒和活动,并以 syslog 消息(采用 CEF 格式)的形式将其流式传输到 Bindplane 代理。

SIEM 代理的前提条件

  • 具有以下配置的 Windows 或 Linux 服务器(可以是虚拟机):

    • 已安装 Java 8 或更高版本
    • 传输层安全协议 (TLS) 1.2 或更高版本
    • CPU:2 个核心
    • 磁盘空间:20 GB
    • RAM:2 GB

第 1 步:在 Microsoft Defender 门户中配置 SIEM 代理

  1. 登录 Microsoft Defender 门户
  2. 选择设置
  3. 选择 Cloud Apps
  4. 系统下,选择 SIEM 代理
  5. 点击添加 SIEM 代理,然后选择通用 SIEM
  6. 点击启动向导
  7. 提供以下配置详细信息:
    • 名称:输入一个描述性名称(例如 Chronicle-Bindplane-SharePoint)。
    • 选择 SIEM 格式:选择 CEF
  8. 点击下一步
  9. 提供以下 syslog 连接详细信息:
    • 远程 syslog 主机:输入 Bindplane 代理主机(例如 192.168.1.100)的 IP 地址或主机名。
    • Syslog 端口号:输入 514(或在 Bindplane 代理 config.yaml 中配置的端口)。
    • 远程 Syslog 协议:选择 UDP(必须与 Bindplane 代理配置中的接收器类型一致)。
  10. 点击下一步
  11. 配置要导出的数据类型:
    1. 启用活动对应的滑块。
    2. 活动应用对象下拉菜单中,设置过滤条件以纳入 SharePoint 活动:
      1. 选择应用等于,然后选择 Microsoft SharePoint OnlineMicrosoft OneDrive for Business
    3. 如果您还想接收与 SharePoint 相关的政策提醒,请启用提醒对应的滑块。
  12. 点击修改并预览结果,验证过滤条件是否与预期活动匹配。
  13. 点击下一步
  14. 复制摘要页面上显示的令牌,并妥善保存。
  15. 点击完成

第 2 步:下载并运行 SIEM 代理 JAR 文件

  1. Microsoft 下载中心下载 SIEM 代理。
  2. 在将运行 SIEM 代理的服务器上解压缩下载的 ZIP 文件。
  3. 使用以下命令运行 SIEM 代理:

    java -jar mcas-siemagent-0.87.20-signed.jar --token <TOKEN>
    

<TOKEN> 替换为从 Microsoft Defender 门户复制的令牌。

第 3 步:将 SIEM 代理配置为以服务的形式运行

为确保持续转发日志,请将 SIEM 代理配置为自动启动:

Linux

  • 将运行命令添加到 /etc/rc.local 或创建 systemd 服务:

    java -jar /opt/mcas-siemagent/mcas-siemagent-0.87.20-signed.jar --token <TOKEN> &
    

Windows

  • 配置预定任务:
    1. 打开任务计划程序
    2. 创建新任务,并设置无论用户是否登录都运行
    3. 将操作设置为使用令牌参数运行 JAR 文件。
    4. 取消选中如果任务运行时间超过

第 4 步:验证 SIEM 代理连接

  1. Microsoft Defender 门户中,依次前往设置 > 云应用 > SIEM 代理
  2. 验证 SIEM 代理状态是否显示为已连接(绿色)。
  3. 在 Bindplane 代理主机上,验证是否正在接收 syslog 消息:

    sudo journalctl -u observiq-otel-collector -f
    
  4. 在 Google SecOps 中,搜索包含 metadata.log_type = "SHAREPOINT" 的日志,以确认日志注入。

UDM 映射表

日志字段 UDM 映射 逻辑
发生 metadata.event_timestamp 使用日期过滤器解析,格式为“MM/dd/yyyy HH:mm:ss A”“MM/dd/yyyy HH:mm:ss a”“M/d/yyyy HH:mm:ss A”
has_principal metadata.event_type 如果 has_principal 为 true 且(has_target_resource 为 true 或 has_target 为 true),则设置为“USER_RESOURCE_ACCESS”;如果 has_principal 为 true,则设置为“STATUS_UPDATE”;否则设置为“GENERIC_EVENT”
has_target_resource metadata.event_type
has_target metadata.event_type
metadata.product_name metadata.product_name 设置为“SHAREPOINT”
EventData metadata.product_version 直接复制值
metadata.vendor_name metadata.vendor_name 设置为“SHAREPOINT”
创建时间 principal.asset.attribute.labels 合并了“Created”中的“Created”键和“LastModified”中的“Last Modified”键对应的标签
LastModified principal.asset.attribute.labels
SamAccountName principal.asset.hostname 直接复制值
SamAccountName principal.hostname 直接复制值
数据库 principal.process.file.names 从数据库合并
UserEmail principal.user.email_addresses 如果与电子邮件正则表达式匹配,则从 UserEmail 合并
用户名 principal.user.user_display_name 直接复制值
EventType security_result.description 直接复制值
目录 target.file.full_path 直接复制值
叶子 target.file.names 从 Leaf 合并
ItemType target.resource.type 直接复制值
SecUserURL target.url 直接复制值
SecUserRole target.user.attribute.roles 合并了来自 SecUserRole 的角色名称
SecUserEmail target.user.email_addresses 如果匹配电子邮件正则表达式,则从 SecUserEmail 合并
SecGroupName target.user.group_identifiers 从 SecGroupName 合并
SecUserName target.user.user_display_name 直接复制值
SecSamAccountName target.user.userid 直接复制值

更新日志

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

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