收集 Imperva Database 日志

支持:

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

解析器从 Imperva Database syslog 格式的日志中提取字段。它使用 grok 和/或 kv 来解析日志消息,然后将这些值映射到统一数据模型 (UDM)。它还会为事件来源和类型设置默认元数据值。Imperva Database Security 提供全面的数据库活动监控、审核和保护功能。

准备工作

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

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

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

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_DB'
        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_DB'
        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 Database 上配置 Syslog 转发

  1. 登录 Imperva SecureSphere 管理控制台。
  2. 依次前往配置 > 操作集。
  3. 点击添加以创建新的操作集或修改现有操作集。
  4. 点击添加操作,然后提供以下配置详细信息:
    • 名称:输入一个描述性名称(例如 Google SecOps Syslog)。
    • Action Type(操作类型):选择 GW Syslog。
    • 主机:输入 Bindplane 代理 IP 地址。
    • 端口:输入 Bindplane 代理端口号(默认值为 514)。
    • 协议:选择 UDP 或 TCP,具体取决于您的 Bindplane 代理配置。
    • Syslog 日志级别:选择 DEBUG 以进行全面日志记录。
    • Syslog 设施:选择 LOCAL0 或适当的设施。
    • Action Interface(操作接口):选择 Gateway Log - Security Event - System Log (syslog) - JSON format (Extended)(网关日志 - 安全性事件 - 系统日志 [syslog] - JSON 格式 [扩展])以使用 SYSLOG+JSON 格式,或选择 Gateway Log - Security Event - System Log (syslog)(网关日志 - 安全性事件 - 系统日志 [syslog])以使用标准 SYSLOG 格式。
  5. 保存操作配置。
  6. 依次前往政策 > 安全政策或政策 > 数据库审核政策。
  7. 修改相关政策,并添加包含 syslog 操作的操作集,以确保事件转发到 Google SecOps。

UDM 映射表

日志字段 UDM 映射 逻辑
acct principal.user.userid 如果 acct 为“admin”,则映射到 target.user.userid,否则映射到 principal.user.userid。在映射之前,从 acct 中移除引号和空格。
操作 security_result.action_details 原始日志中 action 字段的值
alertSev security_result.severity 如果 alertSev 为“Informative”,则映射为“INFORMATIONAL”,否则映射为 alertSev 的大写形式
应用 principal.application 如果 application 为“pam_unix(sudo:session)”或 description 包含“pam_unix”,则映射为“pam_unix”。如果 message 包含“run-parts”,则映射为“run-parts”。如果 message 包含“audispd”,则映射为“audispd”。如果 message 包含“FSS audit”,则映射为“FSS audit”。否则,映射为原始日志中的 application 字段
application-name target.application 原始日志中 application-name 字段的值
audit-policy security_result.category_details 原始日志中 audit-policy 字段的值
绑定变量 additional.fields.bind_variables_label.value.string_value 原始日志中 bind-variables 字段的值
类别 security_result.category_details 原始日志中 category 字段的值
COMMAND target.process.command_line 如果 exe 不为空,则映射为原始日志中的 exe 字段。否则,映射为原始日志中的 COMMAND 字段
createTime 未映射
db-schema-pair additional.fields.DB Name_{index}.value.string_value, additional.fields.Schema Name_{index}.value.string_value 对于原始日志中的每个 db-schema-pair 对象,提取 db-name 和 schema-name 字段,并将其分别映射到 UDM 中的 DB Name_{index} 和 Schema Name_{index},其中 index 是数组中对象的索引。
db-user principal.user.userid 如果 db-user 不为空,则映射为原始日志中的 db-user 字段。否则,如果 os-user 不为空且 db-user 为空,则映射为原始日志中的 os-user 字段
dbName target.resource.name 原始日志中 dbName 字段的值
dest-ip target.ip、target.asset.ip 原始日志中 dest-ip 字段的值
dest-port target.port 原始日志中 dest-port 字段的值
说明 metadata.description 如果 description 包含“user:”,则从 description 中提取用户 ID 并将其映射到 userid。如果 userid 不为空,且 description 包含“Invalid”或“invalid”,则将“Invalid user”替换为“Invalid”。如果 application 为“sshd”,则从 description 中移除“ from”和“ by”。否则,映射为原始日志中的 description 字段
dst target.ip、target.asset.ip 原始日志中 dst 字段的值
dstIP target.ip、target.asset.ip 原始日志中 dstIP 字段的值
dstPort target.port 原始日志中 dstPort 字段的值
event-type metadata.product_event_type 原始日志中 event-type 字段的值
eventType metadata.product_event_type、metadata.event_type 如果 eventType 不为空,且 srcIP 和 dstIP 不为空,则将 eventType 映射到 metadata.product_event_type,并将“NETWORK_CONNECTION”映射到 metadata.event_type
evntDesc security_result.description 原始日志中 evntDesc 字段的值
exe target.process.command_line 原始日志中 exe 字段的值
来自 network.email.from 从 from 中移除“<”和“>”,并将其映射到 network.email.from
群组 target.user.group_identifiers 原始日志中 group 字段的值
gw-ip intermediary.ip、intermediary.asset.ip 原始日志中 gw-ip 字段的值
主机 target.hostname、target.asset.hostname 原始日志中 host 字段的值
host-name principal.hostname、principal.asset.hostname 原始日志中 host-name 字段的值
主机名 principal.hostname、principal.asset.hostname 原始日志中 hostname 字段的值
ip target.ip、target.asset.ip 原始日志中 ip 字段的值
mx-ip intermediary.ip、intermediary.asset.ip 原始日志中 mx-ip 字段的值
objects-list additional.fields.Object_{index}.value.string_value 对于原始日志中的每个 objects-list 对象,提取该对象并将其映射到 UDM 中的 Object_{index},其中 index 是该对象在数组中的索引。
操作 about.labels.Operation.value 原始日志中 Operation 字段的值
Operation type about.labels.Operation Type.value 原始日志中 Operation type 字段的值
os-user principal.user.userid, additional.fields.OS User.value.string_value 如果 os-user 不为空且 db-user 为空,则映射为原始日志中的 os-user 字段。否则,映射为原始日志中的 OS User 字段
经过解析的搜索查询 target.process.command_line 原始日志中 Parsed Query 字段的值
parsed-query additional.fields.Parsed Query.value.string_value 原始日志中 parsed-query 字段的值
pid target.process.pid 原始日志中 pid 字段的值
policy-id security_result.detection_fields.Policy_ID_{index}.value 对于原始日志中的每个 policy-id 对象,提取相应政策并将其映射到 UDM 中的 Policy_ID_{index},其中 index 是该对象在数组中的索引。
policyName security_result.detection_fields.policyName_label.value 原始日志中 policyName 字段的值
端口 target.port 原始日志中 port 字段的值
特权 about.labels.Privileged.value 如果 Privileged 为 true,则映射为“True”,否则映射为“False”
proto network.ip_protocol 原始日志中 proto 字段的值
协议 network.ip_protocol 如果 protocol 为“TCP”或“UDP”,则映射为原始日志中的 protocol 字段
PWD target.file.full_path 原始日志中 PWD 字段的值
Raw Data target.resource.attribute.labels.raw_Data.value 原始日志中 Raw Data 字段的值
raw-query additional.fields.Raw Query.value.string_value 原始日志中 raw-query 字段的值
ruleName security_result.rule_name 原始日志中 ruleName 字段的值
server-group additional.fields.serve_group_label.value.string_value 原始日志中 server-group 字段的值
service-name additional.fields.service_name_label.value.string_value 原始日志中 service-name 字段的值
Service Type additional.fields.Service Type.value.string_value 原始日志中 Service Type 字段的值
大小 network.received_bytes 原始日志中 size 字段的值
Stored Proc about.labels.Stored_Proc.value 如果 Stored Proc 为 true,则映射为“True”,否则映射为“False”
Table Group target.group.group_display_name 原始日志中 Table Group 字段的值
时间戳 metadata.event_timestamp 原始日志中 timestamp 字段的值
至 network.email.to 从 to 中移除“<”和“>”,并将其映射到 network.email.to
用户 principal.user.userid、target.user.userid 如果 USER 不为空且 USER 为“admin”,则将原始日志中的 USER 字段映射到 target.user.userid。否则,如果 USER 不为空,则将原始日志中的 USER 字段映射到 principal.user.userid
经过用户身份验证 security_result.detection_fields.user_authenticated.value 原始日志中 user-authenticated 字段的值
user-group additional.fields.user_group_label.value.string_value 原始日志中 user-group 字段的值
用户名 principal.user.user_display_name 原始日志中 username 字段的值
usrName principal.user.userid 原始日志中 usrName 字段的值
extensions.auth.mechanism 如果 description 包含“authentication failure”“check pass; user unknown”“Invalid user”“invalid user”,或者 error 不为空,则硬编码为“USERNAME_PASSWORD”。
extensions.auth.type 如果 has_principal 为“true”,且 has_target 为“true”,且 event-type 为“Login”,则硬编码为“AUTHTYPE_UNSPECIFIED”
metadata.event_type 如果 PWD 不为空,则硬编码为“PROCESS_OPEN”。如果 message 包含“starting”或 application 为“pman”或“CROND”或“run-parts”,且 event_type 为空,则硬编码为“PROCESS_OPEN”。如果 description 是“Syslog connection established”“Syslog connection broken”或“Syslog connection failed”,则硬编码为“NETWORK_CONNECTION”。如果 application 是“postfix/qmgr”“postfix/local”或“postfix/pickup”,则硬编码为“EMAIL_UNCATEGORIZED”。如果 application 为“postfix/local”或“postfix/pickup”,且 status 为“sent (delivered to mailbox)”,则硬编码为“EMAIL_TRANSACTION”。如果 application 为“sshd”,且 description 不包含“check pass; user unknown”、description 不包含“authentication failure”,且 description 不包含“invalid”,则硬编码为“NETWORK_HTTP”。如果 description 包含“authentication failure”“check pass; user unknown”“Invalid user”“invalid user”,或者 error 不为空,则硬编码为“USER_LOGIN”。如果 file_path 不为空,则硬编码为“FILE_SYNC”。如果 message 包含“reconfigure”且 application 为“pman”,则硬编码为“PROCESS_UNCATEGORIZED”。如果 message 包含“exit code 1”且 application 为“pman”,则硬编码为“PROCESS_TERMINATION”。如果 eventType 不为空,且 srcIP 和 dstIP 不为空,则硬编码为“NETWORK_CONNECTION”。如果 has_principal 为“true”,且 has_target 为“true”,且 event-type 为“Login”,则硬编码为“USER_LOGIN”。如果 has_principal 为“true”,且 has_target 为“true”,且 protocol 不为空,则硬编码为“NETWORK_CONNECTION”。如果 has_principal 为“true”,则硬编码为“STATUS_UPDATE”。如果 event_type 为空或“GENERIC_EVENT”,则硬编码为“GENERIC_EVENT”
metadata.log_type 硬编码为“IMPERVA_DB”
metadata.product_name 硬编码为“IMPERVA DB”
metadata.vendor_name 硬编码为“IMPERVA DB”
security_result.action 如果 description 不包含“authentication failure”“check pass; user unknown”“Invalid user”“invalid user”,且 error 为空,则硬编码为“ALLOW”。如果 description 包含“authentication failure”“check pass; user unknown”“Invalid user”“invalid user”或 error 不为空,则硬编码为“BLOCK”
security_result.rule_id 如果 description 包含“alert_score”或“new_alert_score”,则从 description 中提取 ruleid 并将其映射到 security_result.rule_id
version metadata.product_version 从更新日志映射
source-ip principal.ip 从更新日志映射
source-port principal.port 从更新日志映射
server-group", "service-name", "user-group", "raw-query", "parsed-query", "bind-variables", "sql-error", "db-schema-pair.db-name", "db-schema-pair.schema-name", and "objects-list additional.fields 从更新日志映射
source-application principal.application 从更新日志映射
event-id metadata.product_log_id 从更新日志映射
application-user principal.user.user_display_name 从更新日志映射
mx-ip", "gw-ip intermediary.ip 从更新日志映射
policy-id" and "user-authenticated security_result.detection_fields 从更新日志映射
srcPort principal.port 从更新日志映射
srcIP principal.ip 从更新日志映射
event_name metadata.product_event_type 从更新日志映射

更新日志

查看此解析器的更新日志

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