收集 F5 ASM 日志
本文档介绍了如何使用 Bindplane 将 F5 Application Security Manager (ASM) 日志注入到 Google Security Operations。解析器可处理各种 F5 ASM 日志格式(例如 syslog、CSV、CEF 和 Splunk),并将其标准化为统一数据模型 (UDM)。它使用 grok 模式和键值提取来解析字段,使用 XML 过滤来获取违规详情,使用条件逻辑来进行事件分类和严重程度映射,并将提取的字段合并到 UDM 架构中。
准备工作
请确保满足以下前提条件:
- Google SecOps 实例
- Windows 2016 或更高版本,或者具有
systemd
的 Linux 主机 - 如果在代理后运行,防火墙端口处于开放状态
- 对 F5 ASM 的特权访问权限
获取 Google SecOps 注入身份验证文件
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 收集代理。
- 下载注入身份验证文件。将该文件安全地保存在将要安装 Bindplane 的系统上。
获取 Google SecOps 客户 ID
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 配置文件。
- 复制并保存组织详细信息部分中的客户 ID。
安装 Bindplane 代理
Windows 安装
- 以管理员身份打开命令提示符或 PowerShell。
运行以下命令:
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
Linux 安装
- 打开具有 root 或 sudo 权限的终端。
运行以下命令:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
其他安装资源
如需了解其他安装选项,请参阅安装指南。
配置 Bindplane 代理以注入 Syslog 并将其发送到 Google SecOps
- 访问配置文件:
- 找到
config.yaml
文件。通常,它位于 Linux 上的/etc/bindplane-agent/
目录中或 Windows 上的安装目录中。 - 使用文本编辑器(例如
nano
、vi
或记事本)打开该文件。
- 找到
按如下方式修改
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 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
根据基础架构的需要替换端口和 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
在 F5 ASM 中配置 Syslog
输入以下命令,登录到 tmsh 实例:
tmsh
使用以下命令修改 syslog 配置:
edit /sys syslog all-properties
Syslog 配置会在
vi
文本编辑器中打开,并类似于以下示例:modify syslog { auth-priv-from notice auth-priv-to emerg cron-from warning cron-to emerg daemon-from notice daemon-to emerg description none include none iso-date disabled kern-from notice kern-to emerg mail-from notice mail-to emerg messages-from notice messages-to warning remote-servers none user-log-from notice user-log-to emerg }
将
include none
行替换为以下 syslog 过滤条件:include ` filter f_audit{ match(AUDIT); }; destination d_syslog_server { udp(\`<bindplane-ip>\` port (<bindplane-port>)); }; log { source(s_syslog_pipe); filter(f_audit); destination(d_syslog_server); }; `
将
<bindplane-ip>
和<bindplane-port>
替换为为 Bindplane 代理配置的实际 IP 地址和端口号。输入以下键序列以退出
vi
::wq!
在以下提示中,输入
y
以将更改保存到文件中:Save changes? (y/n/e)
输入以下命令以保存配置:
save /sys config
UDM 映射表
日志字段 | UDM 映射 | 逻辑 |
---|---|---|
act |
security_result.action |
如果 act 为 blocked ,则映射到 BLOCK。如果 act 为 passed 或 legal ,则映射到 ALLOW。如果 act 包含 alerted ,则映射到隔离。否则,对于 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 映射到“中”。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 映射到中等。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 映射到 LOW,Error 或 warning 映射到 HIGH,critical 映射到 CRITICAL,notice 映射到 MEDIUM,information 或 info 映射到 LOW。原始值也会映射到 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 专业人士那里获得解答。