收集 Yubico OTP 日志

支持的平台:

本文档介绍了如何使用 Bindplane 代理将 Yubico OTP 日志注入到 Google Security Operations。

Yubico OTP 是一种基于硬件的动态密码身份验证协议。YubiKey 验证服务器 (ykval) 是一种自托管 PHP 应用,用于验证 OTP 令牌并通过 syslog(LOG_LOCAL0 工具)记录验证请求。

准备工作

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

  • Google SecOps 实例
  • Windows Server 2016 或更高版本,或者具有 systemd 的 Linux 主机
  • Bindplane 代理与 YubiKey 验证服务器之间的网络连接
  • 如果在代理后面运行,请确保防火墙端口已根据 Bindplane 代理要求打开
  • 配置了 syslog 输出的自托管 YubiKey 验证服务器 (ykval)

获取 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/yubico_otp:
            compression: gzip
            creds_file_path: '/etc/bindplane-agent/ingestion-auth.json'
            customer_id: '<customer_id>'
            endpoint: malachiteingestion-pa.googleapis.com
            log_type: YUBICO_OTP
            raw_log_field: body
    
    service:
        pipelines:
            logs/yubico_to_chronicle:
                receivers:
                    - udplog
                exporters:
                    - chronicle/yubico_otp
    

配置参数

替换以下占位符:

  • 接收器配置

    • listen_address:要监听的 IP 地址和端口:
      • 0.0.0.0 侦听所有接口(推荐)
      • 端口 514 是标准 syslog 端口(在 Linux 上需要 root 权限;对于非 root 用户,请使用 1514
  • 导出器配置

    • creds_file_path:提取身份验证文件的完整路径:
      • Linux/etc/bindplane-agent/ingestion-auth.json
      • WindowsC:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
    • customer_id:从 Google SecOps 控制台复制的客户 ID
    • endpoint:区域端点网址:
      • 美国malachiteingestion-pa.googleapis.com
      • 欧洲europe-malachiteingestion-pa.googleapis.com
      • 亚洲asia-southeast1-malachiteingestion-pa.googleapis.com
      • 如需查看完整列表,请参阅区域级端点

保存配置文件

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

重启 Bindplane 代理以应用更改

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

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

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

      sudo journalctl -u observiq-otel-collector -f
      
  • 如需在 Windows 中重启 Bindplane 代理,请选择以下选项之一:

    • 以管理员身份运行命令提示符或 PowerShell:

      net stop observiq-otel-collector && net start observiq-otel-collector
      
    • 服务控制台:

      1. Win+R,输入 services.msc,然后按 Enter 键。
      2. 找到 observIQ OpenTelemetry 收集器
      3. 右键点击并选择重新启动
      4. 验证服务是否正在运行:

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

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

配置 ykval syslog 转发

  1. 验证是否已配置 ykval syslog 输出。将以下内容添加到 /etc/rsyslog.d/ykval.conf(或您的 syslog 守护程序的等效文件):

    local0.*    @<BINDPLANE_AGENT_IP>:514
    
  2. 重启 rsyslog 服务:

    sudo systemctl restart rsyslog
    
  3. 通过检查 Bindplane 代理日志,验证 OTP 验证请求是否正在转发。

UDM 映射表

日志字段 UDM 映射 逻辑
token1、token2、token3、token4 additional.fields 如果 token1 不为空,则从 additional_token1 合并;如果 token2 不为空,则从 additional_token2 合并;如果 token3 不为空,则从 additional_token3 合并;如果 token4 不为空,则从 additional_token4 合并
token1, token2 extensions.auth.mechanism 如果 token1 或 token2 不为空,则设置为“OTP”
extensions.auth.type 如果说明与“已通过身份验证”“错误”“已登录”匹配,则设置为“AUTHTYPE_UNSPECIFIED”
中介 中介 已合并
说明 metadata.description 直接复制值
description、audit_type、product_event、has_principal_machine_field、has_principal_user_id metadata.event_type 如果说明与“authenticated”“wrong”“logged in”匹配,则设置为 USER_LOGIN;如果 audit_type 与“audit”匹配,且 has_principal_machine_field 为 true,且 has_principal_user_id 为 true,则设置为 SYSTEM_AUDIT_LOG_UNCATEGORIZED;如果 has_principal_machine_field 为 true,则设置为 STATUS_UPDATE;如果 has_principal_user_id 为 true,则设置为 USER_UNCATEGORIZED;否则设置为 GENERIC_EVENT
product_event metadata.product_event_type 直接复制值
观察者 observer.hostname 如果观察者不是 IP,则进行设置
观察者 observer.ip 如果观察者是 IP,则合并
主账号 主账号 已重命名
sdomain principal.administrative_domain 直接复制值
domain_name principal.domain.name 直接复制值
节点 principal.hostname 直接复制值
cwd、exe principal.process.file.full_path 如果不为空,则设置为 cwd;否则,如果不为空,则设置为 exe
ppid principal.process.parent_process.pid 直接复制值
pid principal.process.pid 直接复制值
uid、gid、euid、suid、fsuid、egid、sgid、fsgid、comm、subj、key、arch、name、ouid、ogid、inode、cap_fp、cap_fi、cap_fe、mode、proctitle principal.resource.attribute.labels 如果字段不为空,则与相应标签合并
用户 principal.user.email_addresses 如果用户与电子邮件地址模式匹配,则合并
用户 principal.user.user_display_name 设置用户是否与电子邮件地址格式不匹配
suser、user_id、auid principal.user.userid 如果不为空,则设置为 suser;否则,如果 user 不为空且 grok 成功,则设置为 user_id;否则,如果不为空,则设置为 auid
security_result security_result 已合并
description、status security_result.action 如果说明与“成功”“已登录”或“状态为 GRANTED”匹配,则设置为 ALLOW;否则,如果说明与“错误”匹配,则设置为 BLOCK
和程度上减少 security_result.severity 如果严重程度与 (?i)(low|Unknown|info) 匹配,则设置为 LOW
摘要 security_result.summary 直接复制值
目标 目标 已重命名
主机名、服务器、src_ip target.hostname 如果主机名不为空,则设置为主机名;否则,如果服务器不为空,则设置为服务器;否则,如果 src_ip 不是 IP,则设置为 src_ip
src_ip target.ip 如果 src_ip 是 IP,则合并
产品 metadata.product_name 直接复制值
vendor metadata.vendor_name 直接复制值

更新日志

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

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