收集 F5 BIG-IP ASM 日志

支持:

本文档介绍了如何使用 Bindplane 将 F5 BIG-IP Application Security Manager (ASM) 日志注入到 Google Security Operations。解析器可处理各种日志格式(syslog、CSV、CEF 等),并将其标准化为 UDM。它使用 grok 模式和键值对提取来解析字段,使用 XML 过滤来提取违规详情,使用条件逻辑进行事件分类和严重级别映射,并将提取的字段合并到 UDM 架构中。

准备工作

  • 确保您拥有 Google Security Operations 实例。
  • 确保您使用的是 Windows 2016 或更高版本,或者使用 systemd 的 Linux 主机。
  • 如果在代理后运行,请确保防火墙端口已打开。
  • 确保您拥有 F5 BIG-IP ASM 的特权访问权限。

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

  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 上的 /opt/observiq-otel-collector/ 目录中,或 Windows 上的安装目录中。
    2. 使用文本编辑器(例如 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: '/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
            ingestion_labels:
                log_type: F5_ASM
                raw_log_field: body
    
    service:
        pipelines:
            logs/source0__chronicle_w_labels-0:
                receivers:
                    - udplog
                exporters:
                    - chronicle/chronicle_w_labels
    
  3. 根据您基础设施的需要替换端口和 IP 地址。

  4. 将 <LOCATION> 替换为 Google SecOps 实例的区域(例如 us、europe 或 asia-southeast1)。导出器会使用此值作为 chronicle.googleapis.com 的前缀。

  5. 将 <PROJECT_NUMBER> 替换为 IAM 和管理 > 设置中的项目编号。

  6. 将 <customer_id> 替换为实际客户 ID。

  7. 将 /path/to/ingestion-authentication-file.json 更新为获取 Bindplane 代理的 Google SecOps 凭据部分中保存的服务账号密钥文件(选项 1)的路径。

旧版提取 API

  • 如果您使用选项 2 中的数据注入身份验证文件,请将 exporters 代码块替换为以下内容。将 creds 设置为提取身份验证文件的路径,如果您的实例位于美国境外,请将 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: '/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
            ingestion_labels:
                log_type: F5_ASM
                raw_log_field: body
    

重启 Bindplane 代理以应用更改

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

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

    net stop BindPlaneAgent && net start BindPlaneAgent
    

在 F5 BIG-IP ASM 上配置远程日志记录

  1. 登录 ASM 控制台 Web 界面。
  2. 依次前往 Security> Event Logs > Logging Profiles(安全 > 事件日志 > 日志记录配置文件)。
  3. 点击创建。
  4. 提供以下配置详细信息:

    • 配置文件名称:输入配置文件的唯一名称。
    • 选择应用安全保障。
    • 在“Application Security”(应用安全保障)标签页上,选择 Advanced(高级)(如果需要其他配置)。
    • 存储目的地:选择远程存储。
    • 日志记录格式:选择“通用事件格式 (CEF)”。
    • 清除本地存储。
    • 协议:选择 UDP 或 TCP(取决于您的 Bindplane 代理配置)。
    • 服务器地址:输入 Bindplane 代理 IP 地址。
    • 端口:默认选择 514。根据您的 Bindplane 代理配置更新端口设置。
    • 点击 Add(添加)。
    • 选择保证日志记录。
    • 选择报告检测到的异常情况。
    • Facility:选择 LOG_LOCAL6(您可以选择性地选择所记录流量的设施类别,可能的值为 LOG_LOCAL0 到 LOG_LOCAL7)。
  5. 点击 Finished。

将日志记录配置文件与安全政策相关联

  1. 依次点击本地流量> 虚拟服务器。
  2. 点击安全政策使用的虚拟服务器的名称。
  3. 在安全性菜单中,选择政策。
  4. 确保应用安全政策设置已启用,并且政策已设置为所需的安全政策。
  5. 确保将日志配置文件设置设为已启用。
  6. 从可用列表中,选择要用于安全政策的配置文件,并将其移至已选列表中。
  7. 点击更新。

UDM 映射表

日志字段 UDM 映射 逻辑
act security_result.action 如果 act 为 blocked,则映射到 BLOCK。如果 act 为 passed 或 legal,则映射到 ALLOW。如果 act 包含 alerted,则映射到 QUARANTINE。否则,对于 Splunk 格式,默认值为 ALLOW。
app network.application_protocol 如果原始日志中存在,则直接映射到 HTTPS。
attack_type security_result.category_details,metadata.description 与其他字段结合使用,以确定 security_result.category。如果没有其他说明,则该说明会成为活动说明。对于 Splunk 格式的日志,如果 violations 为空,则用于确定类别和摘要。
client_ip principal.ip,principal.asset.ip 直接映射到主 IP。
cn1 network.http.response_code 直接映射到 HTTP 响应代码。
cn2 security_result.severity_details 直接映射到安全结果严重程度详细信息。与 response_code 搭配使用,以确定事件是否为提醒。
column1 principal.ip,principal.asset.ip 映射到某些 CSV 格式日志的主 IP。
column2 target.port 映射到某些 CSV 格式日志的目标端口。
column3 target.ip,target.asset.ip 映射到特定 CSV 格式日志的目标 IP。
column4 security_result.severity 映射到某些 CSV 格式日志的安全结果严重程度。值 Information、Informational、0、4 映射到 INFORMATIONAL。Warning、1、3 映射到 MEDIUM。Error、2 映射到 ERROR。Critical、CRITICAL、critical 映射到 CRITICAL。
column7 security_result.detection_fields,network.http.response_code 包含 XML 数据。request-violations 中的 viol_name 会被提取并添加为键为 Request Violation Name_index 的检测字段。提取 response_violations 中的 viol_name,并将其添加为键为 Response Violation Name_index 的检测字段。response_violations中的response_code映射到network.http.response_code。
column8 security_result.rule_name 映射到某些 CSV 格式日志的安全结果规则名称。
cs1 security_result.rule_name 直接映射到安全结果规则名称。
cs2 security_result.summary 直接映射到安全结果摘要。
cs5 principal.ip、principal.asset.ip、additional.fields 如果 cs5 包含 JNDI LDAP 网址,则会添加一个键为 JNDI_LDAP_URL 的额外字段。否则,如果它包含以英文逗号分隔的 IP,则任何不同于 principal_ip 的 IP 都会添加为额外的主 IP。
cs6 principal.location.country_or_region 直接映射到主要营业地点所在的国家或区域。
data network.session_id、network.sent_bytes、network.tls.version 如果存在,则解析为 JSON 以提取 sessionid、bits(映射到 sent_bytes)和 version。
date_time metadata.event_timestamp 在解析并转换为正确格式后,直接映射到事件时间戳。
dest_ip target.ip,target.asset.ip 直接映射到目标 IP。
dest_port target.port 直接映射到目标端口。
dhost target.hostname 直接映射到目标主机名。
dpt target.port 直接映射到目标端口。
dst target.ip 直接映射到目标 IP。
dvc intermediary.ip 直接映射到中介 IP。
dvchost target.hostname,intermediary.hostname 直接映射到目标主机名和中间主机名。
errdefs_msgno additional.fields 已添加为键为 errdefs_msgno 的附加字段。
externalId additional.fields 作为附加字段添加,键为 Support_Id。
f5_host target.hostname,intermediary.hostname 直接映射到目标主机名和中间主机名。
geo_info principal.location.country_or_region,security_result.detection_fields 映射到主要营业地点所在的国家/区域。还添加为检测字段,键为 geo_info。
host target.hostname 直接映射到目标主机名。
ids additional.fields 解析为以逗号分隔列表形式表示的支持 ID。每个 ID 都会添加到键为 supportid 的列表值附加字段中。
ip_addr_intelli security_result.detection_fields 已添加为检测字段,键为 ip_addr_intelli。
ip_client principal.ip 直接映射到主 IP。
ip_route_domain principal.ip,principal.asset.ip 系统会提取 IP 部分并将其映射到主 IP。
irule security_result.rule_name 直接映射到安全结果规则名称。
irule-version security_result.rule_version 直接映射到安全结果规则版本。
level security_result.severity,security_result.severity_details 用于确定安全结果严重程度。error 或 warning 映射到 HIGH。notice 映射到 MEDIUM。information 或 info 映射到 LOW。原始值也会映射到 severity_details。
logtime metadata.event_timestamp 解析后直接映射到事件时间戳。
management_ip_address,management_ip_address_2 intermediary.ip 直接映射到中介 IP。
method network.http.method 直接映射到 HTTP 方法。
msg security_result.summary,metadata.description 直接映射到某些日志格式的安全结果摘要。如果没有其他说明,则该说明会成为活动说明。
policy_name security_result.about.resource.name,security_result.rule_name 直接映射到安全结果资源名称或规则名称。
process target.application 直接映射到目标应用。
process_id principal.process.pid 直接映射到主进程 ID。
protocol network.application_protocol、network.ip_protocol、app_protocol 直接映射到应用协议或 IP 协议,具体取决于日志格式。
proxy_id security_result.rule_id 直接映射到安全结果规则 ID。
query_string additional.fields 添加为键为 query_string 的附加字段。
referrer network.http.referral_url 直接映射到 HTTP 引荐网址。
req_method network.http.method 直接映射到 HTTP 方法。
req_status security_result.action、security_result.action_details、security_result.detection_fields 如果为 blocked,则将 security_result.action 映射到 BLOCK。如果为 passed 或 legal,则映射到 ALLOW。如果包含 alerted,则映射到 QUARANTINE。原始值也会映射到 action_details 并添加为键为 req_status 的检测字段。
request target.url 直接映射到目标网址。
requestMethod network.http.method 直接映射到 HTTP 方法。
resp security_result.detection_fields 已添加为检测字段,键为 resp。
resp_code network.http.response_code 直接映射到 HTTP 响应代码。
response security_result.summary 直接映射到安全结果摘要。
response_code network.http.response_code 直接映射到 HTTP 响应代码。
route_domain additional.fields 添加为键为 route_domain 的附加字段。
rt metadata.event_timestamp 解析后直接映射到事件时间戳。
sev security_result.severity,security_result.severity_details 用于确定安全结果的严重程度。ERROR 映射到 ERROR。原始值也会映射到 severity_details。
severity security_result.severity,security_result.severity_details 用于确定安全结果严重程度。Informational 映射到“低”,Error 或 warning 映射到“高”,critical 映射到“严重”,notice 映射到“中”,information 或 info 映射到“低”。原始值也会映射到 severity_details。
sig_ids security_result.rule_id 直接映射到安全结果规则 ID。
sig_names security_result.rule_name 直接映射到安全结果规则名称。
snat_ip principal.nat_ip 直接映射到主 NAT IP。
snat_port principal.nat_port 直接映射到主 NAT 端口。
src principal.ip,principal.asset.ip 直接映射到主 IP。
spt principal.port 直接映射到主端口。
sub_violates security_result.about.resource.attribute.labels 以键为 Sub Violations 的标签形式添加到安全结果资源属性中。
sub_violations security_result.about.resource.attribute.labels 已作为键为 Sub Violations 的标签添加到安全结果资源属性。
summary security_result.summary 直接映射到安全结果摘要。
support_id metadata.product_log_id 带有 support_id - 前缀,并映射到商品日志 ID。
suid network.session_id 直接映射到网络会话 ID。
suser principal.user.userid 直接映射到主用户 ID。
timestamp metadata.event_timestamp 在解析并转换为正确格式后,直接映射到事件时间戳。
unit_host principal.hostname,principal.asset.hostname 直接映射到主账号主机名。
uri principal.url 直接映射到主网址。
user_id principal.user.userid 直接映射到主用户 ID。
user_name principal.user.user_display_name 直接映射到主用户的显示名称。
username principal.user.userid 直接映射到主用户 ID。
useragent network.http.user_agent,network.http.parsed_user_agent 直接映射到 HTTP 用户代理。也会进行解析并映射到已解析的用户代理。
virtualserver network.tls.client.server_name 直接映射到 TLS 客户端服务器名称。
violate_details security_result.detection_fields,network.http.response_code 包含 XML 数据。request-violations 中的 viol_name 会被提取并添加为键为 Request Violation Name_index 的检测字段。提取 response_violations 中的 viol_name,并将其添加为键为 Response Violation Name_index 的检测字段。response_violations中的response_code映射到network.http.response_code。
violate_rate security_result.detection_fields 已添加为检测字段,键为 violate_rate。
violation_rating security_result.about.resource.attribute.labels 以键为 Violations Rating 的标签形式添加到安全结果资源属性中。
violations security_result.description 直接映射到安全结果说明。对于 Splunk 格式的日志,如果存在,则用于确定摘要。
virus_name security_result.threat_name 直接映射到安全结果威胁名称。
vs_name network.tls.client.server_name 直接映射到 TLS 客户端服务器名称。
websocket_direction network.direction 如果为 clientToServer,则映射到 INBOUND。如果为 ServerToclient,则映射到 OUTBOUND。
websocket_message_type security_result.detection_fields 已添加为检测字段,键为 WebsocketMessageType。
x_fwd_hdr_val principal.ip,principal.asset.ip 直接映射到主 IP。

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