收集 Sophos Endpoint 記錄
本文說明如何使用 Bindplane 代理程式收集 Sophos Endpoint (舊稱 Sophos AV/Intercept X) 記錄檔。剖析器會將 JSON 記錄轉換為統合資料模型 (UDM)。這個剖析器會從巢狀 JSON 結構中擷取欄位,並對應至 UDM 欄位,然後根據類型欄位將事件分類,並依據不同的 Sophos AV 事件類型,在資料中加入特定詳細資料和動作。
事前準備
請確認您符合下列必要條件:
- Google SecOps 執行個體
- Windows 2016 以上版本,或搭載
systemd的 Linux 主機 - 另一部 Windows 或 Linux 電腦,能夠持續執行 Python
- 如果是在 Proxy 後方執行,請確認防火牆通訊埠已按照 Bindplane 代理程式規定開啟
- Sophos Central 管理控制台的特殊存取權
取得 Bindplane 代理程式的 Google SecOps 憑證
如要向 Google SecOps 驗證 Bindplane 代理程式,請選擇下列其中一種方法:
- 新部署作業:使用 Chronicle API (選項 1)。
- 舊版部署作業:繼續使用擷取驗證檔案 (選項 2),直到 Ingestion API 於 2027 年 7 月 20 日停用。
方法 1:為 Chronicle API 建立服務帳戶 (建議)
- 登入 Google Cloud 控制台,選取連結至 Google SecOps 執行個體的 Google Cloud 專案。
- 依序前往 「IAM & Admin」(IAM 與管理) >「Service Accounts」(服務帳戶)。
- 按一下「建立服務帳戶」。
- 提供下列設定詳細資料:
- 「Service account name」(服務帳戶名稱):輸入帳戶名稱 (例如
bindplane-ingest)。 - 「服務帳戶說明」:輸入說明 (例如
Bindplane agent log ingestion)。
- 「Service account name」(服務帳戶名稱):輸入帳戶名稱 (例如
- 點按「Create and continue」(建立並繼續)。
- 在「將專案存取權授予這個服務帳戶」部分,按一下「選取角色」,然後選取「Chronicle 編輯者」。
- 依序點選「繼續」和「完成」。
- 按一下您建立的服務帳戶,然後前往「金鑰」分頁。
- 依序點選「新增金鑰」>「建立新的金鑰」。
- 選取「JSON」,然後點選「建立」。金鑰檔案會下載到電腦。
- 將金鑰檔案儲存為 Bindplane 收集器目錄中的
ingestion-auth.json(Linux 上的/opt/observiq-otel-collector/ingestion-auth.json或 Windows 上的C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json),或更新config.yaml中的creds_file_path,使其與儲存路徑相符。 - 依序前往「IAM & Admin」(IAM 與管理) >「Settings」(設定),然後複製「Project number」(專案編號)。設定匯出工具時會用到。
方法 2:下載擷取驗證檔案 (舊版)
- 登入 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" /quiet
Linux 安裝
- 開啟具有根層級或 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 的/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: protocol: https # Region of your instance, for example us, europe, asia-southeast1 location: <LOCATION> # Project number of the Google Cloud project linked to the instance project: '<PROJECT_NUMBER>' 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: chronicle.googleapis.com # Add optional ingestion labels for better organization log_type: 'SOPHOS_AV' raw_log_field: body ingestion_labels: service: pipelines: logs/source0__chronicle_w_labels-0: receivers: - udplog exporters: - chronicle/chronicle_w_labels請根據基礎架構需求,替換通訊埠和 IP 位址。
將
<LOCATION>替換為 Google SecOps 執行個體的區域 (例如us、europe或asia-southeast1)。匯出工具會以這個值做為chronicle.googleapis.com的前置字元。將
<PROJECT_NUMBER>替換為「IAM 與管理」>「設定」中的專案編號。將
<customer_id>替換為實際的客戶 ID。將
/path/to/ingestion-authentication-file.json更新為步驟 1 中儲存服務帳戶金鑰檔案 (選項 1) 的檔案路徑。
舊版擷取 API 匯出工具
如果您使用選項 2 的擷取驗證檔案,請將
exporters區塊替換為下列內容。將creds_file_path設為擷取驗證檔案的路徑,如果您的執行個體位於美國境外,請將malachiteingestion-pa.googleapis.com替換為區域端點 (例如europe-malachiteingestion-pa.googleapis.com)。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_AV' raw_log_field: body ingestion_labels:
重新啟動 Bindplane 代理程式,套用變更
如要在 Linux 中重新啟動 Bindplane 代理程式,請執行下列指令:
sudo systemctl restart bindplane-agent如要在 Windows 中重新啟動 Bindplane 代理程式,可以使用「Services」控制台,或輸入下列指令:
net stop BindPlaneAgent && net start BindPlaneAgent
設定 Sophos Central API 存取權
- 登入 Sophos Central Admin。
- 依序選取「Global Settings」>「API Token Management」。
- 按一下「Add Token」,建立新的權杖。
- 輸入權杖名稱,然後按一下「儲存」。畫面上會顯示所提供權杖的「API 權杖摘要」。
- 在「API 權杖摘要」部分,按一下「複製」,複製 API 存取網址和標頭。
在其他機器上安裝 Python
- 開啟網路瀏覽器,然後前往 Python 網站。
- 按一下「Download Python」,下載適用於您作業系統 (Windows 或 Mac) 的版本。
安裝 Python。
- Windows 系統:
- 執行安裝程式。
- 勾選「Add Python to PATH」方塊。
- 按一下「立即安裝」。
使用 Mac 電腦:
- Python 可能已安裝,如果沒有,可以使用終端機安裝最新版本。
- 開啟「終端機」,然後輸入下列指令:
python --version
- Windows 系統:
下載 Sophos 整合指令碼
- 前往 Sophos Central SIEM 整合 GitHub 存放區的 GitHub 頁面。
- 依序點選綠色的「Code」按鈕 >「Download ZIP」。
- 將 ZIP 檔案解壓縮。
設定指令碼
- 使用文字編輯器找出並開啟
config.ini檔案。 - 編輯設定檔:
- API 權杖:輸入先前從 Sophos Central 複製的 API 金鑰。
- Syslog Server Details:輸入系統記錄伺服器的詳細資料。
- 「Host」(主機):輸入 Bindplane IP 位址。
- Port:輸入 Bindplane 通訊埠編號。
- 通訊協定:輸入 UDP (您也可以視設定使用 TCP 或 TLS)。
- 儲存檔案。
執行指令碼
前往指令碼資料夾。
使用 Windows 電腦:
- 按下 Windows 鍵,然後輸入
cmd。 - 按一下「命令提示字元」。
- 前往指令碼資料夾:
cd C:UsersYourNameDownloadsSophos-Central-SIEM-Integration- 按下 Windows 鍵,然後輸入
在 macOS 上執行下列操作:
- 依序前往「應用程式」>「工具程式」。
- 開啟 [Terminal]。
- 前往指令碼資料夾:
cd /Users/YourName/Downloads/Sophos-Central-SIEM-Integration
執行指令碼:
輸入下列指令來啟動指令碼:
python siem.py
設定指令碼,在 Windows 上持續自動執行 (使用工作排程器):
- 在「開始」選單中輸入「工作排程器」,開啟工作排程器。
- 按一下「建立工作」。
- 在「一般」分頁中:
- 為工作命名,例如
Sophos AV Log Export。
- 為工作命名,例如
- 在「Triggers」(觸發條件) 分頁中:
- 按一下「新增」,然後將工作設為「每日」或「啟動時」 (視偏好設定而定)。
- 在「動作」分頁中:
- 按一下「新增」,然後選取「開始計畫」。
- 瀏覽
python.exe執行檔 (通常位於C:PythonXXpython.exe)。 - 在「Add arguments」欄位中,輸入指令碼的路徑,例如
C:UsersYourNameDownloadsSophos-Central-SIEM-Integrationsiem.py。
- 按一下「OK」儲存工作。
自動執行指令碼,在 Mac 上持續運作 (使用 Cron 工作):
- 開啟終端機。
- 輸入
crontab -e,然後按下Enter鍵。 在檔案結尾新增一行:
* * * * * /usr/bin/python /Users/YourName/Downloads/Sophos-Central-SIEM-Integration/siem.py儲存並結束編輯器。
UDM 對應表
| 記錄欄位 | UDM 對應 | 邏輯 |
|---|---|---|
s_ip |
intermediary.ip |
已合併 |
description |
metadata.description |
直接對應 |
name |
metadata.description |
直接對應 |
security_result.description |
metadata.description |
已重新命名/對應 |
end |
metadata.event_timestamp |
剖析為 RFC 3339 |
ts |
metadata.event_timestamp |
剖析為 RFC 3339 |
action |
metadata.event_type |
對應:unknown → NETWORK_CONNECTION、allowed → SCAN_PROCESS、blocked → `SCAN_PROC... |
e_type |
metadata.event_type |
對應值 (共 11 個,例如 NonCompliant → SCAN_HOST、SavDisabled → `SETTING_MODIFIC... |
type |
metadata.event_type |
對應值 (共 13 個,例如 Event::Endpoint::NonCompliant → SCAN_HOST、`Event::Endpoin... |
e_type |
metadata.product_event_type |
直接對應 |
type |
metadata.product_event_type |
直接對應 |
action |
network.direction |
對應:warned → OUTBOUND,unknown → OUTBOUND |
e_type |
network.direction |
對應:WindowsFirewall::Blocked → OUTBOUND |
type |
network.direction |
已對應:Event::Endpoint::WindowsFirewall::Blocked → OUTBOUND |
action |
network.ip_protocol |
對應:warned → TCP,unknown → TCP |
appSha256 |
principal.file.sha256 |
直接對應 |
dhost |
principal.hostname |
直接對應 |
host |
principal.hostname |
直接對應 |
source_info.ip |
principal.ip |
已合併 |
src_ip |
principal.ip |
已合併 |
id |
principal.resource.id |
直接對應 |
suser |
principal.user.user_display_name |
直接對應 |
suser |
principal.user.userid |
直接對應 |
user |
principal.user.userid |
直接對應 |
user_id |
principal.user.userid |
直接對應 |
endpoint_id_label |
security_result.about.labels |
已合併 |
endpoint_type_label |
security_result.about.labels |
已合併 |
action |
security_result.action |
對應值 (共 5 個,例如 allow → sec_action、unknown → sec_action、allowed → `... |
sec_action |
security_result.action |
已合併 |
group |
security_result.category_details |
已合併 |
sub_cat |
security_result.category_details |
已合併 |
desc |
security_result.description |
直接對應 |
e_type |
security_result.description |
對應:(UpdateRebootRequired/ServiceNotRunning/NonCompliant/OutOfDate) → `security_result... |
type |
security_result.description |
對應:Event::Endpoint::(UpdateRebootRequired/ServiceNotRunning/NonCompliant/OutOfDate) →... |
rule |
security_result.rule_name |
直接對應 |
rules |
security_result.rule_name |
直接對應 |
severity |
security_result.severity |
對應值 (共 6 個,例如 low → LOW、low → MEDIUM、low → HIGH) |
security_result.description |
security_result.summary |
已重新命名/對應 |
application |
target.application |
直接對應 |
endpoint_id |
target.asset_id |
直接對應 |
f_path |
target.file.full_path |
直接對應 |
f_size |
target.file.size |
已重新命名/對應 |
dhost |
target.hostname |
直接對應 |
host |
target.hostname |
直接對應 |
application |
target.process.file.full_path |
直接對應 |
customer_id |
target.resource.id |
直接對應 |
e_type |
target.resource.name |
對應:SavDisabled → Real time protection、OutOfDate → Device Registration、`Regist... |
p_device |
target.resource.name |
直接對應 |
scan_name |
target.resource.name |
直接對應 |
type |
target.resource.name |
對應:Event::Endpoint::SavDisabled → Real time protection、`Event::Endpoint::OutOfDate... |
action |
target.resource.type |
已對應:blocked → Device、restricted to read-only → Device |
e_type |
target.resource.type |
對應值 (共 5 個,例如 SavDisabled → SETTING、OutOfDate → SETTING、「已註冊」... |
type |
target.resource.type |
對應值 (共 5 個,例如 Event::Endpoint::SavDisabled → SETTING、`Event::Endpoint::O... |
url |
target.url |
直接對應 |
duid |
target.user.userid |
直接對應 |
suser |
target.user.userid |
直接對應 |
user |
target.user.userid |
直接對應 |
| 不適用 | metadata.event_type |
常數:GENERIC_EVENT |
| 不適用 | metadata.product_name |
常數:Sophos Anti-Virus |
| 不適用 | 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 專家尋求解答。