收集 Apple macOS 系統記錄檔資料

支援的國家/地區:

這個剖析器會使用 grok 模式,從 Apple macOS 系統記錄訊息中擷取欄位,並以擷取的值填入統一資料模型 (UDM),包括時間戳記、主機名稱、中介主機、指令列、程序 ID 和說明。如果存在主機名稱,剖析器會將事件歸類為 STATUS_UPDATE;否則,剖析器會將事件歸類為 GENERIC_EVENT。最後,剖析器會使用供應商和產品資訊,擴充 UDM 事件。

事前準備

  • 確認您有 Google Security Operations 執行個體。
  • 確認您具備 Auditd 主機的根存取權。
  • 確認您已在 Auditd 主機上安裝 rsyslog。
  • 請確認您有 Windows 2012 SP2 以上版本或 Linux 主機 (含 systemd)。
  • 如果透過 Proxy 執行,請確認防火牆通訊埠已開啟。

取得 Google SecOps 擷取驗證檔案

  1. 登入 Google SecOps 控制台。
  2. 依序前往「SIEM 設定」>「收集代理程式」
  3. 下載擷取驗證檔案

取得 Google SecOps 客戶 ID

  1. 登入 Google SecOps 控制台。
  2. 依序前往「SIEM 設定」>「設定檔」
  3. 複製並儲存「機構詳細資料」專區中的客戶 ID

安裝 Bindplane 代理程式

  1. 如要在 Windows 上安裝,請執行下列指令碼:
    msiexec /i "https://github.com/observIQ/bindplane-agent/releases/latest/download/observiq-otel-collector.msi" /quiet
  2. 如要在 Linux 上安裝,請執行下列指令碼:
    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
  3. 如需其他安裝選項,請參閱這份安裝指南

設定 Bindplane 代理程式,擷取系統記錄檔並傳送至 Google SecOps

  1. 存取安裝 Bindplane 代理程式的機器。
  2. 按照下列方式編輯 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
    
  3. 使用下列指令重新啟動 Bindplane 代理程式,以套用變更: sudo systemctl bindplane restart

從 macOS 匯出系統記錄檔

  1. 使用 Homebrew 安裝 syslog-ng

    brew install syslog-ng
    
  2. 設定 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 位址和連接埠:
    source s_local { system(); internal(); };
    destination d_secops { tcp("<BindPlaneAgent_IP>:<BindPlaneAgent_Port>"); };
    log { source(s_local); destination(d_secops); };
    
  3. 重新啟動 syslog-ng 服務:

    brew services restart syslog-ng
    
  4. 檢查 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 程序 ID 是使用 grok 模式從 data 欄位擷取而來。
資料 read_only_udm.metadata.event_timestamp 系統會使用 grok 模式從 data 欄位擷取事件時間戳記,並轉換為時間戳記物件。在剖析器中硬式編碼為「MacOS」。在剖析器中硬式編碼為「Apple」。如果從記錄中擷取了主機名稱,請設為「STATUS_UPDATE」,否則請設為「GENERIC_EVENT」。
log_type read_only_udm.metadata.log_type 直接從原始記錄的 log_type 欄位對應。

還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。