收集 McAfee Web Gateway 日志
本文档介绍了如何使用 Bindplane 代理将 McAfee Web Gateway 日志注入到 Google Security Operations。解析器会从 SYSLOG + KV (CEF)、JSON 和原始格式的日志中提取字段。它使用 grok 和 csv 过滤器来解析不同的日志结构,并对字段名称进行规范化。然后,它会将提取的字段映射到统一数据模型 (UDM) 架构,处理各种极端情况和数据不一致问题,以创建统一的输出。
准备工作
确保您满足以下前提条件:
- Google SecOps 实例
- Windows 2016 或更高版本,或者具有 systemd 的 Linux 主机
- 如果在代理后运行,防火墙端口处于开放状态
- 对 McAfee Web Gateway 的特权访问权限
获取 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: '/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: MCAFEE_WEBPROXY 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
在 McAfee Web Gateway 中配置 Syslog
- 登录 McAfee Web Gateway 网页界面。
- 依次前往政策 > 规则集。
- 点击 Log Handler,然后展开 Default 规则集,并选择嵌套的 CEF Syslog 规则集。
- 启用发送到 Syslog 规则。
- 点击保存更改。
- 依次前往配置 > 设备 > 日志文件管理器 > 设置。
- 选择将审核日志写入 syslog。
- 依次前往配置 > 文件编辑器。
- 在文件树中选择 rsyslog.conf。
- 按如下方式修改该文件:
- 找到以下行(或类似行):
*.info;mail.none;authpriv.none;cron.none /var/log/messages
。 - 在此行中添加一个守护程序,并在路径信息前插入一个短划线 (-):
*.info;daemon.!=info;mail.none;authpriv.none;cron.none -/var/log/messages
- 找到以下行(或类似行):
在文件底部添加新行,以将信息消息发送到 Bindplane 代理 IP 地址。
对于通过 UDP 传输的 syslog:
daemon.info;auth.=info @<bindplane-server-ip>:<bindplane-port>
对于通过 TCP 的 syslog:
daemon.info;auth.=info @@<bindplane-server-ip>:<bindplane-port>
UDM 映射表
日志字段 | UDM 映射 | 逻辑 |
---|---|---|
application_name |
principal.application |
直接从 KV 格式的 application_name 字段或 JSON 格式的 user_agent_product 字段映射。 |
auth_user |
principal.user.userid |
直接从 KV 格式的 auth_user 字段映射。 |
block_reason |
security_result.summary |
直接从 JSON 和 CSV JSON 格式中的 block_reason 字段、原始格式中的 _block_reason 或 KV 格式中的 block_reason 字段映射。 |
block_res |
security_result.action |
以键值对 (KV) 格式从 block_res 字段映射。如果 block_res 为 DENIED 或包含 Block ,则操作为 BLOCK 。如果 block_res 为 0 或包含 Allow ,则操作为 ALLOW 。使用 50 、51 、52 、53 、58 、59 、81 、80 、82 、83 、84 、110 、111 等特殊值来确定 security_result.category 。 |
bytes_from_client |
network.sent_bytes |
直接从 KV 格式的 bytes_from_client 字段、原始格式的 sr_bytes 字段或 JSON 和 CSV JSON 格式的 client_to_server_bytes 字段映射。 |
bytes_to_client |
network.received_bytes |
直接从 KV 格式的 bytes_to_client 字段、原始格式的 rs_bytes 字段或 JSON 和 CSV JSON 格式的 server_to_client_bytes 字段映射。 |
categories |
security_result.category_details |
直接从 KV 格式的 categories 字段、原始格式的 _category 字段或 JSON 和 CSV JSON 格式的 category 字段映射。 |
client_ip |
principal.ip ,intermediary.ip |
直接从 JSON 格式的 client_ip 字段映射。 |
clientIP |
principal.ip |
直接从 CEF 格式的 clientIP 字段映射。 |
csmethod |
network.http.method |
直接从原始格式的 csmethod 字段映射。 |
day |
metadata.event_timestamp |
以 KV 格式从 time_stamp 字段中提取的时间戳的一部分。 |
destination_ip |
target.ip |
直接从 JSON 格式的 destination_ip 字段映射。 |
destination_port |
target.port |
直接从 JSON 格式的 destination_port 字段映射。 |
domain |
target.hostname ,target.url |
直接从原始格式的 domain 字段映射。用于在存在 uri 的情况下构造 target.url 。 |
header |
intermediary.hostname |
从日志消息的开头提取。用于提取 intermediary.hostname 。 |
host |
target.hostname |
直接从 KV 格式的 host 字段映射。 |
hostname |
principal.hostname |
直接从 JSON 格式的 hostname 字段映射。 |
hour |
metadata.event_timestamp |
以 KV 格式从 time_stamp 字段中提取的时间戳的一部分。 |
http_action |
network.http.method |
直接从 JSON 格式的 http_action 字段映射。 |
http_status_code |
network.http.response_code |
直接从 JSON 和 CSV JSON 格式的 http_status_code 字段或原始格式和 KV 格式的 status_code 字段映射。 |
kv_entry.application_name |
principal.application |
直接从 KV 条目中的 application_name 字段映射。 |
kv_entry.auth_user |
principal.user.userid |
直接从 KV 条目中的 auth_user 字段映射。 |
kv_entry.block_reason |
security_result.summary |
直接从 KV 条目中的 block_reason 字段映射。 |
kv_entry.block_res |
security_result.action ,security_result.category |
从 KV 条目中的 block_res 字段映射。用于确定操作和类别的逻辑与顶级 block_res 字段的逻辑相同。 |
kv_entry.bytes_from_client |
network.sent_bytes |
直接从 KV 条目中的 bytes_from_client 字段映射。 |
kv_entry.bytes_to_client |
network.received_bytes |
直接从 KV 条目中的 bytes_to_client 字段映射。 |
kv_entry.categories |
security_result.category_details |
直接从 KV 条目中的 categories 字段映射。 |
kv_entry.host |
target.hostname |
直接从 KV 条目中的 host 字段映射。 |
kv_entry.method |
network.http.method |
直接从 KV 条目中的 method 字段映射。 |
kv_entry.rep_level |
security_result.severity_details |
直接从 KV 条目中的 rep_level 字段映射。 |
kv_entry.server_ip |
target.ip |
直接从 KV 条目中的 server_ip 字段映射。 |
kv_entry.status_code |
network.http.response_code |
直接从 KV 条目中的 status_code 字段映射。 |
kv_entry.time_stamp |
metadata.event_timestamp |
直接从 KV 条目中的 time_stamp 字段映射。 |
kv_entry.url |
target.url |
直接从 KV 条目中的 url 字段映射。 |
kv_entry.url_port |
target.port |
直接从 KV 条目中的 url_port 字段映射。 |
kv_entry.user_agent |
network.http.parsed_user_agent |
直接从 KV 条目中的 user_agent 字段映射,然后解析为结构化对象。 |
last_rule |
security_result.rule_name |
直接从 JSON 格式的 last_rule 字段映射。 |
loc |
principal.location.country_or_region |
直接从从 tgt_ip_or_location 中提取的 loc 字段映射。 |
location |
principal.location.country_or_region |
直接从 JSON 格式的 location 字段映射。 |
log.file.path |
principal.process.file.full_path |
直接从 JSON 格式的 log.file.path 字段映射。 |
message |
多项 | 原始日志消息。根据其格式(原始、JSON、KV、CEF)以不同方式进行解析。 |
method |
network.http.method |
直接从 KV 和原始格式的 method 字段或 JSON 格式的 http_action 字段映射,或从 CEF 数据派生。如果值为 GET 、POST 、HEAD 、OPTIONS 、PUT 、CONNECT 中的一个,则 metadata.event_type 会设置为 NETWORK_HTTP 。如果值为 - 或 CERTVERIFY ,则 metadata.event_type 设置为 NETWORK_CONNECTION 。 |
mins |
metadata.event_timestamp |
以 KV 格式从 time_stamp 字段中提取的时间戳的一部分。 |
month |
metadata.event_timestamp |
时间戳的一部分,从 KV 格式的 time_stamp 字段或 CEF 格式的 rt 字段中提取。 |
monthday |
metadata.event_timestamp |
从日志消息开头提取的时间戳的一部分。 |
protocol |
network.application_protocol |
直接从原始格式的 protocol 字段或 JSON 格式的 uri_scheme 字段映射,或从 KV 格式的 url 字段派生。 |
query |
target.url |
直接从原始格式的 query 字段映射。附加到 url 字段。 |
rep_level |
security_result.severity_details |
直接从 KV 格式的 rep_level 字段、JSON 格式的 reputation 字段或原始格式的 _risk 字段映射。用于确定 security_result.severity 。 |
request |
target.url |
直接从 CEF 格式的 request 字段映射。 |
requestClientApplication |
network.http.user_agent |
直接从 CEF 格式的 requestClientApplication 字段映射。 |
requestContext |
network.http.referral_url |
直接从 CEF 格式的 requestContext 字段映射。 |
requestMethod |
network.http.method |
直接从 CEF 格式的 requestMethod 字段映射。 |
requested_host |
target.url |
直接从 JSON 格式的 requested_host 字段映射。用于在 requested_path 也存在的情况下构造 target.url 。 |
requested_path |
target.url |
直接从 JSON 格式的 requested_path 字段映射。附加到 requested_host 以形成 target.url 。 |
request_timestamp |
metadata.event_timestamp |
直接从 JSON 格式的 request_timestamp 字段映射。 |
result |
security_result.action ,security_result.category |
直接从 JSON 和 CSV JSON 格式的 result 字段或 KV 格式的 block_res 字段映射。用于确定 security_result.action 和 security_result.category 。 |
rt |
metadata.event_timestamp |
直接从 CEF 格式的 rt 字段映射。 |
secs |
metadata.event_timestamp |
以 KV 格式从 time_stamp 字段中提取的时间戳的一部分。 |
server_ip |
target.ip |
直接从 KV 格式的 server_ip 字段映射。 |
source_ip |
principal.ip |
直接从 JSON、CSV JSON、原始和 KV 格式的 source_ip 字段、CEF 格式的 src 字段或原始格式的 src_ip 字段映射。 |
src |
principal.ip |
直接从 CEF 格式的 src 字段映射。 |
status_code |
network.http.response_code |
直接从原始格式的 status_code 字段映射。 |
summary |
security_result.summary |
直接从 CSV 格式的 summary 字段或 JSON 格式的 block_reason 字段映射。 |
system |
principal.platform |
直接从 JSON 格式的 system 字段映射。已转换为大写。 |
target_ip |
target.ip |
直接从原始格式的 target_ip 字段或 CEF 格式的 dst 字段映射。 |
tgtport |
target.port |
直接从原始格式的 tgtport 字段映射。 |
time |
metadata.event_timestamp |
从日志消息开头提取的时间戳的一部分,或 CEF 格式中的 rt 字段,或 KV 格式中的 time_stamp 字段。 |
timestamp |
metadata.event_timestamp |
直接从 JSON 格式的 @timestamp 字段映射。 |
timezone |
metadata.event_timestamp |
以 KV 格式从 time_stamp 字段中提取的时间戳的一部分。 |
uri |
target.url |
直接从原始格式的 uri 字段映射。用于构造 target.url 。 |
uri_scheme |
network.application_protocol |
直接从 JSON 格式的 uri_scheme 字段映射。已转换为大写。 |
url |
target.url |
直接从原始格式、KV 格式和 JSON 格式的 url 字段映射,或从原始格式的 domain 、uri 和 query 、JSON 格式的 requested_host 和 requested_path 或 CEF 格式的 request 构建。 |
url_port |
target.port |
直接从 KV 格式的 url_port 字段映射。 |
user |
principal.user.userid |
直接从 JSON 格式的 user 字段、JSON 格式的 username 、KV 格式的 auth_user 或原始格式的 suser 映射而来。 |
user_agent |
network.http.parsed_user_agent |
直接从原始格式和 KV 格式的 user_agent 字段、JSON 格式的 user_agent_comment 字段、CEF 格式的 requestClientApplication 字段映射,或从 JSON 格式的 agent.type 和 agent.version 字段构建。解析为结构化对象。 |
user_agent_comment |
network.http.parsed_user_agent |
直接从 JSON 格式的 user_agent_comment 字段映射。 |
user_agent_product |
principal.application |
直接从 JSON 格式的 user_agent_product 字段映射。 |
username |
principal.user.userid |
直接从 JSON 格式的 username 字段映射。 |
year |
metadata.event_timestamp |
时间戳的一部分,从 KV 格式的 time_stamp 字段或 CEF 格式的 rt 字段中提取。 |
不适用 | metadata.event_type |
由解析器根据 method 字段确定。可以是 NETWORK_HTTP 、NETWORK_CONNECTION 、GENERIC_EVENT 或 STATUS_UPDATE 。 |
不适用 | metadata.log_type |
硬编码为 MCAFEE_WEBPROXY 。 |
不适用 | metadata.product_name |
硬编码为 MCAFEE_WEBPROXY 。 |
不适用 | metadata.vendor_name |
硬编码为 MCAFEE 。 |
不适用 | network.direction |
硬编码为 OUTBOUND 。 |
不适用 | security_result.action |
由解析器根据 block_reason 或 result 字段确定。可以是 ALLOW 或 BLOCK 。 |
不适用 | security_result.category |
由解析器根据 result 字段确定。可以是 NETWORK_CATEGORIZED_CONTENT 、NETWORK_DENIAL_OF_SERVICE 、MAIL_SPAM 、AUTH_VIOLATION 、SOFTWARE_MALICIOUS 、NETWORK_SUSPICIOUS 或 NETWORK_MALICIOUS 。 |
不适用 | security_result.severity |
由解析器根据 risk 字段确定。可以是 LOW 、MEDIUM 或 HIGH 。 |
需要更多帮助?从社区成员和 Google SecOps 专业人士那里获得解答。