收集 ForgeRock OpenAM 日志

解析器版本:4.0

支持的语言:

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

ForgeRock OpenAM 是一种身份和访问管理解决方案,可针对身份验证事件、访问权限控制决策、会话活动和配置更改生成 syslog 消息。解析器会从 JSON 格式的审核日志中提取字段,并将其映射到统一数据模型 (UDM)。

准备工作

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

  • Google SecOps 实例
  • Windows Server 2016 或更高版本,或者具有 systemd 的 Linux 主机
  • Bindplane 代理与 ForgeRock OpenAM 服务器之间的网络连接
  • 如果在代理后面运行,请确保按照 Bindplane 代理要求打开防火墙端口
  • 管理员对 AM 控制台的访问权限(例如 amAdmin)

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

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

    sc query observiq-otel-collector
    

    该服务应显示为 RUNNING。

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
    

    该服务应显示为 active (running)。

其他安装资源

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

配置 Bindplane 代理以注入 Syslog 并发送到 Google SecOps

找到配置文件

  • Linux:

    sudo nano /opt/observiq-otel-collector/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/openam:
        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
        creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json'
        customer_id: '<customer_id>'
        endpoint: chronicle.googleapis.com
        log_type: OPENAM
        raw_log_field: body
    
    service:
      pipelines:
        logs/openam_to_chronicle:
          receivers:
            - udplog
          exporters:
            - chronicle/openam
    

配置参数

替换以下占位符:

  • 接收器配置:

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

    • creds_file_path:服务账号 JSON 密钥文件的完整路径(选项 1):
      • Linux:/opt/observiq-otel-collector/ingestion-auth.json
      • Windows:C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
    • customer_id:从 Google SecOps 控制台复制的客户 ID
    • location:将 <LOCATION> 替换为 Google SecOps 实例的区域(例如 us、europe 或 asia-southeast1)。导出器会使用此值作为 chronicle.googleapis.com 的前缀。如需查看完整列表,请参阅区域级端点。
    • project:将 <PROJECT_NUMBER> 替换为“IAM 和管理”>“设置”中的项目编号。
    • endpoint:保持设置为 chronicle.googleapis.com。

旧版提取 API

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

    exporters:
      chronicle/openam:
        compression: gzip
        creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json'
        customer_id: '<customer_id>'
        endpoint: malachiteingestion-pa.googleapis.com
        log_type: OPENAM
        raw_log_field: body
    

保存配置文件

  • 修改后,保存文件:
    • Linux:依次按 Ctrl+O、Enter 和 Ctrl+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"
        

为 ForgeRock OpenAM 配置 syslog 处理程序

  1. 以管理员(例如 amAdmin)身份登录 AM 控制台。
  2. 如需在全局配置中创建事件处理脚本,请依次前往配置 > 全局服务 > 审核日志记录。
    • 如需在 Realm 中创建事件处理脚本,请依次前往 Realms > Realm Name > Services > Audit Logging。
  3. 依次点击添加辅助配置 > Syslog。
  4. 提供以下配置详细信息:
    • 名称:输入事件处理脚本的名称(例如 Syslog Event Handler)。
    • 服务器主机名:输入 Bindplane 代理 IP 地址。
    • 服务器端口:输入 Bindplane 代理端口号(例如,UDP 为 514)。
    • 传输协议:选择 UDP。
    • 连接超时:输入连接所需的秒数(例如 120)。
    • 可选:启用缓冲选项。
  5. 点击创建。
  6. 在常规处理程序配置标签页上,选择已启用以激活事件处理脚本。
  7. 选择审核日志的主题:
    • 访问
    • 活动
    • 身份验证
    • 配置
  8. 点击保存。
  9. 在 Syslog 配置标签页中,提供以下配置详细信息:
    • 服务器主机名:输入 Bindplane IP 地址。
    • 服务器端口:输入 Bindplane 端口号。
    • 连接超时:输入连接所需的秒数(例如 120)。
    • 传输协议:选择 UDP。
    • 设备:选择 Local0。
    • 所有主题都将严重程度设置为信息。
  10. 点击保存。
  11. 在缓冲标签页上,选择已启用缓冲将其激活。
  12. 点击保存。

UDM 映射表

日志字段 UDM 映射 逻辑
client.ip principal.ip 发出请求的客户端的 IP 地址。
client.ip principal.asset.ip 发出请求的客户端资产的 IP 地址。
client.port principal.port 发出请求的客户端使用的端口。
entries[0].info.authLevel principal.resource.resource_subtype 与事件关联的身份验证级别。带有“authLevel:”前缀。
entries[0].info.displayName security_result.description 身份验证树中节点的描述性名称。
entries[0].info.ipAddress principal.asset.ip 与事件中的主账号关联的 IP 地址。
entries[0].info.ipAddress principal.ip 与事件中的主账号关联的 IP 地址。
entries[0].info.nodeId principal.resource.id 身份验证树中节点的唯一标识符。以“nodeId:”为前缀。
entries[0].info.nodeOutcome principal.resource.attribute.labels.value 身份验证树中节点的结果。
entries[0].info.nodeType principal.resource.type 身份验证树中节点的类型。前缀为“nodeType:”。
entries[0].info.treeName principal.resource.name 身份验证树的名称。以“treeName:”为前缀。
eventName metadata.product_event_type OpenAM 日志中的原始事件名称。
http.request.headers.host[0] target.asset.hostname 目标服务器的主机名,从 host 标头中提取。
http.request.headers.host[0] target.hostname 目标服务器的主机名,从 host 标头中提取。
http.request.headers.user-agent[0] network.http.user_agent HTTP 请求的用户代理。
http.request.method network.http.method 请求中使用的 HTTP 方法。
http.request.path target.url HTTP 请求网址的路径。
info.failureReason security_result.summary 身份验证失败的原因。硬编码为“SSO”。由基于 eventName 和其他字段的逻辑确定。可以是 GENERIC_EVENT、USER_LOGIN、USER_LOGOUT、NETWORK_HTTP 或 STATUS_UPDATE。硬编码为“OPENAM”。硬编码为“OpenAM”。硬编码为“ForgeRock”。
principal target.user.userid 事件中涉及的用户 ID,从 userId、principal 或 runAs 字段中提取。
result security_result.action_details 事件的结果(例如“SUCCESSFUL”“FAILED”)。
response.detail.reason security_result.summary 访问结果事件失败的原因。
response.status security_result.action_details 访问结果事件中响应的状态。
runAs target.user.userid 事件中涉及的用户 ID,从 userId、principal 或 runAs 字段中提取。
security_result.action security_result.action 因安全性事件而采取的操作(例如“ALLOW”“BLOCK”)。
server.ip target.asset.ip 目标服务器的 IP 地址。
server.ip target.ip 目标服务器的 IP 地址。
server.port target.port 目标服务器的端口。
timestamp metadata.event_timestamp 事件的时间戳。
trackingIds metadata.product_log_id 与相应事件关联的跟踪 ID。
transactionId metadata.product_deployment_id 与相应事件关联的交易 ID。
userId target.user.userid 事件中涉及的用户 ID,从 userId、principal 或 runAs 字段中提取。
userId target.user.group_identifiers 与用户关联的群组标识符。
am_group target.user.group_identifiers 与用户关联的群组标识符。
am_user target.user.email_addresses 用户的邮箱(如果存在于 am_user 字段中)。
loginID[0] target.user.userid 事件中使用的登录 ID。
loginID[0] target.user.email_addresses 用于登录的电子邮件地址(如果 loginID 字段中存在)。
hostip intermediary.hostname 中间设备的主机名。
hostip intermediary.ip 中间设备的 IP 地址。
src_ip principal.asset.ip 来源 IP 地址。
src_ip principal.ip 来源 IP 地址。
desc metadata.description 活动的说明。
payload metadata.description 事件的载荷。
http.request.headers.host.0 tatget.hostname 从更新日志映射
http.request.headers.user-agent.0 network.http.user_agent 从更新日志映射
extensions.auth.type SSO 从更新日志映射

更新日志

查看此解析器的更新日志

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