使用 BindPlane 代理
BindPlane 代理(也称为数据收集代理)是基于 OpenTelemetry 收集器的开源代理,可从各种来源(包括 Microsoft Windows 事件日志)收集日志并将它们发送到 Google Security Operations。
observIQ BindPlane OP Management Console 提供了一个全面、统一的平台,用于管理 Google SecOps 和 Google Cloud 中的 OpenTelemetry (OTel) 收集器部署。observIQ 为 Google 版本的管理控制台提供了 BindPlane。如需了解详情,请参阅 observIQ 解决方案。管理控制台是可选的。无论是否有控制台,您都可以使用该代理。如需详细了解该控制台,请参阅 BindPlane OP 管理控制台。
这与 Cloud Logging 用于本地部署的解决方案相同。
准备工作
如需安装代理,您需要满足以下条件:
Google SecOps 注入身份验证文件
如需下载身份验证文件,请按以下步骤操作:
- 打开 Google SecOps 控制台。
- 转到 SIEM 设置 > 集合代理。
- 下载 Google SecOps 注入身份验证文件。
Google SecOps 客户 ID
要查找客户 ID,请按以下步骤操作:
- 打开 Google SecOps 控制台。
- 转到 SIEM 设置 > 配置文件。
- 复制 Organization Details(单位详细信息)部分中的客户 ID。
Windows 2012 SP2 或更高版本,或者带有 systemd 的 Linux 主机
互联网连接
GitHub 访问权限
验证防火墙配置
代理和互联网之间的任何防火墙或经过身份验证的代理都需要规则才能开放对以下主机的访问权限:
连接类型 | 目标 | 端口 |
TCP | malachiteingestion-pa.googleapis.com | 443 |
TCP | asia-northeast1-malachiteingestion-pa.googleapis.com | 443 |
TCP | asia-south1-malachiteingestion-pa.googleapis.com | 443 |
TCP | asia-southeast1-malachiteingestion-pa.googleapis.com | 443 |
TCP | australia-southeast1-malachiteingestion-pa.googleapis.com | 443 |
TCP | europe-malachiteingestion-pa.googleapis.com | 443 |
TCP | europe-west2-malachiteingestion-pa.googleapis.com | 443 |
TCP | europe-west3-malachiteingestion-pa.googleapis.com | 443 |
TCP | europe-west6-malachiteingestion-pa.googleapis.com | 443 |
TCP | europe-west12-malachiteingestion-pa.googleapis.com | 443 |
TCP | me-central1-malachiteingestion-pa.googleapis.com | 443 |
TCP | me-central2-malachiteingestion-pa.googleapis.com | 443 |
TCP | me-west1-malachiteingestion-pa.googleapis.com | 443 |
TCP | northamerica-northeast2-malachiteingestion-pa.googleapis.com | 443 |
TCP | accounts.google.com | 443 |
TCP | oauth2.googleapis.com | 443 |
BindPlane OP 管理控制台
BindPlane OP 管理控制台提供以下主要功能:
- 集中管理:通过控制台,您可以管理整个 Google Cloud 中的所有 OTel 收集器部署。您可以查看每个部署的状态,以及执行常见的管理任务,例如启动、停止和重启收集器。
- 实时监控:控制台可实时监控 OTel 收集器部署。您可以跟踪 CPU 用量、内存用量和吞吐量等指标,还可以查看日志和跟踪记录以排查问题。
- 提醒和通知:通过控制台,您可以针对重要事件设置提醒和通知,例如收集器出现故障或超出指标阈值时。
- 配置管理:借助控制台,您可以集中管理 OTel 收集器的配置。您可以修改配置文件、设置环境变量,还可以将安全政策应用于所有部署。
- 与 Google Cloud 集成:您可以在 Google Cloud 中创建和管理 OTel 收集器部署,并使用控制台访问您的 Google Cloud 资源。
您可以通过以下两种方式部署 BindPlane OP 管理控制台:
- 在 Linux 主机上下载并安装:以 DEB 软件包、RPM 软件包或 Docker 映像的形式提供。
- 从 Google Cloud Marketplace 安装和预配。
安装 BindPlane 代理
本部分介绍如何在不同主机操作系统上安装该代理。
Windows
如需在 Windows 上安装 BindPlane 代理,请运行以下 PowerShell 命令。
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
或者,如要使用安装向导进行安装,请下载适用于 Windows 的最新安装程序。
下载安装程序后,打开安装向导,然后按照说明配置和安装 BindPlane 代理。如需了解更多安装信息,请参阅在 Windows 上安装。
Linux
您可以使用自动确定要安装的软件包的脚本在 Linux 上安装代理。您也可以使用此脚本更新现有安装。
如需使用安装脚本进行安装,请运行以下脚本:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
从本地软件包安装
如需通过本地软件包安装代理,请使用 -f
并提供软件包的路径。
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh -f path_to_package
RPM 安装
从版本页面下载适用于您的架构的 RPM 软件包,然后使用 rpm
安装该软件包。如需了解如何安装 amd64
软件包,请参阅以下示例:
sudo rpm -U ./observiq-otel-collector_v${VERSION}_linux_amd64.rpm sudo systemctl enable --now observiq-otel-collector
将 VERSION
替换为您所下载软件包的版本。
DEB 安装
从版本页面下载适用于您的架构的 DEB 软件包,然后使用 dpkg
安装该软件包。如需了解如何安装 amd64
软件包,请参阅以下示例:
sudo dpkg -i --force-overwrite ./observiq-otel-collector_v${VERSION}_linux_amd64.deb sudo systemctl enable --now observiq-otel-collector
将 VERSION
替换为您所下载软件包的版本。
如需了解详情,请参阅 BindPlane 代理安装。
配置代理
您可以手动或使用 BindPlane OP 管理控制台配置代理。如果您要手动配置代理,则需要更新导出器参数,以确保代理通过 Google SecOps 进行身份验证。
安装代理后,observiq-otel-collector
服务会运行并准备好配置。默认情况下,代理会记录到 C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log
。
您可以在 C:\Program Files\observIQ OpenTelemetry Collector\log\observiq_collector.err
中找到代理进程的标准错误日志。
默认情况下,代理配置文件位于 C:\Program Files\observIQ OpenTelemetry Collector\config.yaml
。更改配置时,您必须重启代理服务,配置更改才能生效。
您可以从 Google SecOps 控制台 > SIEM 设置 > 集合代理中下载该代理使用的示例配置文件和身份验证令牌。
自定义配置文件中的以下两个部分:
- 接收器:指定代理应收集哪些日志并发送到 Google SecOps。
- Exporter:指定代理将日志发送到的目标位置。支持以下导出程序:
- Google SecOps 导出器:将日志直接发送到 Google SecOps ingestion API
- Google SecOps 转发器导出器:将日志发送到 Google SecOps 转发器
- Cloud Logging 导出器:将日志发送到 (Cloud Logging)
在导出器中,自定义以下内容:
customer_id
:Google SecOps 客户 IDendpoint
:Google SecOps 区域端点creds
:身份验证令牌或者,您也可以使用
creds_file_path
直接引用凭据文件。对于 Windows 配置,请使用反斜杠转义路径。log_type
:日志类型ingestion_labels
:可选的提取标签namespace
:可选命名空间对于每种日志类型,您都需要配置一个导出器。
架构
以下选项适用于代理架构。
方法 1:收集代理将日志发送到 Google SecOps 转发器
Google SecOps 转发器会接收多个系统日志流。每个 Syslog 数据源都通过 Google SecOps 转发器上配置的监听端口来区分。转发器会与您的 Google SecOps 实例建立加密的 GRPC 连接,以传送收集的日志。
请注意,转发器选项允许在将日志发送到 Google SecOps 之前对其进行汇总。
选项 2:收集代理将日志直接发送到 Google SecOps ingestion API
方法 3:收集代理将日志直接发送到 Cloud Logging
方法 4:收集代理将日志发送到多个目标位置
可伸缩性
代理收集器通常使用最少的资源,但在处理系统上的大量遥测(日志或跟踪记录)时,请注意资源消耗,以免影响其他服务。如需了解详情,请参阅代理大小调整和扩缩
支持
对于与收集器代理有关的任何问题,请与 Google Cloud 支持团队联系。
对于与 BindPlane OP Management 相关的任何问题,请与 ObservIQ 支持团队联系。
其他日志收集配置示例
以下部分列出了其他日志收集配置示例。
将 Windows 事件和 sysmon 直接发送到 Google SecOps
在示例中配置以下参数:
-
namespace
ingestion_labels
log_type
customer_id
creds
示例配置:
receivers:
windowseventlog/sysmon:
channel: Microsoft-Windows-Sysmon/Operational
raw: true
windowseventlog/security:
channel: security
raw: true
windowseventlog/application:
channel: application
raw: true
windowseventlog/system:
channel: system
raw: true
processors:
batch:
exporters:
chronicle/sysmon:
endpoint: malachiteingestion-pa.googleapis.com
creds: '{
"type": "service_account",
"project_id": "malachite-projectname",
"private_key_id": "abcdefghijklmnopqrstuvwxyz123456789",
"private_key": "-----BEGIN PRIVATE KEY-----abcdefg-----END PRIVATE KEY-----\n",
"client_email": "account@malachite-projectname.iam.gserviceaccount.com",
"client_id": "123456789123456789",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/account%40malachite-projectname.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}'
log_type: 'WINDOWS_SYSMON'
override_log_type: false
raw_log_field: body
customer_id: 'dddddddd-dddd-dddd-dddd-dddddddddddd'
chronicle/winevtlog:
endpoint: malachiteingestion-pa.googleapis.com
creds: '{
"type": "service_account",
"project_id": "malachite-projectname",
"private_key_id": "abcdefghijklmnopqrstuvwxyz123456789",
"private_key": "-----BEGIN PRIVATE KEY-----abcdefg-----END PRIVATE KEY-----\n",
"client_email": "account@malachite-projectname.iam.gserviceaccount.com",
"client_id": "123456789123456789",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/account%40malachite-projectname.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}'
log_type: 'WINEVTLOG'
override_log_type: false
raw_log_field: body
customer_id: 'dddddddd-dddd-dddd-dddd-dddddddddddd'
service:
pipelines:
logs/sysmon:
receivers: [windowseventlog/sysmon]
processors: [batch]
exporters: [chronicle/sysmon]
logs/winevtlog:
receivers:
- windowseventlog/security
- windowseventlog/application
- windowseventlog/system
processors: [batch]
exporters: [chronicle/winevtlog]
将 Windows 事件和 syslog 直接发送到 Google SecOps
在示例中配置以下参数:
windowseventlogreceiver
tcplogreceiver
listen_address
chronicleexporter
namespace
ingestion_labels
log_type
customer_id
creds
示例配置:
receivers:
tcplog:
listen_address: "0.0.0.0:54525"
windowseventlog/source0__application:
attributes:
log_type: windows_event.application
channel: application
max_reads: 100
poll_interval: 1s
raw: true
start_at: end
windowseventlog/source0__security:
attributes:
log_type: windows_event.security
channel: security
max_reads: 100
poll_interval: 1s
raw: true
start_at: end
windowseventlog/source0__system:
attributes:
log_type: windows_event.system
channel: system
max_reads: 100
poll_interval: 1s
raw: true
start_at: end
exporters:
chronicle/chronicle_w_labels:
compression: gzip
creds: '{ json blob for creds }'
customer_id: <customer_id>
endpoint: malachiteingestion-pa.googleapis.com
ingestion_labels:
env: dev
log_type: <applicable_log_type>
namespace: testNamespace
raw_log_field: body
service:
pipelines:
logs/source0__chronicle_w_labels-0:
receivers:
- windowseventlog/source0__system
- windowseventlog/source0__application
- windowseventlog/source0__security
exporters:
- chronicle/chronicle_w_labels
logs/source1__chronicle_w_labels-0:
receivers:
- tcplog
exporters:
- chronicle/chronicle_w_labels
将 Windows 事件和 Syslog 发送到 Google SecOps 转发器
在示例中配置以下参数:
windowseventlogreceiver
tcplogreceiver
listen_address
chronicleforwarder
endpoint
示例配置:
receivers:
tcplog:
listen_address: "0.0.0.0:54525"
windowseventlog/source0__application:
attributes:
log_type: windows_event.application
channel: application
max_reads: 100
poll_interval: 1s
raw: true
start_at: end
windowseventlog/source0__security:
attributes:
log_type: windows_event.security
channel: security
max_reads: 100
poll_interval: 1s
raw: true
start_at: end
windowseventlog/source0__system:
attributes:
log_type: windows_event.system
channel: system
max_reads: 100
poll_interval: 1s
raw: true
start_at: end
exporters:
chronicleforwarder/forwarder:
export_type: syslog
raw_log_field: body
syslog:
endpoint: 127.0.0.1:10514
transport: udp
service:
pipelines:
logs/source0__forwarder-0:
receivers:
- windowseventlog/source0__system
- windowseventlog/source0__application
- windowseventlog/source0__security
exporters:
- chronicleforwarder/forwarder
logs/source1__forwarder-0:
receivers:
- tcplog
exporters:
- chronicleforwarder/forwarder
将 Syslog 直接发送到 Google SecOps
在示例中配置以下参数:
tcplogreceiver
listen_address
chronicleexporter
namespace
ingestion_labels
log_type
customer_id
Creds
示例配置:
receivers:
tcplog:
listen_address: "0.0.0.0:54525"
exporters:
chronicle/chronicle_w_labels:
compression: gzip
creds: '{ json blob for creds }'
customer_id: <customer_id>
endpoint: malachiteingestion-pa.googleapis.com
ingestion_labels:
env: dev
log_type: <applicable_log_type>
namespace: testNamespace
raw_log_field: body
service:
pipelines:
logs/source0__chronicle_w_labels-0:
receivers:
- tcplog
exporters:
- chronicle/chronicle_w_labels
远程收集 Windows 事件并将其直接发送到 Google SecOps
在示例中配置以下参数:
windowseventlogreceiver
username
password
server
chronicleexporter
namespace
ingestion_labels
log_type
customer_id
creds
示例配置:
receivers:
windowseventlog/system:
channel: system
max_reads: 100
start_at: end
poll_interval: 10s
raw: true
remote:
username: "username"
password: "password"
server: "remote-server"
windowseventlog/application:
channel: application
max_reads: 100
start_at: end
poll_interval: 10s
raw: true
remote:
username: "username"
password: "password"
server: "server-ip"
windowseventlog/security:
channel: security
max_reads: 100
start_at: end
poll_interval: 10s
raw: true
remote:
username: "username"
password: "password"
server: "server-ip"
exporters:
chronicle/chronicle_w_labels:
compression: gzip
creds: '{ json blob for creds }'
customer_id: <customer_id>
endpoint: malachiteingestion-pa.googleapis.com
ingestion_labels:
env: dev
log_type: WINEVTLOG
namespace: testNamespace
raw_log_field: body
service:
pipelines:
logs/source0__chronicle_w_labels-0:
receivers:
- windowseventlog/system
- windowseventlog/application
- windowseventlog/security
exporters:
- chronicle/chronicle_w_labels
将数据发送到 Cloud Logging
在示例中配置 credentials_file
参数。
示例配置:
exporters:
googlecloud:
credentials_file: /opt/observiq-otel-collector/credentials.json
查询 SQL 数据库并将结果发送到 Google SecOps
在示例中配置以下参数:
sqlqueryreceiver
chronicleexporter
namespace
ingestion_labels
log_type
customer_id
creds
示例配置:
receivers:
sqlquery/source0:
datasource: host=localhost port=5432 user=postgres password=s3cr3t sslmode=disable
driver: postgres
queries:
- logs:
- body_column: log_body
sql: select * from my_logs where log_id > $$1
tracking_column: log_id
tracking_start_value: "10000"
processors:
transform/source0_processor0__logs:
error_mode: ignore
log_statements:
- context: log
statements:
- set(attributes["chronicle_log_type"], "POSTGRESQL") where true
exporters:
chronicle/chronicle_sql:
compression: gzip
creds: '{
"type": "service_account",
"project_id": "malachite-projectname",
"private_key_id": "abcdefghijklmnopqrstuvwxyz123456789",
"private_key": "-----BEGIN PRIVATE KEY-----abcdefg-----END PRIVATE KEY-----\n",
"client_email": "account@malachite-projectname.iam.gserviceaccount.com",
"client_id": "123456789123456789",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/account%40malachite-projectname.iam.gserviceaccount.com",
"universe_domain": "googleapis.com"
}'
customer_id: customer_id
endpoint: malachiteingestion-pa.googleapis.com
log_type: POSTGRESQL
namespace: null
raw_log_field: body
retry_on_failure:
enabled: false
sending_queue:
enabled: false
service:
pipelines:
logs/source0_chronicle_sql-0:
receivers:
- sqlquery/source0
processors:
- transform/source0_processor0__logs
exporters:
- chronicle/chronicle_sql
删除与正则表达式匹配的日志
您可以将收集器配置为丢弃与正则表达式匹配的日志。这对于过滤掉不需要的日志(如已知错误或调试消息)非常有用。
如需删除与正则表达式匹配的日志,请在配置中添加 filter/drop-matching-logs-to-Chronicle
类型的处理器。此处理器使用 IsMatch
函数根据正则表达式评估日志正文。如果函数返回 true
,则日志会被丢弃。
以下示例配置会删除日志正文中包含字符串 <EventID>10</EventID>
或 <EventID>4799</EventID>
的日志。
您可以自定义正则表达式以匹配所需的任何模式。IsMatch
函数使用 RE2 正则表达式语法。
示例配置:
processors:
filter/drop-matching-logs-to-Chronicle:
error_mode: ignore
logs:
log_record:
- (IsMatch(body, "<EventID>10</EventID>")) or (IsMatch(body, "<EventID>4799</EventID>"))
以下示例会以相同的配置将处理器添加到流水线:
service:
pipelines:
logs/winevtlog:
receivers:
- windowseventlog/security
- windowseventlog/application
- windowseventlog/system
processors:
- filter/drop-matching-logs-to-Chronicle # Add this line
- batch
exporters: [chronicle/winevtlog]
参考文档
如需详细了解 observIQ,请参阅: