将 Bindplane 与 Google SecOps 搭配使用
本文档介绍了适用于 Google Security Operations 的 Bindplane。
Bindplane 是一种遥测流水线,可从任何来源收集、优化日志,并将其导出到 Google SecOps。
Bindplane 提供了两个专门针对 Google 的版本。
Bindplane 包含以下主要组件:
Bindplane 收集器。基于 OpenTelemetry (OTel) 收集器的开源代理。它会从各种来源(包括 Microsoft Windows 事件日志)收集日志,并将其发送到 Google SecOps。您可以在本地或云端安装收集器。
此组件也可称为 Bindplane Distribution for OpenTelemetry (BDOT) 收集器、Bindplane 代理、收集代理、收集器或代理。
Bindplane 服务器。用于管理 OTel 收集器部署的全面统一平台。这些部署可以位于 Google SecOps 和 Google Cloud中。许多 Google SecOps 客户都使用 Bindplane Server,但使用与否取决于客户。Bindplane Server 可以在本地或 Bindplane 云中运行。如需详细了解服务器,请参阅 Bindplane 服务器。
此组件也可称为 Bindplane 可观测性流水线 (OP) 管理控制台或 Bindplane 管理控制台。
Bindplane 的 Google 版本
Bindplane 专门为 Google 提供了两个版本:Bindplane(Google 版)和 Bindplane 企业版(Google 版)。
Bindplane(Google 版)
所有 Google SecOps 客户均可使用 Bindplane(Google 版)。
您可以在 Bindplane 云中自行服务 Bindplane(Google 版)。
如需开始安装和自托管 Bindplane(Google 版)或为本地 Bindplane 服务器生成密钥,请参阅 Bindplane(Google 版)。
Bindplane Enterprise(Google 版)- 适用于 Google SecOps 企业 Plus 版客户
Google SecOps Enterprise Plus 客户可免费使用 Bindplane Enterprise(Google 版)。
建议大规模部署使用 Bindplane Enterprise(Google 版)。
请与您的 Google 客户支持团队联系,获取 Bindplane Enterprise(Google 版)的许可密钥。
Bindplane Google 版 - 差异
下表列出了 Bindplane Google 版之间的差异:
主题/功能 | Bindplane(Google 版) | Bindplane Enterprise(Google 版) |
---|---|---|
费用 | 所有 Google SecOps 客户均可免费使用 | Google SecOps 企业 Plus 版客户可免费使用 |
路由/目标平台 | 仅限 Google,包括通过 Google SecOps 使用 Google SecOps、Cloud Logging、BigQuery 和 Cloud Storage | Google,包括 12 个月的路由服务,用于将数据传输到非 Google 目的地,以支持 SIEM 迁移 |
过滤 | 使用正则表达式进行基本过滤 | 高级过滤处理器(例如,按条件、字段、严重程度等进行过滤)、数据缩减、日志抽样、重复数据删除 |
隐去 | 不适用 | 个人身份信息遮盖 |
转换 | 添加字段、移动字段、解析数据(键值对、JSON、CSV、XML、时间戳、按正则表达式解析)、重命名字段、事件分隔符 | 包含 Bindplane(Google 版)中支持的所有功能,外加删除字段、删除空值、合并 |
常规平台级功能 | 网关(汇总来自收集器的数据)、Bindplane 收集器、本地或云托管的 Bindplane 服务器(Bindplane 管理层)、所有来源、通过 Google SecOps 处理器进行静默主机监控、持久队列、丰富遥测数据、高可用性、RBAC、支持 Google SecOps 提取 API、凭据模糊处理、高级舰队管理(包括收集器分组)、动态日志类型分配 | Bindplane(Google 版)中支持的所有功能 |
Bindplane 收集器架构
Bindplane 使用 BDOT 收集器(统称为收集器)通过 Open Agent Management Protocol (OpAMP) 来标准化遥测数据管理。您还可以使用 Bindplane 创建和管理 自定义 OpenTelemetry 收集器分发。
收集器可以在 Linux 或 Docker 中作为轻量级 Web 服务器运行,且没有外部依赖项。
如需详细了解 Bindplane OpenTelemetry 收集器的部署架构,请参阅部署。
以下部分介绍了可用的架构选项。
收集器将日志发送到充当网关的收集器
对于大规模部署,我们建议您使用充当网关的 Bindplane Enterprise(Google 版)收集器。这些网关通过网络从其他收集器接收遥测数据,可以选择性地执行其他处理,并将数据路由到 Google SecOps。
充当网关的收集器与其他所有收集器使用相同的二进制文件。
下图显示了收集器将日志发送到充当网关的收集器:
收集器直接将日志发送到 Google SecOps 提取 API
下图显示了收集器直接向 Google SecOps 提取 API 发送日志:
收集器直接将日志发送到 Cloud Logging
下图显示了收集器直接向 Cloud Logging 发送日志:
收集器将日志发送到多个目的地
下图显示了收集器将日志发送到多个目的地:
Bindplane 服务器
Bindplane 服务器提供以下主要功能:
- 集中管理。借助该服务器,您可以跨 Google Cloud管理所有 OTel 收集器部署。您可以查看每个部署的状态,并执行常见的管理任务,例如启动、停止和重启收集器。
- 实时监控。该服务器可实时监控您的 OTel 收集器部署。您可以跟踪 CPU 用量、内存用量和吞吐量等指标。您还可以查看日志和轨迹来排查问题。
- 提醒和通知。服务器可让您针对重要事件(例如收集器发生故障或指标阈值被超出)设置提醒和通知。
- 配置管理。借助该服务器,您可以集中管理 OTel 收集器的配置。您可以修改配置文件、设置环境变量,并为所有部署应用安全政策。
- 与 Google Cloud集成。您可以在 Google Cloud 中创建和管理 OTel 收集器部署,并使用该服务器访问 Google Cloud 资源。
Bindplane 提供云端和本地部署选项。如需了解详情,请参阅使用 Bindplane 服务器。
技术要求和建议
本部分介绍了将 Bindplane 与 Google SecOps 搭配使用时,在安装和运行方面的技术要求和建议。
带宽要求
Bindplane 会为以下各项保持网络连接:
- 收集器管理
- 收集器吞吐量测量
- 命令行界面和 Web 界面
连接要求
默认情况下,Bindplane 会监听端口 3001。此端口可配置。
Bindplane 端口用于:
- 使用 OpAMP (WebSocket) 的收集器命令和控制
- 收集器吞吐量测量请求 (HTTP
POST
请求) - 浏览器和 CLI 用户(HTTP 和 WebSocket)
收集器必须能够启动与 Bindplane 的连接,以进行 OpAMP (WebSocket) 和吞吐量测量 (HTTP)。
Bindplane 绝不会主动与收集器建立连接。您可以配置防火墙,以防止 Bindplane 访问收集器网络;不过,收集器网络必须能够通过配置的端口访问 Bindplane。
Bindplane 收集器一般技术要求
如需了解 Bindplane 收集器的常规技术要求,请参阅以下内容:
收集器资源要求
Bindplane 的资源要求因受管理的收集器数量而异。随着受管收集器数量的增加,CPU、内存、磁盘吞吐量/IOPS 和网络消耗也会增加。
请使用下表确定 CPU、内存和存储空间容量的大小:
收集器数量 | Bindplane 节点 | 容错性 | CPU 核心 | 内存 | 数据库 |
---|---|---|---|---|---|
1 - 100 人 | 1 | 不适用 | 2 | 4 GB | bbolt |
100-25,000 | 1 | 不适用 | 4 | 16 GB | postgres |
1-60,000 | 3 | 1 | 2 | 8 GB | postgres |
60,001-125,000 | 5 | 1 | 2 | 8 GB | postgres |
125,001-250,000 | 10 | 2 | 2 | 8 GB | postgres |
规划安装和部署
以下部分包含建议和最佳实践,您在规划 Bindplane 部署时应考虑这些内容。
考虑伸缩和容错
横向伸缩是首选,因为它可提供容错能力并消除导出器瓶颈。
在网关模式下运行 Bindplane 收集器时,我们建议您将它们与负载均衡器配对,以提供容错和横向伸缩功能。
计算所需的收集器数量
在计算工作负载所需的收集器数量时,请考虑预期吞吐量或日志速率,并使用下表。此表假设每个收集器有 4 个 CPU 核心和 16 GB 内存。该表未包含使用处理器的计算;添加处理器后,计算要求会增加。
遥测吞吐量 | 日志/秒 | 收集器 |
---|---|---|
5 GB/月 | 250000 | 2 |
10 GB/月 | 50 万 | 3 |
20 GB/月 | 100 万 | 5 |
100 GB/月 | 5000000 | 25 |
为实现容错功能而过度配置收集器舰队
过度配置收集器舰队,以确保容错能力。如果一个或多个收集器系统发生故障或因维护而离线,其余收集器必须有足够的容量来管理遥测吞吐量。
如果您使用的是固定数量的收集器,可以实现其 CPU 和内存的纵向伸缩,以提高吞吐量。
分流处理开销
一般来说,您希望收集器执行的工作量尽可能少。如果您有繁重的处理需求,将处理任务分流到网关收集器群组可能会很有用。例如,您可以让网关收集器执行此任务,而不是使用开销较大的正则表达式操作来过滤遥测数据。一般来说,网关收集器在专用系统上运行。这证明了处理开销的合理性,因为与可能在数据库服务器上运行的非网关收集器不同,网关收集器不会消耗在同一系统上运行的其他服务的计算能力。
网关模式的最佳实践
在网关模式下运行 Bindplane 收集器时,我们建议您按照以下最佳实践规划部署:
- 在负载均衡器后面放置至少两个收集器。
- 每个收集器应至少有 2 个核心。
- 每个收集器应至少有 8 GB 的内存。
- 每个收集器应有 60 GB 的可用空间用于持久队列。
在需要时使用负载均衡器
在高可用性模式下运行 Bindplane 时,需要使用负载均衡器。
在网关模式下运行 Bindplane 收集器时,请使用负载均衡器来提高性能和冗余度。负载均衡还支持网关舰队的横向伸缩,并能够在发生故障时保持正常运行,而不会导致服务中断。
Bindplane 收集器可与各种负载平衡器搭配使用。
如需了解详情,请参阅负载平衡器。
负载均衡端口和协议
默认情况下,Bindplane 会监听端口 3001。
为了支持 OpenTelemetry 中的各种基于网络的接收器,负载均衡器必须支持:
- TCP/UDP 传输协议
- HTTP 和 gRPC 应用协议
负载均衡规模调整
为了实现最高的容错能力,Bindplane 节点应管理不超过 30,000 个收集器。每个收集器都会打开与 Bindplane 的两个连接(一个用于 OpAMP 远程管理,另一个用于发布吞吐量指标)。此限制有助于确保您不会超出大多数负载平衡器对每个后端实例施加的约 65,535 个连接的连接数限制。
如果组织有 10 万个收集器,则集群大小为 3 将不足。每个节点将负责大约 33,000 个收集器,这相当于每个 Bindplane 实例 66,000 个 TCP 连接。如果一个节点因维护而停用,情况会变得更糟,因为每个剩余的 Bindplane 实例届时将管理 50,000 个收集器或 100,000 个 TCP 连接。
负载均衡规模调整最佳实践
- 实现健康检查。配置负载均衡器,确保收集器已准备好接收流量。
- 均匀分配连接。连接应在收集器之间均匀分布。
支持必需的协议。为了支持 OpenTelemetry 中的各种基于网络的接收器,负载均衡器必须支持:
- TCP/UDP 传输协议
- HTTP 和 gRPC 应用协议
如需了解详情,请参阅收集器弹性。
基于来源类型的负载均衡
任何通过网络从远程系统接收遥测数据的来源类型都适合进行负载均衡,包括以下类型:
- OTLP
- Syslog
- TCP/UDP
- Splunk HEC
- Fluent Forward
在生产环境中使用高可用性模式
您可以采用单实例或多实例配置来部署 Bindplane 实例。对于需要高可用性 (HA) 和弹性的生产部署,我们建议您使用多实例 (HA) 部署模型。
当 Bindplane 管理的收集器超过 25,000 个时,我们建议您以高可用性 (HA) 模式运行 Bindplane。
如需了解 Bindplane 中的 HA,请参阅高可用性。
计算高可用性所需的收集器和 Bindplane 服务器数量
在高可用性模式下运行 Bindplane 时,您必须考虑每个 Bindplane 服务器预计要处理多少收集器。
获取 Bindplane 实例总数,然后减去因维护而预计会变为不可用的节点数量上限。确保每个节点在节点中断期间管理的收集器不超过 30,000 个。
Postgres(用于实现高可用性)
在 HA 模式下运行 Bindplane 时,Postgres 是必备条件。
Prometheus(用于实现高可用性)
在高可用性模式下运行 Bindplane 时,需要使用 Prometheus。
如需了解详情,请参阅 Prometheus。
用于实现 HA 的事件总线
Bindplane 使用事件总线在 Bindplane 内的组件之间进行通信。在 HA 模式下运行 Bindplane 时,您可以使用事件总线在 Bindplane 服务器之间发送事件。
如需了解详情,请参阅事件总线。
使用单实例部署来创建测试环境或概念验证
对于测试环境或概念验证,我们建议您使用单实例部署。
如需了解详情,请参阅单实例。
隔离后端凭据
您可以仅在网关收集器上保留凭据,而无需将凭据部署到所有收集器系统。这样可以简化凭据轮替,并通过将凭据部署限制为部分系统来减小安全攻击面。
为网关收集器设置防火墙
您可以将网关收集器放置在与内部网络隔离的边界网络中。您可以配置网络,以允许其他收集器将数据转发到网关收集器,同时阻止网关收集器访问应用网络。这样,您就可以将遥测数据发送到基于云的后端,而无需授予端点对互联网的直接访问权限。
防火墙必须允许 HTTP 流量到达配置的端口上的 Bindplane。
验证防火墙配置
收集器与互联网之间的任何防火墙或经过身份验证的代理都需要规则才能访问以下主机:
连接类型 | 目标 | 端口 |
---|---|---|
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 |
将 PostgreSQL 用于生产部署
Postgres 是 Bindplane 生产部署所必需的。
Postgres 是您以高可用性模式运行 Bindplane 的前提条件。
CPU 核心数和可用内存通常会限制 PostgreSQL 存储后端的性能。我们建议使用低延迟、高吞吐量的存储空间(例如固态硬盘 [SSD])来备份 PostgreSQL 存储空间。
收集器数量 | CPU 核心 | 内存 |
---|---|---|
1-60,000 | 4 | 16 GB |
60,001-125,000 | 8 | 32 GB |
125,001-250,000 | 16 | 64 GB |
如需了解详情,请参阅以下内容:
实现适当的身份验证
Bindplane 支持通过以下协议和服务进行身份验证;请确保它们已正确实现:
- Azure Entra LDAP。如需了解详情,请参阅 Azure LDAP 和更改 Bindplane 身份验证类型。
- LDAP。
- OpenID Connect (OIDC)。
- 本地。
- SAML。
- Postgres TLS。如需了解详情,请参阅 Postgres TLS。
- Kubernetes。如需了解详情,请参阅 GKE Workload Identity。
使用 Bindplane 服务器
大多数 Google SecOps 客户都使用 Bindplane 服务器,但使用该服务器是可选的。如果您要安装 Bindplane 服务器,则需要访问 storage.googleapis.com
。如果您仅安装收集器,则无需此访问权限。
如需观看演示,了解如何配置 Bindplane 服务器以标准化日志并将其导出到 Google SecOps,请前往 [此页面](https://bindplane.com/use-case-demo),然后选择 Google SecOps 配置。
使用 Bindplane Cloud 服务器
Google 客户可以使用 Bindplane Cloud。
如有任何与 Bindplane Cloud Server 相关的问题,请与 Bindplane 支持团队联系。如有任何与本地 Bindplane Server 相关的问题,请与 Google SecOps 支持团队联系。
在 Google Cloud上使用 Bindplane 服务器
如需了解如何在 Google Cloud上运行 Bindplane 服务器,请参阅 Bindplane 企业版。
使用 Bindplane 本地服务器
使用本地 Bindplane 服务器时,必须遵守现有的Google Cloud 《服务条款》。
在 Linux 上安装本地服务器
您可以通过运行脚本(推荐)或下载二进制文件并手动安装,在 Linux 上安装本地 Bindplane 服务器。如需了解详情,请参阅安装 Bindplane 服务器。
如需使用脚本在 Linux 上安装本地 Bindplane 服务器,请执行以下操作:
运行以下脚本:
curl -fsSlL https://storage.googleapis.com/bindplane-op-releases/bindplane/latest/install-linux.sh -o install-linux.sh && bash install-linux.sh --init && rm install-linux.sh
按照说明操作,完成服务器初始化。
如需使用二进制文件在 Linux 上安装本地 Bindplane 服务器,请执行以下操作:
下载以下任一文件:
按照配置 Bindplane 服务器中的说明更新配置文件。
支持的 Linux 发行版:
- Red Hat、Centos、Oracle Linux 7、8、9
- Debian 11 和 12
- Ubuntu LTS 20.04 和 22.04
- SUSE Linux 12 和 15
- Alma 和 Rocky Linux
如需了解详情,请参阅以下内容:
Docker 本地部署
如需了解详情,请参阅安装 Bindplane 服务器。
您可以在以下位置找到 Bindplane Docker 容器映像:
- GitHub packages:
ghcr.io/observiq/Bindplane-ee
- Google 制品库:
us-central1-docker.pkg.dev/observiq-containers/bindplane/bindplane-ee
- Docker Hub:
observiq/bindplane-ee
容器映像会使用发布版本进行标记:例如,发布版本 v1.35.0 将具有标记 observiq/bindplane-ee:1.35.0
。
安装 BindPlane 收集器
本部分介绍了如何在各种系统上为 Google SecOps 安装 Bindplane 收集器。
收集器通常使用最少的资源。不过,在处理大量日志时,请注意资源消耗,以免影响其他服务。如需了解详情,请参阅技术要求和建议、规划安装和部署以及代理规模调整和扩缩。
如需了解如何安装收集器(即 OTel 代理),请参阅 Bindplane OTel 收集器。
您还可以参阅 GitHub 文档 bindplane-otel-collector。
如需安装收集器,您需要满足以下条件:
Google SecOps 注入身份验证文件
如需下载身份验证文件,请按以下步骤操作:
- 打开 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 收集代理。
- 下载 Google SecOps 注入身份验证文件。
Google SecOps 客户 ID
如需查找客户 ID,请按以下步骤操作:
- 打开 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 配置文件。
- 从组织详细信息部分复制客户 ID。
Windows 2012 SP2 或更高版本或具有 systemd 的 Linux 主机
互联网连接
GitHub 访问权限
部署工具
本部分介绍了 Bindplane 的部署工具。
GitOps
使用 GitOps 模型部署 Bindplane 资源,包括:
- Bindplane 身份验证
- Bindplane CLI
- 网络访问
- 与 GitHub 代码库和 GitHub Actions 集成
- 导出现有资源
- 管理敏感值
- 建立 GitHub Action 工作流
- 有关提交和测试配置、启用自动发布以及利用直接修改或界面导出方法更新资源的逐步说明
- 更新敏感值并采用 RBAC
如需了解详情,请参阅 GitOps。
Ansible
如需了解如何使用 Ansible 部署 Bindplane,请参阅 bindplane-agent-ansible。
Bindplane CLI
如需了解 Bindplane CLI,请参阅 GitOps。
Terraform
如需了解如何使用 Terraform 配置 Bindplane 资源,请参阅 Bindplane 提供程序。
Kubernetes
如需了解如何将 Kubernetes 与 Bindplane 搭配使用,请参阅以下内容:
在 Windows 上安装 BindPlane 收集器
如需在 Windows 上安装 Bindplane 收集器,请运行以下 PowerShell 命令:
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
或者,如需使用安装向导进行安装,请下载适用于 Windows 的最新安装程序。下载安装程序后,打开安装向导并按照说明配置和安装 Bindplane 收集器。
如需详细了解如何在 Windows 上安装 Bindplane 收集器,请参阅 Windows 安装。
在 Linux 上安装 Bindplane 收集器
您可以使用脚本在 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 收集器
安装收集器后,observiq-otel-collector
服务会运行并准备好进行配置。
您可以手动配置收集器,也可以使用 Bindplane 服务器进行配置。
如果您要手动配置收集器,则需要更新导出器参数,以确保收集器通过 Google SecOps 进行身份验证。
OTel 收集器配置文件
在 Linux 中,收集器的配置文件位于 /opt/observiq-otel-collector/config.yaml
。
OTel 收集器服务和日志
收集器默认将日志记录到 C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log
。
收集器进程的标准错误日志位于 C:\Program Files\observIQ OpenTelemetry Collector\log\observiq_collector.err
。
在 Linux 中,如需查看收集器的日志,请运行 sudo tail -F /opt/observiq-otel-collector/log/collector.log
。
常用的 Linux OTel 收集器服务命令:
如需停止 OTel 收集器服务,请运行
sudo systemctl stop observiq-otel-collector
。如需启动 OTel 收集器服务,请运行
sudo systemctl start observiq-otel-collector
。如需重启 OTel 收集器服务,请运行
sudo systemctl restart observiq-otel-collector
。如需在启动时启用 OTel 收集器服务,请运行
sudo systemctl enable observiq-otel-collector
。
重启收集器服务以使配置更改生效
更改配置时,您必须重启收集器服务,才能使配置更改生效 (sudo systemctl restart observiq-otel-collector
)。
使用默认的示例配置文件
默认情况下,收集器配置文件位于 C:\Program Files\observIQ OpenTelemetry Collector\config.yaml
。
如需下载收集器使用的示例配置文件和身份验证令牌,请执行以下操作:
- 打开 Google SecOps 控制台,然后依次前往 SIEM 设置 > 收集代理。
自定义配置文件中的以下两个部分:
- 接收器:指定收集器应收集哪些日志并将其发送到 Google SecOps。
- 导出器:指定收集器将日志发送到的目标位置。
支持以下导出器:
- Google SecOps exporter:直接将日志发送到 Google SecOps 注入 API。
- Google SecOps 转发器导出器:将日志发送到 Google SecOps 转发器。
- Cloud Logging 出口:将日志发送到 Cloud Logging。
在导出器中,自定义以下内容:
customer_id
:您的 Google SecOps 客户 ID。endpoint
:您的 Google SecOps 区域级端点。creds
:您的身份验证令牌。或者,您也可以使用
creds_file_path
直接引用凭据文件。对于 Windows 配置,请使用反斜杠转义路径。log_type
:日志类型。建议您选择 WINDOWS_DNS 作为日志类型。ingestion_labels
:注入标签。这些标签用于标识 Google SecOps 中的日志。namespace
:可选命名空间。每种日志类型都需要您配置导出器。
日志收集配置示例
以下部分包含日志收集的配置示例。
将 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 事件和系统日志直接发送到 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 事件和系统日志发送到 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]
Bindplane 运营和维护
本部分介绍了日常操作和维护措施。
验证 OTel 配置
如需了解如何验证 Bindplane OTel 配置,请参阅 OTelBin。
收集器版本更新
Bindplane 可以轮询 bindplane-otel-collector/releases 以检测新的收集器版本。此功能是可选的。
您可以在 Bindplane 配置中将 agentVersions.syncInterval
设置为 0
,以停用 GitHub 轮询:
agentVersions:
syncInterval: 0
备份和灾难恢复
如需了解如何使用 Bindplane 进行备份和灾难恢复,请参阅 Bindplane 资源。
PostgreSQL 备份和灾难恢复
如需了解如何使用 Bindplane 进行 PostgreSQL 备份和灾难恢复,请参阅 PostgreSQL 文档。
BBolt 备份和灾难恢复
如需了解如何使用 Bindplane 进行 BBolt(已弃用)备份和灾难恢复,请参阅 BBolt Store 文档。
弹性和重试
默认情况下,所有支持重试的平台都已启用重试功能。默认情况下,失败的请求会在 5 秒后重试,并逐渐退避,最长可达 30 秒。五分钟后,请求会被永久丢弃。
如需了解详情,请参阅收集器弹性。
使用严重程度过滤器减少日志量
如需了解如何减少日志量,请参阅使用严重程度过滤条件减少日志量。
Bindplane 与第三方收集器的集成
虽然使用 Bindplane 收集器在边缘进行收集时,Bindplane 的功能更强大,但在大多数情况下,Bindplane 可以保留在现有基础架构中。例如,如果您已在使用 Fluent Bit 或 Splunk Universal Forwarders,则可以继续使用。
Bindplane 与 Splunk 的集成
如需了解如何将 Splunk 与 Bindplane 搭配使用,请参阅以下内容:
Bindplane 与其他第三方收集器的集成
如需了解 Bindplane 与第三方收集器的集成,请参阅使用 OpAMP 扩展程序连接其他 OpenTelemetry 收集器。
静默主机监控
借助 Google Security Operations Silent Host Monitoring,您可以使用 Google Cloud Monitoring 为提取速率变化创建提醒。它会针对每个收集器生成提醒,并在提取速率低于您定义的阈值时通知您,表明收集器可能停止运行。
如需了解如何使用 Bindplane 进行静默主机监控,请参阅以下内容:
在 Linux 上升级 Bindplane
运行安装命令时,无需在末尾添加 --init
标志,即可升级 Bindplane。在 Bindplane 服务器上运行此脚本以升级 Bindplane。如需了解详情,请参阅升级、降级或卸载 Bindplane Server。
监控 Bindplane
如需了解如何监控 Bindplane,请参阅监控 Bindplane。
在 Bindplane 中监控 Kubernetes
如需了解如何在 Bindplane 中监控 Kubernetes,请参阅 Kubernetes 监控。
其他文档
如需详细了解 Bindplane(以前称为 observIQ),请参阅以下内容:
- 由 OpenTelemetry 提供支持的行业领先的可观测性和安全性
- 将 Google SecOps 与 Bindplane 搭配使用的最佳实践
- Bindplane 解决方案
- Bindplane 使用入门
- Google Cloud支持的日志类型
- 按条件处理器过滤
- 适用于 Bindplane 的来源
需要更多帮助?从社区成员和 Google SecOps 专业人士那里获得解答。