收集 STIX 威脅情報記錄
本文說明如何使用 Bindplane 代理程式,將 STIX 威脅情報記錄檔擷取至 Google Security Operations。
STIX (結構化威脅資訊表達) 是一種標準化語言和格式,用於在組織之間共用入侵指標 (IOC) 和威脅情報資料。STIX 資料通常會以 JSON 或 XML 檔案的形式,從 TAXII 伺服器或威脅情報平台接收。Bindplane 代理程式會直接從本機檔案系統收集 STIX 資料檔案。
事前準備
請確認您符合下列必要條件:
- Google SecOps 執行個體
- Windows Server 2016 以上版本,或搭載
systemd的 Linux 主機 - 如果是在 Proxy 後方執行,請確認防火牆通訊埠已按照 Bindplane 代理程式規定開啟
- TAXII 用戶端或威脅情報平台,可將 STIX 格式的檔案 (JSON 或 XML) 儲存至本機目錄
取得 Bindplane 代理程式的 Google SecOps 憑證
如要向 Google SecOps 驗證 Bindplane 代理程式,請選擇下列其中一種方法:
- 新部署作業:使用 Chronicle API (選項 1)。
- 舊版部署作業:在 2027 年 7 月 20 日停用 Ingestion API 前,請繼續使用擷取驗證檔案 (選項 2)。
方法 1:為 Chronicle API 建立服務帳戶 (建議)
- 登入 Google Cloud 控制台,選取連結至 Google SecOps 執行個體的 Google Cloud 專案。
- 依序前往 「IAM & Admin」(IAM 與管理) >「Service Accounts」(服務帳戶)。
- 按一下「建立服務帳戶」。
- 請提供下列設定詳細資料:
- 服務帳戶名稱:輸入帳戶名稱 (例如
bindplane-ingest)。 - 服務帳戶說明:輸入說明 (例如
Bindplane agent log ingestion)。
- 服務帳戶名稱:輸入帳戶名稱 (例如
- 點按「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 Settings」 > 「Collection Agents」。
- 下載擷取驗證檔案。
- 將檔案安全地儲存在要安裝 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等待安裝完成。
執行下列指令,確認安裝成功:
sc query observiq-otel-collector服務應顯示為「RUNNING」。
Linux 安裝
- 開啟具有根層級或 sudo 權限的終端機。
執行下列指令:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh等待安裝完成。
執行下列指令,確認安裝成功:
sudo systemctl status observiq-otel-collector服務應顯示為「active (running)」。
其他安裝資源
如需其他安裝選項和疑難排解資訊,請參閱 Bindplane 代理程式安裝指南。
設定 Bindplane 代理程式,擷取記錄並傳送至 Google SecOps
找出設定檔
Linux:
sudo nano /opt/observiq-otel-collector/config.yamlWindows:
notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
編輯設定檔
將
config.yaml的全部內容替換為下列設定:receivers: filelog: include: - /var/log/stix/*.json start_at: beginning exporters: chronicle/stix: 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 creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json' customer_id: '<customer_id>' endpoint: chronicle.googleapis.com log_type: STIX raw_log_field: body ingestion_labels: env: production service: pipelines: logs/stix_to_chronicle: receivers: - filelog exporters: - chronicle/stix
設定參數
替換下列預留位置:
接收器設定:
filelog:從磁碟收集記錄檔的接收器類型include:要監控的檔案路徑清單。將此設定為儲存 STIX 檔案的目錄:- Linux:
/var/log/stix/*.json - Windows:
C:\Logs\stix\*.json
- Linux:
start_at:設為beginning可讀取現有記錄,設為end則只會讀取新項目
匯出工具設定:
stix:匯出工具的說明名稱creds_file_path:服務帳戶 JSON 金鑰檔案的完整路徑 (選項 1):- Linux:
/opt/observiq-otel-collector/ingestion-auth.json - Windows:
C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
- Linux:
<customer_id>:上一步取得的客戶 IDlocation:將<LOCATION>替換為 Google SecOps 執行個體的區域 (例如us、europe或asia-southeast1)。匯出工具會以這個值做為chronicle.googleapis.com的前置字元。如需完整清單,請參閱「區域性端點」。project:依序前往「IAM 與管理」>「設定」,然後將<PROJECT_NUMBER>替換為專案編號。endpoint:請將此值設為chronicle.googleapis.com。STIX:記錄類型,與 Chronicle 中顯示的完全相同ingestion_labels:YAML 格式的選用標籤 (例如env: production)
管道設定:
stix_to_chronicle:管道的說明名稱
舊版擷取 API 匯出工具
如果您使用選項 2 的擷取驗證檔案,請將
exporters區塊替換為下列內容。將creds_file_path設為擷取驗證檔案的路徑,如果您的執行個體位於美國境外,請將malachiteingestion-pa.googleapis.com替換為區域端點 (例如europe-malachiteingestion-pa.googleapis.com)。exporters: chronicle/stix: compression: gzip creds_file_path: '/opt/observiq-otel-collector/ingestion-auth.json' customer_id: '<customer_id>' endpoint: malachiteingestion-pa.googleapis.com log_type: STIX raw_log_field: body ingestion_labels: env: production
儲存設定檔
- 編輯完成後,請儲存檔案:
- Linux:依序按下
Ctrl+O、Enter和Ctrl+X - Windows:依序點選「檔案」>「儲存」
- Linux:依序按下
重新啟動 Bindplane 代理程式,套用變更
如要在 Linux 重新啟動 Bindplane 代理程式,請執行下列指令:
sudo systemctl restart observiq-otel-collector確認服務正在執行:
sudo systemctl status observiq-otel-collector查看記錄檔是否有錯誤:
sudo journalctl -u observiq-otel-collector -f
如要在 Windows 中重新啟動 Bindplane 代理程式,請選擇下列其中一個選項:
以管理員身分開啟命令提示字元或 PowerShell:
net stop observiq-otel-collector && net start observiq-otel-collector服務控制台:
- 按下
Win+R,輸入services.msc,然後按下 Enter 鍵。 - 找出「observIQ OpenTelemetry Collector」。
- 按一下滑鼠右鍵,然後選取「重新啟動」。
確認服務正在執行:
sc query observiq-otel-collector檢查記錄是否有錯誤:
type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"
- 按下
設定 STIX 資料檔案收集
STIX 是資料格式,而非產品。STIX 威脅情報資料通常會以 JSON 或 XML 檔案的形式,從 TAXII 用戶端、威脅情報平台或手動下載取得。請務必將這些檔案放在 Bindplane 代理程式監控的目錄中。
Linux
建立目錄來儲存 STIX 資料檔案:
sudo mkdir -p /var/log/stix設定 TAXII 用戶端或威脅情報平台,將 STIX 檔案儲存至
/var/log/stix/。確認 Bindplane 代理程式服務帳戶具備目錄的讀取權限:
sudo chmod 755 /var/log/stix
Windows
建立目錄來儲存 STIX 資料檔案:
mkdir C:\Logs\stix設定 TAXII 用戶端或威脅情報平台,將 STIX 檔案儲存至「C:\Logs\stix」。
更新
config.yaml中的 Bindplane 代理程式include路徑,使其符合:include: - C:\Logs\stix\*.json
UDM 對應表
| 記錄欄位 | UDM 對應 | 邏輯 |
|---|---|---|
| entity.administrative_domain | 設為「TEST」 | |
| assetid_value | entity.asset.asset_id | 如果 assetid_value 不為空白,則使用該值 |
| condition_label, related_indicators_relationship_label, related_indicators_scope, indicator_types_label, valid_start_time_label, controlled_structure_label, marking_structure_label | entity.asset.attribute.labels | 從各種標籤合併 |
| 名稱 | entity.file.full_path | 直接複製值 |
| val、hash.simple_hash_value、MD5_val、hash_value | entity.file.md5 | 如果與 MD5 規則運算式相符,則為 val 中的值;如果類型為 MD5,則為 hash.simple_hash_value;如果類型為 MD5_val,則為 MD5_val;如果類型為 hash_value,則為 hash_value |
| 值 | entity.file.names | 直接複製值 |
| val、hash.simple_hash_value、sha1_val、hash_value | entity.file.sha1 | 如果與 sha1 規則運算式相符,則為 val 的值,否則如果類型為 SHA1,則為 hash.simple_hash_value,否則為 sha1_val,否則為 hash_value |
| val、hash.simple_hash_value、sha256val、sha_value、sha_value | entity.file.sha256 | 如果符合 sha256 規則運算式,則為 val 的值,否則如果類型為 SHA256,則為 hash.simple_hash_value,否則為 sha256val,否則為 sha_value |
| observable.object.properties.value, dom, value, host, name, external_references.0.source_name | entity.hostname | 如果類型為 FQDN,則為 observable.object.properties.value 的值;如果類型為網域名稱,則為 grok 的 dom;如果類型為網域名稱,則為值;如果類型為網域名稱,則為主機;如果類型為網域名稱,則為名稱;如果類型為網域名稱,則為 main_observable_type 網域/主機名稱;如果類型為網域名稱,則為 external_references.0.source_name |
| ip_val、ipval、ip、source_ip、value、src_ip | entity.ip | 如果 grok 相符,則為 ip_val 的值;如果類別為 ipv4-addr,則為 ipval;如果模式為 grok,則為 ip;否則為 source_ip;如果類型為 ipv4,則為 value;否則為 grok 中的 src_ip |
| source_port, src_port | entity.port | source_port 或 src_port 的值 |
| indicator_label、extension_value1、extension_value2、extension_value3、extension_value4、revoked_value、spec_version_value、object_marking_ref_value、label_value | entity.resource.attribute.labels | 從各種標籤合併 |
| observable.object.properties.value, url_val, value, observable_properties_value | entity.url | 如果類型為網址,則為 observable.object.properties.value 的值;否則為 grok 的 url_val;否則為類型為網址的值;否則為 observable_properties_value (如果非空白) |
| email_val, mail, value | entity.user.email_addresses | 如果 grok 相符,則為 email_val 的值;否則為 grok 中的郵件;否則為類型為 email-addr 的值 |
| 時間戳記 | metadata.collected_timestamp | 使用日期比對 ISO8601/RFC 3339 轉換 |
| 標題、說明 | metadata.description | 標題或說明的值 |
| entity_type | metadata.entity_type | 直接複製值 |
| timestamp, valid_until | metadata.interval.end_time | 使用日期比對 ISO8601/RFC 3339 從時間戳記或 valid_until 轉換 |
| timestamp、valid_from、created | metadata.interval.start_time | 從 timestamp、valid_from、created 或 timestamp 轉換而來,日期格式符合 ISO8601/RFC 3339 |
| id | metadata.product_entity_id | 直接複製值 |
| 版本 | metadata.product_version | 直接複製值 |
| threat_detail | metadata.threat | Merged from threat_detail |
| threat_detail_category | threat.category | 直接複製值 |
| confidence_value、confidence、x_stix_confidence、x_ctix_confidence_score | threat.confidence_details | 來自 confidence_value 的值,否則為 confidence (如果 no_value),否則為 x_stix_confidence,否則為 x_ctix_confidence_score |
| value, confidence, x_ctix_confidence_score | threat.confidence_score | 如果名稱為「信心分數」,則為「值」中的值;否則為「信心」;否則為「x_ctix_confidence_score」,並轉換為浮點數 |
| property_label、sha512_value、observable_id、observable_object_id、keyword_label | threat.detection_fields | 合併自多個標籤 |
| 說明 | threat.description | 直接複製值 |
| value, extensions.extension-definition--ea279b3e-5c71-4632-ac08-831c66a786ba.score | threat.risk_score | Value from value if name Risk, else extensions score, converted to float |
| metadata.product_name | 設為「STIX」 | |
| metadata.vendor_name | 設為「STIX」 | |
dom |
event.idm.entity.entity.hostname |
從變更記錄對應 |
name |
event.idm.entity.entity.url |
從變更記錄對應 |
valid_from |
event.idm.entity.entity.resource.attribute.labels |
從變更記錄對應 |
valid_until |
event.idm.entity.entity.resource.attribute.labels |
從變更記錄對應 |
pattern_version |
event.idm.entity.entity.resource.attribute.labels |
從變更記錄對應 |
observable.object.properties.value.condition |
event.idm.entity.entity.asset.attribute.labels |
從變更記錄對應 |
handling.controlled_structure |
event.idm.entity.entity.asset.attribute.labels |
從變更記錄對應 |
handling.marking_structures.color |
event.idm.entity.entity.asset.attribute.labels |
從變更記錄對應 |
related_indicators.related_indicators |
event.idm.entity.entity.asset.attribute.labels |
從變更記錄對應 |
related_indicators.scope |
event.idm.entity.entity.asset.attribute.labels |
從變更記錄對應 |
indicator_types |
event.idm.entity.entity.asset.attribute.labels |
從變更記錄對應 |
valid_time_positions |
event.idm.entity.entity.asset.attribute.labels |
從變更記錄對應 |
observable.object.properties.custom_properties |
event.idm.entity.metadata.threat.detection_fields |
從變更記錄對應 |
observable.object.properties.value |
event.ioc.domain_and_ports.domain |
從變更記錄對應 |
mitre-extension-definition.extension_type |
entity.resource.attribute.labels.value |
從變更記錄對應 |
sco-extension-definition.extension_type |
entity.resource.attribute.labels.value |
從變更記錄對應 |
x_ctix_confidence_score |
threat_detail.confidence_score |
從變更記錄對應 |
modified |
timestamp |
從變更記錄對應 |
valid_from |
entity_event.metadata.interval.start_time |
從變更記錄對應 |
confidence |
threat_detail.confidence_score |
從變更記錄對應 |
name |
entity.entity.file.full_path |
從變更記錄對應 |
description |
threat_detail.description |
從變更記錄對應 |
external_references.0.source_name |
entity_event.entity.hostname |
從變更記錄對應 |
entity_type |
IP_ADDRESS |
從變更記錄對應 |
entity_type |
USER |
從變更記錄對應 |
entity_type |
FILE |
從變更記錄對應 |
entity_type |
DOMAIN_NAME |
從變更記錄對應 |
變更記錄
還有其他問題嗎?向社群成員和 Google SecOps 專家尋求解答。