收集 Imperva Database 日志

支持的平台:

本文档介绍了如何使用 Bindplane 将 Imperva 数据库日志注入到 Google Security Operations。解析器首先尝试从各种结构化日志格式(例如 CEF、LEEF 和 JSON)中提取字段。如果未找到这些格式,它会使用 grok 模式从非结构化 syslog 消息中提取字段,最终将提取的数据映射到统一数据模型 (UDM)。Imperva Database Security 提供全面的数据库活动监控、审核和保护功能。

准备工作

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

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

获取 Google SecOps 注入身份验证文件

  1. 登录 Google SecOps 控制台。
  2. 依次前往 SIEM 设置 > 收集代理
  3. 下载注入身份验证文件。将文件安全地保存在将要安装 Bindplane 的系统上。

获取 Google SecOps 客户 ID

  1. 登录 Google SecOps 控制台。
  2. 依次前往 SIEM 设置 > 个人资料
  3. 复制并保存组织详细信息部分中的客户 ID

安装 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 代理以注入 Syslog 并将其发送到 Google SecOps

  1. 访问配置文件:

    1. 找到 config.yaml 文件。通常,它位于 Linux 上的 /etc/bindplane-agent/ 目录中,或位于 Windows 上的安装目录中。
    2. 使用文本编辑器(例如 nanovi 或记事本)打开该文件。
  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:
        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:
    
    service:
      pipelines:
        logs/source0__chronicle_w_labels-0:
          receivers:
            - udplog
          exporters:
            - chronicle/chronicle_w_labels
    
    • 根据基础架构的需要替换端口和 IP 地址。
    • <customer_id> 替换为实际的客户 ID。
    • /path/to/ingestion-authentication-file.json 更新为获取 Google SecOps 提取身份验证文件部分中保存身份验证文件的路径。

重启 Bindplane 代理以应用更改

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

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

    net stop BindPlaneAgent && net start BindPlaneAgent
    

在 Imperva 数据库上配置 Syslog 转发

  1. 登录 Imperva SecureSphere 管理控制台
  2. 依次前往配置 > 操作集
  3. 点击添加以创建新的操作集或修改现有操作集。
  4. 点击添加操作,然后提供以下配置详细信息:
    • 名称:输入一个描述性名称(例如 Google SecOps Syslog)。
    • 操作类型:选择 GW Syslog
    • 主机:输入 BindPlane 代理 IP 地址。
    • 端口:输入 BindPlane 代理端口号(默认值为 514)。
    • 协议:根据您的 BindPlane Agent 配置,选择 UDPTCP
    • Syslog 日志级别:选择 DEBUG 可进行全面的日志记录。
    • Syslog Facility:选择 LOCAL0 或适当的 facility。
    • 操作界面:选择 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 字段的值
bind-variables additional.fields.bind_variables_label.value.string_value 原始日志中 bind-variables 字段的值
类别 security_result.category_details 原始日志中 category 字段的值
COMMAND target.process.command_line 如果 exe 不为空,则将原始日志中的 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-nameschema-name 字段,并将它们分别映射到 UDM 中的 DB Name_{index}Schema Name_{index},其中 index 是对象在数组中的索引。
db-user principal.user.userid 如果 db-user 不为空,则将原始日志中的 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 不为空,且 srcIPdstIP 不为空,则将 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。否则,将原始日志中的 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 字段的值
服务器组 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
user-authenticated 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 不为空,且 srcIPdstIP 不为空,则硬编码为“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

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