收集 Ubika WAF 日志

支持的语言:

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

Ubika WAF(以前称为 DenyAll)是一种 Web 应用防火墙,可为本地 Web 应用和服务提供 HTTP 流量检查、机器人防护和 API 安全性。

准备工作

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

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

获取 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
    

    该服务应显示为正在运行。

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 /opt/observiq-otel-collector/config.yaml
    
  • Windows:

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

修改配置文件

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

    receivers:
      tcplog:
        listen_address: "0.0.0.0:514"
    
    exporters:
      chronicle/ubika_waf:
        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: UBIKA_WAF
        raw_log_field: body
    
    service:
      pipelines:
        logs/ubika_waf_to_chronicle:
          receivers:
            - tcplog
          exporters:
            - chronicle/ubika_waf
    

配置参数

替换以下占位符:

  • 接收器配置:

    • 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/ubika_waf:
        compression: gzip
        creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json'
        customer_id: '<customer_id>'
        endpoint: malachiteingestion-pa.googleapis.com
        log_type: UBIKA_WAF
        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"
        

配置 Ubika WAF syslog 转发

  1. 登录 Ubika WAF 管理控制台。
  2. 依次前往管理 > 日志 > Syslog 配置。
  3. 点击添加以创建新的 syslog 目标位置。
  4. 提供以下配置详细信息:
    • Syslog 服务器:输入 Bindplane 代理主机 IP 地址。
    • 端口:输入 514。
    • 协议:选择 TCP。
    • 格式:选择默认的 syslog 格式。
  5. 选择要转发的日志类型:
    • 安全提醒日志
    • 访问日志
    • 审核日志
    • 系统事件日志
  6. 点击保存以应用配置。
  7. 通过检查 Bindplane 代理日志,验证日志是否正在发送。

UDM 映射表

日志字段 UDM 映射 逻辑
sqliFingerprint_label、eaNewRulesWarningMode_label、eaTotalScore_label、matching_part_key_label、matching_part_key_match_label、partKeyOperator_label、partKeyPattern_label、partValue_label、partValueMatch_label、partValueOperator_label、partValuePatternName_label、partValuePatternUid_label、partValuePatternVersion_label、scoringlistRuleId_label、scoringlistRuleWeight_label、ConfigurationUid_list、Matched_Rule_ID_list additional.fields 与来自 eventt.tokens.sqliFingerprint、eventt.tokens.eaNewRulesWarningMode、eventt.tokens.eaTotalScore、matchingPart.partKey、matchingPart.partKeyMatch、matchingPart.partKeyOperator、matchingPart.partKeyPattern、matchingPart.partValue、matchingPart.partValueMatch、matchingPart.partValueOperator、matchingPart.partValuePatternName、matchingPart.partValuePatternUid、matchingPart.partValuePatternVersion、matchingPart.scoringlistRuleId、matchingPart.scoringlistRuleWeight、eventt.tokens.securityExceptionConfigurationUids、eventt.tokens.securityExceptionMatchedRuleUids 的标签合并
context.applianceName intermediary.application 直接从 context.applianceName 复制的值
inter_ip intermediary.asset.ip 从 inter_ip 合并(如果为 IP,则派生自 context.backendHost)
context.backendHost intermediary.hostname 如果不是 IP,则从 context.backendHost 设置
inter_ip intermediary.ip 从 inter_ip(如果为 IP,则派生自 context.backendHost)设置
context.applianceUid intermediary.file.sha1 直接从 context.applianceUid 复制的值
has_principal、has_target、has_network、has_principal_user、has_target_resource metadata.event_type 如果具有 has_principal、has_target、has_network,则设置为“NETWORK_HTTP”;如果具有 has_principal、has_principal_user,则设置为“USER_COMMUNICATION”;如果具有 has_principal,则设置为“STATUS_UPDATE”;如果具有 has_target_resource,则设置为“USER_RESOURCE_ACCESS”;否则设置为“GENERIC_EVENT”
tokens.eventType、type、eventt.tokens.eventType、eventData.tokens.eventType metadata.product_event_type 如果已设置,则为 tokens.eventType 中的值;否则为 type;否则为 eventt.tokens.eventType;否则为 eventData.tokens.eventType
eventUid, logAlertUid, eventt.eventUid, tempData.uid, eventData.eventUid metadata.product_log_id 如果设置了 eventUid,则取 eventUid 的值,否则取 logAlertUid 的值,否则取 eventt.eventUid 的值,否则取 tempData.uid 的值,否则取 eventData.eventUid 的值
metadata.product_name 设置为“UBIKA_WAF”
metadata.vendor_name 设置为“UBIKA_WAF”
uri_protocol, request.protocol network.application_protocol 如果 uri_protocol == "HTTP" 或 request.protocol == "HTTP",则设置为“HTTP”
uri_method、request.method network.http.method 如果设置了 uri_method,则为 uri_method 中的值;否则为 request.method
uri_path、request.path、header.value network.http.referral_url 如果已设置,则为 uri_path 中的值;否则为 request.path;否则为标头值(如果为 Referer)
uri_res_code network.http.response_code 从 uri_res_code 转换为整数
user_agent, header.value network.http.user_agent 如果设置了 user_agent,则为 user_agent 的值;如果设置了 User-Agent,则为 header.value
target_hostname、header.value、request.hostname、tempData.request.hostname principal.asset.hostname 如果设置了 target_hostname,则为 target_hostname 的值;如果 Host 存在且不是 IP,则为 header.value;如果不是 IP,则为 request.hostname;否则为 tempData.request.hostname
src_ip、request.ipSrc、source_ip principal.asset.ip 从 src_ip、request.ipSrc、source_ip(如果为主机和 IP,则从 header.value)合并
target_hostname、header.value、request.hostname、tempData.request.hostname principal.hostname 如果已设置,则为 target_hostname 中的值;否则,如果为 Host 且不是 IP,则为 header.value;否则,如果不是 IP,则为 request.hostname;否则,为 tempData.request.hostname
src_ip、request.ipSrc、source_ip principal.ip 从 src_ip、request.ipSrc、source_ip(如果为主机和 IP,则从 header.value)合并
src_port, header.value principal.port src_port 中的值(如果已设置),否则为 header.value(如果为 X-Forwarded-Port),转换为整数
request.requestUid, tempData.request.requestUid principal.user.userid 如果已设置,则为 request.requestUid 中的值;否则为 tempData.request.requestUid
cookie_label、header_label、reverseProxyName_label、reverseProxyUid_label、tunnelName_label、tunnelUid_label、workflowName_label、workflowUid_label security_result.about.resource.attribute.labels 已与来自 request.cookies、request.headers、context.reverseProxyName、context.reverseProxyUid、context.tunnelName、context.tunnelUid、context.workflowName、context.workflowUid 的标签合并
vlan_label, riskLevel_label, riskLevelOWASP_label, logAlertUid_label, engine_name_label, resolveType_label, part_label, cwe_label, icxPolicyName_label, icxPolicyUid_label, icxRuleName_label, icxRuleUid_label, eaPolicyName_label, eaPolicyUid_label, eaRuleId_label, eaStaticPolicyUid_label, tag_label, geoipCode_label, geoipName_label, appliance_id_label, backendHost_label, reverseProxyName_label, reverseProxyUid_label, tunnelName_label, tunnelUid_label, workflowName_label, workflowUid_label, reason_label, timestampImport_label, matching_cwe_label, matching_part_label, match_riskLevel_label, match_riskLevelOWASP_label, partValue_label, partValueMatch_label security_result.detection_fields 与以下各项中的标签合并:vlan、tokens.riskLevel、tokens.riskLevelOWASP、logAlertUid、eventt.tokens.engineName、eventt.tokens.resolveType、eventt.tokens.part、eventt.tokens.cwe、eventt.tokens.icxPolicyName、eventt.tokens.icxPolicyUid、eventt.tokens.icxRuleName、eventt.tokens.icxRuleUid、eventt.tokens.eaPolicyName、eventt.tokens.eaPolicyUid、eventt.tokens.eaRuleId、eventt.tokens.eaStaticPolicyUid、tempData.context.tags、tempData.context.geoipCode、tempData.context.geoipName、tempData.context.applianceUid、tempData.context.backendHost、tempData.context.reverseProxyName、tempData.context.reverseProxyUid、tempData.context.tunnelName、tempData.context.tunnelUid、tempData.context.workflowName、tempData.context.workflowUid、eventt.tokens.reason、tempData.timestampImport、matchingPart.cwe、matchingPart.part、matchingPart.riskLevel、matchingPart.riskLevelOWASP、matchingPart.partValue、matchingPart.partValueMatch
desc, tokens.customMessage, eventt.tokens.customMessage, eventData.tokens.customMessage security_result.description 如果已设置,则为 desc 中的值,否则为 tokens.customMessage,否则为 eventt.tokens.customMessage,否则为 eventData.tokens.customMessage
tokens.severity, eventt.tokens.severity, severity_level security_result.severity 如果严重级别为 1-3,则设置为 INFORMATIONAL;如果严重级别为 4-5,则设置为 CRITICAL;如果严重级别为 6-7,则设置为 MEDIUM;否则设置为 UNKNOWN_SEVERITY
tokens.reason, eventt.tokens.reason, eventData.tokens.reason security_result.summary 如果已设置,则为 tokens.reason 中的值;否则为 eventt.tokens.reason;否则为 eventData.tokens.reason
tokens.attackFamily, eventt.tokens.attackFamily, eventData.tokens.attackFamily security_result.threat_name 如果已设置,则为来自 tokens.attackFamily 的值;否则为 eventt.tokens.attackFamily;否则为 eventData.tokens.attackFamily
source_ip src.ip 根据 source_ip 设置(如果同时存在主机和 IP,则根据 header.value 设置)
target_hostname target.asset.hostname 直接从 target_hostname 复制的值
request.ipDst, target_ip_label target.asset.ip 已从 request.ipDst、target_ip_label 合并
tempData.request.path target.file.full_path 直接从 tempData.request.path 复制的值
target_hostname、header.value target.hostname target_hostname 中的值(如果已设置),否则为 header.value(如果为 Host)
request.ipDst, target_ip_label target.ip 从 request.ipDst、target_ip_label 合并
target_port、request.portDst、context.backendPort、tempData.request.portDst、tempData.context.backendPort target.port 如果已设置,则为 target_port 中的值;否则为 request.portDst;否则为 context.backendPort;否则为 tempData.request.portDst;否则为 tempData.context.backendPort,转换为整数
engineUid_label, engine_name_label, cwe_label, resolveType_label, part_label, matching_cwe_label, matching_part_label, match_riskLevel_label, match_riskLevelOWASP_label, matching_part_key_label, matching_part_key_match_label, partKeyOperator_label, partKeyPattern_label, partValue_label, partValueMatch_label, partValueOperator_label, partValuePatternName_label, partValuePatternUid_label, partValuePatternVersion_label, scoringlistRuleId_label, scoringlistRuleWeight_label target.resource.attribute.labels 已与以下字段中的标签合并:tokens.engineUid、tokens.engineName、tokens.cwe、tokens.resolveType、tokens.part、eventData.tokens.engineUid、eventData.tokens.engineName、eventData.tokens.cwe、eventData.tokens.resolveType、eventData.tokens.part、matchingPart.cwe、matchingPart.part、matchingPart.riskLevel、matchingPart.riskLevelOWASP、matchingPart.partKey、matchingPart.partKeyMatch、matchingPart.partKeyOperator、matchingPart.partKeyPattern、matchingPart.partValue、matchingPart.partValueMatch、matchingPart.partValueOperator、matchingPart.partValuePatternName、matchingPart.partValuePatternUid、matchingPart.partValuePatternVersion、matchingPart.scoringlistRuleId、matchingPart.scoringlistRuleWeight
target_path target.url 直接从 target_path 复制的值
headers.value event.idm.read_only_udm.security_result.about.resource.attribute.labels 从更新日志映射
key event.idm.read_only_udm.security_result.about.resource.attribute.labels 从更新日志映射
X-Forwarded-Host event.idm.read_only_udm.security_result.about.resource.attribute.labels 从更新日志映射
tokens.ipReputationIp event.idm.read_only_udm.principal.ip 从更新日志映射
tokens.ipReputationIp event.idm.read_only_udm.principal.asset.ip 从更新日志映射
tokens.matchingParts event.idm.read_only_udm.additional.fields 从更新日志映射
request.body event.idm.read_only_udm.additional.fields 从更新日志映射
unique_id1 event.idm.read_only_udm.additional.fields 从更新日志映射
thread_id event.idm.read_only_udm.additional.fields 从更新日志映射
tokens.ipReputationScore event.idm.read_only_udm.additional.fields 从更新日志映射
tokens.eaTotalScore event.idm.read_only_udm.additional.fields 从更新日志映射
tokens.eaPolicyUid event.idm.read_only_udm.additional.fields 从更新日志映射
tokens.eaPolicyName event.idm.read_only_udm.additional.fields 从更新日志映射
tokens.eaStaticPolicyUid event.idm.read_only_udm.additional.fields 从更新日志映射
tokens.eaRuleId event.idm.read_only_udm.additional.fields 从更新日志映射
tokens.eaNewRulesWarningMode event.idm.read_only_udm.additional.fields 从更新日志映射
internal_timestamp event.idm.read_only_udm.additional.fields 从更新日志映射
tokens.securityExceptionConfigurationUid event.idm.read_only_udm.additional.fields 从更新日志映射
tokens.icxPolicyName event.idm.read_only_udm.security_result.detection_fields 从更新日志映射
tokens.icxPolicyUid event.idm.read_only_udm.security_result.detection_fields 从更新日志映射
tokens.icxRuleName event.idm.read_only_udm.security_result.detection_fields 从更新日志映射
tokens.icxRuleUid event.idm.read_only_udm.security_result.detection_fields 从更新日志映射
tokens.ipReputationThreats event.idm.read_only_udm.security_result.detection_fields 从更新日志映射
message_component event.idm.read_only_udm.target.resource.attribute.labels 从更新日志映射

更新日志

查看此解析器的更新日志

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