收集 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) 儲存至本機目錄
取得 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" /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服務應顯示為有效 (執行中)。
其他安裝資源
如需其他安裝選項和疑難排解資訊,請參閱 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: compression: gzip creds_file_path: '/etc/bindplane-agent/ingestion-auth.json' customer_id: '<customer_id>' endpoint: malachiteingestion-pa.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:擷取驗證檔案的完整路徑:- Linux:
/etc/bindplane-agent/ingestion-auth.json - Windows:
C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
- Linux:
<customer_id>:上一步中的客戶 IDendpoint:區域端點網址:- 美國:
malachiteingestion-pa.googleapis.com - 歐洲:
europe-malachiteingestion-pa.googleapis.com - 亞洲:
asia-southeast1-malachiteingestion-pa.googleapis.com - 如需完整清單,請參閱「區域端點」
- 美國:
STIX:記錄類型,與 Chronicle 中顯示的完全相同ingestion_labels:YAML 格式的選用標籤 (例如env: production)
管道設定:
stix_to_chronicle:管道的說明名稱
儲存設定檔
- 編輯完成後,請儲存檔案:
- 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;否則為 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;如果類型為 ipv4,則為 source_ip;如果類型為 ipv4,則為 value;如果類型為 ipv4,則為 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 | 如果類型為 URL,則為 observable.object.properties.value 中的值;否則為 grok 中的 url_val;否則如果類型為 URL,則為值;否則如果 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 轉換 |
| 時間戳記、valid_from、created | metadata.interval.start_time | 從時間戳記、valid_from、created 或時間戳記轉換而來,使用日期比對 ISO8601/RFC 3339 |
| id | metadata.product_entity_id | 直接複製值 |
| 版本 | metadata.product_version | 直接複製值 |
| threat_detail | metadata.threat | 從 threat_detail 合併 |
| threat_detail_category | threat.category | 直接複製值 |
| confidence_value、confidence、x_stix_confidence、x_ctix_confidence_score | threat.confidence_details | 信心值 (confidence_value),如果沒有值,則為信心 (confidence),如果沒有值,則為 x_stix_confidence,如果沒有值,則為 x_ctix_confidence_score |
| 值、信賴度、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 專業人員尋求答案。