收集 Apple macOS 系統記錄檔資料
支援以下發布途徑:
Google secops
Siem
這個剖析器會使用 Grok 模式,從 Apple macOS 系統記錄檔訊息中擷取欄位,並在統一資料模型 (UDM) 中填入擷取的值,包括時間戳記、主機名稱、中介主機、指令列、程序 ID 和說明。如果有主機名稱,剖析器會將事件分類為 STATUS_UPDATE
;否則,會將類別 GENERIC_EVENT
指派給事件。最後,剖析器會在 UDM 事件中加入供應商和產品資訊。
事前準備
- 確認您有 Google Security Operations 執行個體。
- 確認您具備受稽核主機的根存取權。
- 請確認您已在 Auditd 主機上安裝 rsyslog。
- 請確認您有 Windows 2012 SP2 以上版本或 Linux 主機 (含 systemd)。
- 如果在 Proxy 後方執行,請確認防火牆通訊埠已開啟。
取得 Google SecOps 擷取驗證檔案
- 登入 Google SecOps 控制台。
- 依序前往「SIEM 設定」>「收集代理程式」。
- 下載擷取驗證檔案。
取得 Google SecOps 客戶 ID
- 登入 Google SecOps 控制台。
- 依序前往「SIEM 設定」>「設定檔」。
- 複製並儲存「機構詳細資料」部分中的客戶 ID。
安裝 Bindplane 代理程式
- 如要在 Windows 上安裝,請執行以下指令碼:
msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
。 - 如要安裝 Linux,請執行下列指令碼:
sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
。 - 如需其他安裝選項,請參閱這份安裝指南。
設定 Bindplane Agent 擷取 Syslog 並傳送至 Google SecOps
- 存取已安裝 Bindplane Agent 的電腦。
按照下列方式編輯
config.yaml
檔案:receivers: tcplog: # Replace the below port <54525> and IP <0.0.0.0> with your specific values listen_address: "0.0.0.0:54525" exporters: chronicle/chronicle_w_labels: compression: gzip # Adjust the creds location below according the placement of the credentials file you downloaded creds: '{ json file for creds }' # Replace <customer_id> below with your actual ID that you copied customer_id: <customer_id> endpoint: malachiteingestion-pa.googleapis.com # You can apply ingestion labels below as preferred ingestion_labels: log_type: SYSLOG namespace: auditd raw_log_field: body service: pipelines: logs/source0__chronicle_w_labels-0: receivers: - tcplog exporters: - chronicle/chronicle_w_labels
重新啟動 Bindplane 代理程式,使用下列指令套用變更:
sudo systemctl bindplane restart
從 macOS 匯出 Syslog
使用 Homebrew 安裝
syslog-ng
:brew install syslog-ng
設定 syslog-ng:
- 編輯
syslog-ng.conf
檔案 (通常位於/usr/local/etc/syslog-ng/syslog-ng.conf
):
sudo vi /usr/local/etc/syslog-ng/syslog-ng.conf
- 新增下列設定區塊。
- 視 Bindplane 設定而定,您可以將提交方式變更為
tcp
,或維持udp
。 - 請將
<BindPlaneAgent_IP>
和<BindPlaneAgent_Port>
替換為 Bindplane 服務代理的實際 IP 位址和連接埠:
- 視 Bindplane 設定而定,您可以將提交方式變更為
source s_local { system(); internal(); }; destination d_secops { tcp("<BindPlaneAgent_IP>:<BindPlaneAgent_Port>"); }; log { source(s_local); destination(d_secops); };
- 編輯
重新啟動
syslog-ng
服務:brew services restart syslog-ng
查看
syslog-ng
的狀態 (syslog-ng
應顯示為已啟動):brew services list
UDM 對應表
記錄欄位 | UDM 對應 | 邏輯 |
---|---|---|
資料 | read_only_udm.metadata.description | 系統會使用 grok 模式,從原始記錄檔中的 data 欄位擷取 description 欄位的值。 |
資料 | read_only_udm.principal.hostname | 系統會使用 grok 模式,從 data 欄位中擷取主機名稱。 |
資料 | read_only_udm.intermediary.hostname | 系統會使用 grok 模式,從 data 欄位中擷取中介主機名稱。 |
資料 | read_only_udm.principal.process.command_line | 系統會使用 grok 模式,從 data 欄位擷取程序指令列。 |
資料 | read_only_udm.principal.process.pid | 使用 grok 模式從 data 欄位擷取程序 ID。 |
資料 | read_only_udm.metadata.event_timestamp | 系統會使用 grok 模式從 data 欄位擷取事件時間戳記,並轉換為時間戳記物件。在剖析器中硬式編碼為「MacOS」。在剖析器中硬式編碼為「Apple」。如果從記錄中擷取主機名稱,請將其設為「STATUS_UPDATE」;否則,請將其設為「GENERIC_EVENT」。 |
log_type | read_only_udm.metadata.log_type | 直接從原始記錄的 log_type 欄位對應。 |
異動
2022-05-04
- 新建的剖析器。
還有其他問題嗎?向社群成員和 Google SecOps 專家尋求解答。