收集 Imperva CEF 日志

支持:

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

解析器会从 CEF(通用事件格式)中的 Imperva syslog 格式日志中提取字段。它使用 grok 和/或 kv 来解析 CEF 消息,然后将这些值映射到统一数据模型 (UDM)。它还会为事件来源和类型设置默认元数据值。

准备工作

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

  • Google SecOps 实例
  • 搭载 systemd 的 Windows 2016 或更高版本或 Linux 主机
  • 如果通过代理运行,请确保防火墙端口根据 Bindplane 代理要求处于打开状态
  • 对 Imperva 管理控制台或设备具有特权访问权限

获取 Bindplane 代理的 Google SecOps 凭据

如需向 Google SecOps 验证 Bindplane 代理的身份,请选择以下方法之一:

  • 新部署:使用 Chronicle API(方法 1)。
  • 旧版部署:继续使用注入身份验证文件(方法 2),直到注入 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
    

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
    

其他安装资源

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

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

  1. 访问配置文件:

    • 找到 config.yaml 文件。通常,该文件位于 Linux 上的 /opt/observiq-otel-collector/ 目录或 Windows 上的安装目录中。
    • 使用文本编辑器(例如 nano、vi 或记事本)打开该文件。
  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:
        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
        # 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: chronicle.googleapis.com
        # Add optional ingestion labels for better organization
        log_type: 'IMPERVA_CEF'
        raw_log_field: body
        ingestion_labels:
    
    service:
      pipelines:
        logs/source0__chronicle_w_labels-0:
          receivers:
            - udplog
          exporters:
            - chronicle/chronicle_w_labels
    
    • 根据基础架构中的需要替换端口和 IP 地址。
    • 将 <LOCATION> 替换为 Google SecOps 实例的区域(例如 us、europe 或 asia-southeast1)。导出器会使用此值为 chronicle.googleapis.com 添加前缀。
    • 将 <PROJECT_NUMBER> 替换为 IAM 和管理 > 设置 中的项目编号。
    • 将 <CUSTOMER_ID> 替换为实际的客户 ID。
    • 将 /path/to/ingestion-authentication-file.json 更新为在第 1 步中保存服务帐号密钥文件(方法 1)的文件路径。

旧版注入 API 导出器

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

    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: 'IMPERVA_CEF'
        raw_log_field: body
        ingestion_labels:
    

重启 Bindplane 代理以应用更改

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

    sudo systemctl restart observiq-otel-collector
    
  2. 如需在 Windows 中重启 Bindplane 代理,您可以使用服务 控制台,也可以输入以下命令:

    net stop observiq-otel-collector && net start observiq-otel-collector
    

配置 Imperva WAF 网关 (SecureSphere) 以通过 syslog 发送 CEF

  1. 在 MX 控制台中,创建一个操作集:

    • 依次前往政策 > 操作集。
    • 点击新建 并为其命名(例如 Google SecOps CEF)。
  2. 添加 CEF syslog 操作接口:

    • 在可用操作接口 中,打开系统日志 并添加以下一项或多项(根据需要):
      • 使用 CEF 标准将安全性事件记录到系统日志 (syslog)
      • 使用 CEF 标准将网络安全性事件记录到系统日志 (syslog)
      • 使用 CEF 标准将系统事件记录到系统日志 (syslog)
      • 使用 CEF 标准将自定义安全性事件记录到系统日志 (syslog)
  3. 配置操作接口参数:

    • Syslog 主机:输入 Bindplane 代理 IP 地址。如需使用非默认端口,请附加 :PORT(如果您未指定端口,则默认值为 514)。示例:10.0.0.10:514。
    • 设施 / 日志级别:根据您的政策要求进行设置。
    • 消息:除非您有自定义映射,否则请保留 CEF 的供应商默认值。
  4. 将操作集附加到政策:

    • 对于安全 / 网络安全 事件:打开相关政策,并将后续操作 设置为您的操作集。
    • 对于系统事件 :创建或验证系统事件 政策,并将后续操作 设置为您的操作集,以便这些事件也通过 CEF 发送。
  5. (可选)配置网关专用目标:

    • 如果不同的网关组必须发送到不同的 syslog 服务器,请配置每个 网关组 > 外部记录器 ,并在政策中启用 “使用网关配置(如果存在)” 。

UDM 映射表

日志字段 UDM 映射 逻辑
act security_result.action 派生。如果 act 为“allowed”“alert”,以“REQ_PASSED”开头或以“REQ_CACHED”开头,则 action 为“ALLOW”。如果 act 为“deny”“blocked”,以“REQ_BLOCKED”开头或以“REQ_CHALLENGE”开头,则 action 为“BLOCK”。如果 act 与正则表达式 (?i)REQ_BAD 匹配,则 action 为 "FAIL"。否则,action 为“UNKNOWN_ACTION”。security_result.action 然后将设置为 action 的值。
act security_result.action_details 派生。系统会根据 act 的值生成详细说明。示例:“REQ_CACHED_FRESH:响应是从数据中心的缓存返回的”“REQ_BLOCKED:请求被屏蔽”。
app network.application_protocol 转换为大写后直接映射。
cs1 security_result.detection_fields.value 如果 cs1 不为空或“NA”,则有条件地映射。 security_result.detection_fields.key 设置为 cs1Label 的值。
cs1Label security_result.detection_fields.key 如果 cs1 不为空或“NA”,则有条件地映射。security_result.detection_fields.value 设置为 cs1 的值。
cs2 security_result.detection_fields.value 如果不为空,则有条件地映射。security_result.detection_fields.key 设置为 cs2Label 的值。
cs2Label security_result.detection_fields.key 如果 cs2 不为空,则有条件地映射。security_result.detection_fields.value 设置为 cs2 的值。
cs3 security_result.detection_fields.value 如果不为空或“-”,则有条件地映射。security_result.detection_fields.key 设置为 cs3Label 的值。
cs3Label security_result.detection_fields.key 如果 cs3 不为空或“-”,则有条件地映射。security_result.detection_fields.value 设置为 cs3 的值。
cs4 security_result.detection_fields.value 如果不为空,则有条件地映射。security_result.detection_fields.key 设置为 cs4Label 的值。
cs4Label security_result.detection_fields.key 如果 cs4 不为空,则有条件地映射。security_result.detection_fields.value 设置为 cs4 的值。
cs5 security_result.detection_fields.value 如果不为空,则有条件地映射。security_result.detection_fields.key 设置为 cs5Label 的值。
cs5Label security_result.detection_fields.key 如果 cs5 不为空,则有条件地映射。security_result.detection_fields.value 设置为 cs5 的值。
cs6 security_result.detection_fields.value 如果不为空,则有条件地映射。security_result.detection_fields.key 设置为 cs6Label 的值。
cs6Label security_result.detection_fields.key 如果 cs6 不为空,则有条件地映射。security_result.detection_fields.value 设置为 cs6 的值。
cs7 principal.location.region_latitude 如果 cs7Label 为“latitude”,则有条件地映射。
cs8 principal.location.region_longitude 如果 cs8Label 为“longitude”,则有条件地映射。
cn1 security_result.detection_fields.value 如果不为空且 cn1Label 不为空,则有条件地映射。security_result.detection_fields.key 设置为 cn1Label 的值。
cn1Label security_result.detection_fields.key 如果 cn1 和 cn1Label 不为空,则有条件地映射。security_result.detection_fields.value 设置为 cn1 的值。
fileType security_result.detection_fields.value 如果不为空,则有条件地映射。security_result.detection_fields.key 设置为“fileType”。
filePermission security_result.detection_fields.value 如果不为空,则有条件地映射。security_result.detection_fields.key 设置为“filePermission”。
request target.url 直接映射。
requestClientApplication network.http.user_agent 如果不为空,则有条件地映射。覆盖从 CEF 载荷中的 requestContext 或 requestClientApplication 键值对提取的 user_agent 字段映射的值。
requestMethod network.http.method 直接映射。
siteid security_result.detection_fields.value 如果不为空,则有条件地映射。security_result.detection_fields.key 设置为“siteid”。
sourceServiceName target.hostname 直接映射。覆盖 dhost 的值(如果存在)。
src principal.ip 直接映射。
start metadata.event_timestamp.seconds 使用 grok 模式提取并转换为时间戳。如果 deviceReceiptTime 不存在,则用作其回退。 如果 deviceReceiptTime 和 start 都为空,则使用日志时间戳。
suid principal.user.userid 如果不为空,则有条件地映射。
不适用 metadata.event_type 硬编码为“NETWORK_HTTP”。
不适用 metadata.log_type 直接从顶级 log_type 字段映射。
不适用 metadata.product_event_type 如果 csv.event_id 不为空,则从中映射。
不适用 metadata.product_name 硬编码为“Web 应用防火墙”。
不适用 metadata.vendor_name 硬编码为“Imperva”。
kv.act event.idm.read_only_udm.security_result.action_details 从变更日志映射
kv.sourceServiceName event.idm.read_only_udm.target.resource.name 从变更日志映射
cicode event.idm.read_only_udm.principal.location.city 从变更日志映射
ccode event.idm.read_only_udm.principal.location.country_or_region 从变更日志映射
Customer event.idm.read_only_udm.network.organization_name 从变更日志映射
tls_cipher event.idm.read_only_udm.network.tls.cipher 从变更日志映射
cpt event.idm.read_only_udm.target.port 从变更日志映射
fileId event.idm.read_only_udm.target.resource.product_object_id 从变更日志映射
dproc event.idm.read_only_udm.security_result.category_details 从变更日志映射
deviceFacility event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
deviceExternalId event.idm.read_only_udm.security_result.detection_fields 从变更日志映射
end event.idm.read_only_udm.metadata.collected_timestamp 从变更日志映射

更新日志

查看此解析器的更新日志

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