收集 Fortinet FortiClient 記錄
本文說明如何使用 Bindplane 代理程式,將 Fortinet FortiClient 記錄檔擷取至 Google Security Operations。
FortiClient 是端點安全防護解決方案,可為 Windows、macOS、Linux 和 Chromebook 端點提供防毒、網頁篩選、VPN、漏洞掃描和應用程式防火牆功能。FortiClient 是透過 FortiClient EMS (端點管理伺服器) 集中管理,可將安全政策和設定檔推送至端點。
事前準備
請確認您已完成下列事前準備事項:
- Google SecOps 執行個體
- Windows Server 2016 以上版本,或搭載 systemd 的 Linux 主機
- Bindplane 代理程式與 FortiClient 端點之間的網路連線
- 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟
- FortiClient EMS 管理控制台的特殊存取權
- FortiClient EMS 7.0 以上版本,且 FortiClient 端點已取得授權
取得 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 /etc/bindplane-agent/config.yaml
Windows:
notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
編輯設定檔
將 config.yaml 的所有內容替換為下列設定:
receivers:
udplog:
listen_address: "0.0.0.0:514"
exporters:
chronicle/forticlient:
compression: gzip
creds_file_path: '/etc/bindplane-agent/ingestion-auth.json'
customer_id: 'your-customer-id-here'
endpoint: malachiteingestion-pa.googleapis.com
log_type: FORTINET_FORTICLIENT
raw_log_field: body
ingestion_labels:
env: production
source: forticlient
service:
pipelines:
logs/forticlient_to_chronicle:
receivers:
- udplog
exporters:
- chronicle/forticlient
設定參數
請替換下列預留位置:
接收器設定:
listen_address:要接聽的 IP 位址和通訊埠。使用0.0.0.0:514監聽通訊埠 514 上的所有介面。
匯出工具設定:
creds_file_path:擷取驗證檔案的完整路徑:- Linux:
/etc/bindplane-agent/ingestion-auth.json - Windows:
C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
- Linux:
customer_id:Google SecOps 控制台中的客戶 IDendpoint:區域端點網址:- 美國:
malachiteingestion-pa.googleapis.com - 歐洲:
europe-malachiteingestion-pa.googleapis.com - 亞洲:
asia-southeast1-malachiteingestion-pa.googleapis.com - 如需完整清單,請參閱「區域端點」
- 美國:
log_type:FORTINET_FORTICLIENTingestion_labels:YAML 格式的選用標籤
儲存設定檔
編輯完成後,請儲存檔案:
- Linux:依序按下
Ctrl+O、Enter和Ctrl+X - Windows:依序點選「檔案」>「儲存」
重新啟動 Bindplane 代理程式,以套用變更
Linux
sudo systemctl restart observiq-otel-collector確認服務正在執行:
sudo systemctl status observiq-otel-collector檢查記錄中是否有錯誤:
sudo journalctl -u observiq-otel-collector -f
Windows
選擇下列其中一個選項:
以管理員身分使用命令提示字元或 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"
- 按下
設定 FortiClient 端點記錄功能,將記錄傳送至 Bindplane 代理程式
透過 FortiClient EMS 編輯 XML 設定的端點設定檔,即可集中設定 FortiClient 端點記錄。EMS 會將記錄設定推送至 FortiClient 端點,然後這些端點會將記錄直接傳送至 Bindplane 代理程式的 syslog 監聽器。
登入 FortiClient EMS
- 登入 FortiClient EMS 網頁版控制台。
- 依序前往「端點設定檔」>「管理設定檔」。
編輯或建立端點設定檔
- 選取要編輯的現有設定檔,或按一下「新增」建立新設定檔。
- 在「設定檔名稱」欄位中,輸入描述性名稱 (例如
Chronicle-Logging-Profile)。 - 按一下 [進階]。
- 按一下「XML Configuration」(XML 設定) 分頁標籤。
- 按一下 [編輯]。
在 XML 中設定遠端記錄
EMS 會顯示兩個窗格。使用右側窗格編輯 XML 設定。
在 <system> 中找出 <log_settings> 部分。如果沒有,請新增該欄位。在 <log_settings> 中,找出或新增 <remote_logging> 區段,然後依下列方式設定:
<forticlient_configuration>
<system>
<log_settings>
<onnet_local_logging>1</onnet_local_logging>
<level>6</level>
<log_events>ipsecvpn,sslvpn,scheduler,update,firewall,av,proxy,shield,webfilter,endpoint,fssoma,configd,vuln,sandboxing,antiexploit</log_events>
<remote_logging>
<log_upload_enabled>1</log_upload_enabled>
<log_protocol>syslog</log_protocol>
<netlog_server>192.168.1.100</netlog_server>
<netlog_categories>7</netlog_categories>
<log_upload_freq_minutes>5</log_upload_freq_minutes>
</remote_logging>
</log_settings>
</system>
</forticlient_configuration>
設定參數:
<log_upload_enabled>:設為1即可啟用遠端記錄。<log_protocol>:設為syslog,將記錄傳送至系統記錄伺服器。請改用faz將記錄傳送至 FortiAnalyzer。<netlog_server>:輸入 Bindplane 代理程式主機的 IP 位址 (例如192.168.1.100)。只有在<log_protocol>設為syslog時,才會使用這個參數。<netlog_categories>:輸入要上傳的記錄類別位元遮罩:1= 流量記錄2= 安全漏洞記錄4= 事件記錄7= 所有類別 (1 + 2 + 4)
<log_upload_freq_minutes>:輸入記錄上傳頻率 (以分鐘為單位),例如5代表每 5 分鐘。<level>:FortiClient 記錄層級。輸入下列其中一項:0= 緊急1= 警示2= 重大3= 錯誤4= 警告5= 通知6= 資訊 (建議)7= Debug
<log_events>:以半形逗號分隔的 FortiClient 事件或程序清單,用於記錄。納入要擷取的事件 (例如ipsecvpn,sslvpn,firewall,av,webfilter,endpoint)。
儲存設定檔
- 按一下「測試 XML」,驗證 XML 設定。
- 按一下「儲存」即可儲存設定檔。
將設定檔套用至端點
- 依序前往「端點政策」>「管理政策」。
- 選取現有政策,或按一下「新增」建立新政策。
- 在「設定檔」下拉式選單中,選取您建立或編輯的設定檔。
- 在「端點群組」部分,選取要套用政策的端點群組。
- 按一下 [儲存]。
EMS 會在下次遙測通訊時,將設定檔設定推送至端點。FortiClient 端點會開始將記錄傳送至 Bindplane 代理程式的 Syslog 監聽器。
確認記錄轉送
在 Bindplane 代理程式主機上,查看代理程式記錄,確認是否收到記錄:
Linux:
sudo journalctl -u observiq-otel-collector -fWindows:
type "C:\Program Files\observIQ OpenTelemetry Collector\log\collector.log"在 FortiClient 端點上,檢查 FortiClient 記錄,確認是否已啟用遠端記錄功能:
Windows:
C:\Program Files\Fortinet\FortiClient\logs\macOS:
/Library/Application Support/Fortinet/FortiClient/logs/Linux:
/var/log/forticlient/在 Google SecOps 控制台中,確認系統是否正在擷取 FortiClient 記錄:
- 前往「搜尋」。
- 輸入 FortiClient 記錄的搜尋查詢 (例如
metadata.log_type = "FORTINET_FORTICLIENT")。 - 確認搜尋結果中顯示記錄。
UDM 對應表
| 記錄欄位 | UDM 對應 | 邏輯 |
|---|---|---|
| emsserial、devid、usingpolicy、itime、fctsn、logver、site、fctver、browsetime、event_id、SubjectUserName、SubjectLogonId、ThreadID | additional.fields | 使用每個欄位的鍵和值建立標籤,並合併至 additional.fields |
| 時間戳記 | metadata.collected_timestamp | 剖析為 UNIX 時間戳記 |
| ts | metadata.event_timestamp | 使用「MMM d HH:mm:ss」、「MMM d HH:mm:ss」、「yyyy-MM-dd HH:mm:ss」格式,透過日期篩選器剖析 |
| deviceip、client_ip、devicemac、hostname、user、uid | metadata.event_type | 如果使用者/uid 和機器 ID 都存在,則設為 USER_RESOURCE_ACCESS;如果機器 ID 存在,則設為 USER_UNCATEGORIZED;否則設為 GENERIC_EVENT |
| eventtype | metadata.product_event_type | 直接複製值 |
| id | metadata.product_log_id | 已轉換為字串,並複製值 |
| 服務 | network.application_protocol | 大寫,然後在符合清單時設為預先定義的通訊協定 (例如 「SSH」(適用於「22」、「SSH」、「SSHD」);「HTTP」(適用於「80」、「8080」、「HTTP」),否則為擴充清單中的服務,否則為空白 |
| 方向 | network.direction | 如果符合 (?i)inbound,請設為 INBOUND;如果符合 (?i)outbound,請設為 OUTBOUND |
| proto | network.ip_protocol | 如果 proto ==「6」,則設為「TCP」 |
| rcvdbyte | network.received_bytes | 轉換為 uinteger,如果不是空白/0,則複製值 |
| sentbyte | network.sent_bytes | 轉換為 uinteger,如果不是空白/0,則複製值 |
| sessionid | network.session_id | 直接複製值 |
| pcdomain | principal.administrative_domain | 直接複製值 |
| srcproduct | principal.application | 直接複製值 |
| 主機名稱 | principal.hostname | 直接複製值 |
| deviceip、client_ip | principal.ip | 如果 deviceip 不為空值,則為 deviceip 的值;否則,如果 client_ip 是有效 IP,則為 client_ip 的值 |
| devicemac | principal.mac | 轉換為 MAC 格式,如果有效則複製值 |
| os、source | principal.platform | 如果 os/source 符合 (?i)windows,請設為 WINDOWS;如果符合 (?i)mac|ios,請設為 MAC;如果符合 (?i)linux,請設為 LINUX |
| source_ver | principal.platform_version | 直接複製值 |
| srcport | principal.port | 已轉換為整數,並複製值 |
| ProcessId | principal.process.pid | 直接複製值 |
| srcname、source_type、type | principal.resource.attribute.labels | 使用每個欄位的鍵和值建立標籤,並合併至 attribute.labels |
| devname | principal.resource.name | 直接複製值 |
| ProviderGuid | principal.resource.product_object_id | 直接複製值 |
| 子類型 | principal.resource.resource_subtype | 直接複製值 |
| 網址 | principal.url | 直接複製值 |
| uid、fctuid | principal.user.product_object_id | 如果 uid 不是空白,則為 uid 的值,否則為 fctuid |
| 使用者 | principal.user.user_display_name | 直接複製值 |
| 使用者 | principal.user.userid | 直接複製值 |
| SubjectUserSid | principal.user.windows_sid | 如果符合 SID 規則運算式,系統會複製值 |
| utmaction | security_result.action | 如果位於 [accept,allow,passthrough,pass,permit,detected] 中,則設為 ALLOW;如果位於 [deny,dropped,blocked,block] 中,則設為 BLOCK;否則設為 UNKNOWN_ACTION |
| utmevent | security_result.category_details | 直接複製值 |
| utmaction | security_result.description | 設為「utmaction: |
| userinitiated | security_result.detection_fields | 使用索引鍵「userinitiated」和來自 userinitiated 的值建立的標籤,已合併 |
| level | security_result.severity | 如果層級 ==「info」,則設為 INFORMATIONAL |
| 威脅 | security_result.threat_name | 直接複製值 |
| emshostname、remotename | target.hostname | 如果 emshostname 不是空白,則為該值,否則為 remotename |
| dstip | target.ip | 從 dstip 擷取有效的 IP |
| dstport | target.port | 轉換為整數,如果不是 0 則複製值 |
| metadata.product_name | 設為「FORTINET_FORTICLIENT」 | |
| metadata.vendor_name | 設為「FORTINET_FORTICLIENT」 |
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。