收集 Sophos Central 日志
支持的平台:
Google SecOps
SIEM
本文档介绍了如何使用 Bindplane 收集 Sophos Central 日志。解析器会将 JSON 日志转换为统一数据模型 (UDM)。它会从嵌套的 JSON 结构中提取字段,将其映射到 UDM 字段,并根据 type 字段执行事件分类,从而针对不同的 Sophos Central 事件类型丰富数据,添加具体详情和操作。
准备工作
请确保满足以下前提条件:
- Google SecOps 实例。
- 您使用的是 Windows 2016 或更高版本,或者使用带有 systemd 的 Linux 主机。
- 您有另一台能够持续运行 Python 的 Windows 或 Linux 计算机。
- 如果通过代理运行,请确保防火墙端口已根据 Bindplane 代理要求打开。
- 对 Sophos Central 管理控制台的特权访问权限。
获取 Google SecOps 注入身份验证文件
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 收集代理。
- 下载数据注入身份验证文件。
- 将文件安全地保存在将要安装 Bindplane 的系统上。
获取 Google SecOps 客户 ID
- 登录 Google SecOps 控制台。
- 依次前往 SIEM 设置 > 配置文件。
- 复制并保存组织详细信息部分中的客户 ID。
安装 Bindplane 代理
按照以下说明在 Windows 或 Linux 操作系统上安装 Bindplane 代理。
Windows 安装
- 以管理员身份打开命令提示符或 PowerShell。
运行以下命令:
msiexec /i "[https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi](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](https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh))" install_unix.sh
其他安装资源
如需了解其他安装选项,请参阅此安装指南。
配置 Bindplane 代理以注入 Syslog 并将其发送到 Google SecOps
访问配置文件:
- 找到
config.yaml文件。通常,该文件位于 Linux 上的/opt/observiq-otel-collector/目录中或 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 log_type: 'SOPHOS_CENTRAL' raw_log_field: body ingestion_labels: 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更新为在第 1 步中保存身份验证文件的文件路径。
重启 Bindplane 代理以应用更改
如需在 Linux 中重启 Bindplane 代理,请运行以下命令:
/opt/observiq-otel-collector/config.yaml如需在 Windows 中重启 Bindplane 代理,您可以使用服务控制台,也可以输入以下命令:
net stop BindPlaneAgent && net start BindPlaneAgent
配置 Sophos Central API 访问权限
- 登录 Sophos Central Admin。
- 依次选择全局设置 > API 令牌管理。
- 点击添加令牌以创建新令牌。
- 输入令牌名称,然后点击保存。系统会显示所提供令牌的 API 令牌摘要。
- 在 API 令牌摘要部分,点击复制以复制 API 访问网址和标头。
在其他机器上安装 Python
- 打开网络浏览器,然后前往 Python 网站。
- 点击适用于您的操作系统(Windows 或 Mac)的 Download Python。
安装 Python:
- 在 Windows 上:
- 运行安装程序。
- 勾选显示 Add Python to PATH 的复选框。
- 点击立即安装。
- 在 Mac 上:
- Python 可能已安装;如果未安装,您可以使用终端安装最新版本。
- 打开终端,然后输入以下命令进行验证:
python --version- 在 Windows 上:
下载 Sophos 集成脚本
- 前往 Sophos Central SIEM Integration Repository 的 GitHub 页面。
- 依次点击绿色的代码按钮 > 下载 ZIP。
- 提取 ZIP 文件。
设置脚本配置
- 使用文本编辑器找到并打开
config.ini文件。 - 修改配置文件:
- API 令牌:输入之前从 Sophos Central 复制的 API 密钥。
- Syslog 服务器详细信息:输入 syslog 服务器的详细信息。
- Host:输入 Bindplane IP 地址。
- 端口:输入 Bindplane 端口号。
- 协议:输入 UDP(您也可以根据自己的设置使用 TCP 或 TLS)。
- 保存文件。
运行脚本
- 前往脚本文件夹。
- 在 Windows 上:
- 按 Windows 键,然后输入
cmd。 - 点击命令提示符。
- 前往相应文件夹:
cmd cd C:\Users\YourName\Downloads\Sophos-Central-SIEM-Integration
- 按 Windows 键,然后输入
- 在 macOS 上:
- 依次前往应用 > 实用程序。
- 打开终端。
- 前往相应文件夹:
bash cd /Users/YourName/Downloads/Sophos-Central-SIEM-Integration
- 在 Windows 上:
运行脚本:
- 输入以下命令以启动脚本:
python siem.py
自动运行脚本以实现持续运行
在 Windows 上(使用任务计划程序)
- 在“开始”菜单中输入“任务计划程序”,打开任务计划程序。
- 点击创建任务。
- 在常规标签页中:
- 为任务命名(例如
Sophos Central Log Export)。
- 为任务命名(例如
- 在触发器标签页中:
- 点击新建,并将任务设置为每天或启动时运行。
- 在操作标签页中:
- 点击新建,然后选择启动程序。
- 浏览
python.exe可执行文件(通常位于C:\PythonXX\python.exe)。 - 在添加实参字段中,输入脚本的路径(例如
C:\Users\YourName\Downloads\Sophos-Central-SIEM-Integration\siem.py)。
- 点击确定以保存任务。
在 Mac 上(使用 Cron 作业)
- 打开终端。
- 输入
crontab -e并按 Enter 键。 在文件末尾添加新行:
* * * * * /usr/bin/python /Users/YourName/Downloads/Sophos-Central-SIEM-Integration/siem.py保存并退出编辑器。
UDM 映射表
| 日志字段 | UDM 映射 | 逻辑 |
|---|---|---|
created_at_label |
additional.fields |
已合并 |
datastream_label |
additional.fields |
已合并 |
security_result.description |
metadata.description |
已重命名/已映射 |
end |
metadata.event_timestamp |
解析为 RFC 3339 |
when |
metadata.event_timestamp |
解析为 RFC 3339 |
has_principal |
metadata.event_type |
已映射:true → FILE_OPEN、true → NETWORK_CONNECTION、true → SCAN_UNCATEGORIZED |
type |
metadata.event_type |
映射值(共 14 个,例如 Event::Endpoint::DataLossPreventionAutomaticallyAllowed → `F... |
type |
metadata.product_event_type |
直接映射 |
type |
network.direction |
已映射:Event::Endpoint::WebControlViolation → OUTBOUND,`Event::Endpoint::WindowsFirewa... |
type |
network.ip_protocol |
已映射:Event::Endpoint::WebControlViolation → TCP |
dhost |
principal.asset.hostname |
直接映射 |
location |
principal.asset.hostname |
直接映射 |
data.source_info.ip |
principal.asset.ip |
已合并 |
source_info.ip |
principal.asset.ip |
已合并 |
dhost |
principal.hostname |
直接映射 |
location |
principal.hostname |
直接映射 |
data.source_info.ip |
principal.ip |
已合并 |
source_info.ip |
principal.ip |
已合并 |
type |
principal.user.attribute.labels |
已映射:Event::Endpoint::DataLossPreventionAutomaticallyAllowed → username_label |
username_label |
principal.user.attribute.labels |
已合并 |
Username |
principal.user.user_display_name |
直接映射 |
source |
principal.user.user_display_name |
直接映射 |
source |
principal.user.userid |
直接映射 |
suser |
principal.user.userid |
直接映射 |
user_id |
principal.user.userid |
直接映射 |
endpoint_type_label |
security_result.about.labels |
已合并 |
sec_action |
security_result.action |
已合并 |
type |
security_result.action |
映射:Event::Endpoint::DataLossPreventionAutomaticallyAllowed → sec_action,`Event::En... |
group |
security_result.category_details |
已合并 |
name |
security_result.description |
直接映射 |
type |
security_result.description |
已映射:Event::Endpoint::(UpdateRebootRequired/ServiceNotRunning/NonCompliant/OutOfDate) →... |
duid_label |
security_result.detection_fields |
已合并 |
id_label |
security_result.detection_fields |
已合并 |
rule |
security_result.rule_name |
直接映射 |
rules |
security_result.rule_name |
直接映射 |
severity |
security_result.severity |
映射:low → LOW、medium → MEDIUM、high → HIGH |
security_result.description |
security_result.summary |
已重命名/已映射 |
app |
target.application |
直接映射 |
application |
target.application |
直接映射 |
dhost |
target.asset.hostname |
直接映射 |
endpoint_id |
target.asset_id |
直接映射 |
f_path |
target.file.full_path |
直接映射 |
f_size |
target.file.size |
已重命名/已映射 |
dhost |
target.hostname |
直接映射 |
application |
target.process.file.full_path |
直接映射 |
core_remedy_items.items.0.descriptor |
target.process.file.full_path |
直接映射 |
data.core_remedy_items.items.0.descriptor |
target.process.file.full_path |
直接映射 |
file_path_1 |
target.process.file.full_path |
直接映射 |
customer_id |
target.resource.id |
直接映射 |
p_device |
target.resource.name |
直接映射 |
scan_name |
target.resource.name |
直接映射 |
type |
target.resource.name |
已映射:Event::Endpoint::SavDisabled → Real time protection,`Event::Endpoint::Registere... |
type |
target.resource.type |
映射的值(总共 5 个,例如 Event::Endpoint::SavDisabled → SETTING,`Event::Endpoint::R... |
url |
target.url |
直接映射 |
principal.user.userid |
target.user.userid |
直接映射 |
suser |
target.user.userid |
直接映射 |
| 不适用 | metadata.event_type |
常量:GENERIC_EVENT |
| 不适用 | metadata.product_name |
常量:Sophos Central |
| 不适用 | metadata.vendor_name |
常量:Sophos |
| 不适用 | network.direction |
常量:OUTBOUND |
| 不适用 | network.ip_protocol |
常量:TCP |
| 不适用 | security_result.description |
常量:security_result.summary |
| 不适用 | security_result.severity |
常量:LOW |
| 不适用 | target.resource.name |
常量:Real time protection |
| 不适用 | target.resource.type |
常量:SETTING |
更新日志
需要更多帮助?获得社区成员和 Google SecOps 专业人士的解答。