收集 OpenLDAP 記錄
本文說明如何使用 Bindplane,將 OpenLDAP 記錄檔擷取至 Google Security Operations。
OpenLDAP 是開放原始碼的 LDAP 目錄伺服器,可產生存取、稽核和複製記錄。剖析器會從 OpenLDAP 記錄項目中擷取欄位,並對應至整合式資料模型 (UDM),擷取使用者身分、驗證事件、LDAP 作業和安全性結果。
事前準備
請確認您已完成下列事前準備事項:
- Google SecOps 執行個體
- Windows Server 2016 以上版本,或搭載
systemd的 Linux 主機 - Bindplane 代理程式與 OpenLDAP 伺服器之間的網路連線
- 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟
- 具備根層級或管理員權限的 OpenLDAP 伺服器特殊存取權
取得 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 systemctl status observiq-otel-collectorWindows:
notepad "C:\Program Files\observIQ OpenTelemetry Collector\config.yaml"
編輯設定檔
將
config.yaml的所有內容替換為下列設定:receivers: udplog: listen_address: "0.0.0.0:514" exporters: chronicle/openldap: compression: gzip creds_file_path: '/etc/bindplane-agent/ingestion-auth.json' customer_id: '<customer_id>' endpoint: malachiteingestion-pa.googleapis.com log_type: OPENLDAP raw_log_field: body service: pipelines: logs/openldap: receivers: - udplog exporters: - chronicle/openldap
設定參數
替換下列預留位置:
接收器設定:
udplog:根據通訊協定的接收器類型:udplog(適用於 UDP 系統記錄檔)tcplog(適用於 TCP Syslog)syslog適用於 RFC 3164/5424 syslog
0.0.0.0:要接聽的 IP 位址:0.0.0.0,監聽所有介面 (建議)- 在一個介面上接聽的特定 IP 位址
514:要接聽的通訊埠號碼 (例如514、1514、6514)
匯出工具設定:
<customer_id>:先前步驟中的客戶 IDmalachiteingestion-pa.googleapis.com:區域端點網址:- 美國:
malachiteingestion-pa.googleapis.com - 歐洲:
europe-malachiteingestion-pa.googleapis.com - 亞洲:
asia-southeast1-malachiteingestion-pa.googleapis.com - 如需完整清單,請參閱「區域端點」
- 美國:
- 根據平台調整
creds_file_path:- Linux:
/etc/bindplane-agent/ingestion-auth.json - Windows:
C:\Program Files\observIQ OpenTelemetry Collector\ingestion-auth.json
- Linux:
儲存設定檔
- 編輯完成後,請儲存檔案:
- 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"
設定 OpenLDAP 系統記錄檔轉送
您可以設定 OpenLDAP (slapd) 透過系統記錄檔記錄。設定 syslog daemon,將 OpenLDAP 記錄轉送至 Bindplane 代理程式。
確認 OpenLDAP 已設定為記錄到系統記錄檔。檢查
slapd.conf或cn=config是否有loglevel指令:loglevel stats conns根據預設,OpenLDAP 會將記錄檔傳送至
local4syslog 設備。設定 rsyslog,將這些記錄轉送至 Bindplane 代理程式。建立設定檔:sudo nano /etc/rsyslog.d/openldap-forward.conf新增下列內容:
local4.* @BINDPLANE_AGENT_IP:514重新啟動 rsyslog 服務:
sudo systemctl restart rsyslog
UDM 對應表
| 記錄欄位 | UDM 對應 | 邏輯 |
|---|---|---|
| op、fd、ou、cn、dc、dc1、base1、base2、base3、scope_data、valueData、method、filter、tag_data、err、attrData、ou_2、ou_1、syslog_message、immutable_user_id、resource | additional.fields | 與從這些欄位建立的標籤合併 |
| extensions.auth.type | 設為「AUTHTYPE_UNSPECIFIED」 | |
| caller_ip、proxy1_ip、proxy2_ip | 中介 | 從中介、proxy_1、proxy_2 合併 |
| msg1, inner_message | metadata.description | 來自 msg1 或 inner_message 的值 |
| metadata.event_type | 一開始設為「GENERIC_EVENT」,如果主體 IP 存在,則設為「STATUS_UPDATE」,如果使用者存在,則設為「USER_UNCATEGORIZED」,如果時間戳記或 inner_ts 存在,則設為「USER_LOGIN」 | |
| ldap_action | metadata.product_event_type | ldap_action 的值 (小寫) |
| ldap_conn | metadata.product_log_id | 從 ldap_conn 移除「conn=」後的值 |
| user_agent | network.http.user_agent | 直接複製值 |
| session_id | network.session_id | 直接複製值 |
| principal_ip、prin_ip、caller_ip、r_ip_or_host、proxy_client_ip、src_ip、client_ip | principal.asset.ip | 從 principal_ip (以 . 取代 - 後)、prin_ip、caller_ip、r_ip_or_host (如果是 IP)、proxy_client_ip、src_ip、client_ip 合併 |
| r_ip_or_host、src_host | principal.hostname | 如果為主機名稱,則為 r_ip_or_host 的值,否則為 src_host |
| principal_ip、prin_ip、caller_ip、r_ip_or_host、proxy_client_ip、src_ip、client_ip | principal.ip | 從 principal_ip (以 . 取代 - 後)、prin_ip、caller_ip、r_ip_or_host (如果是 IP)、proxy_client_ip、src_ip、client_ip 合併 |
| 國家/地區 | principal.location.country_or_region | 直接複製值 |
| prin_port、port、src_port | principal.port | 從 prin_port、port 或 src_port 轉換為整數的值 |
| syslog_process | principal.process.file.full_path | 直接複製值 |
| syslog_pid | principal.process.pid | 直接複製值 |
| org_name | principal.user.company_name | 直接複製值 |
| 使用者、cn、uid | principal.user.userid | 使用者、cn 或 uid 的值 |
| security_result | security_result | 直接合併 |
| action、sec_action | security_result.action | 動作值 (根據錯誤代碼) 或 sec_action (根據登入狀態) |
| resource、immutable_user_id | security_result.detection_fields | 與資源和 immutable_user_id 中的標籤合併 |
| inner_descrption、security_description | security_result.description | inner_descrption 或 security_description 的值 |
| tuser、username、userid | target.user.userid | 來自 tuser、使用者名稱或使用者 ID 的值 |
| metadata.product_name | 設為「OpenLDAP」 | |
| metadata.vendor_name | 設為「OpenLDAP」 | |
eventType |
event.idm.read_only_udm.metadata.product_event_type |
從變更記錄對應 |
cn |
event.idm.read_only_udm.additional.fields |
從變更記錄對應 |
sequenceId |
event.idm.read_only_udm.additional.fields |
從變更記錄對應 |
dc_2 |
event.idm.read_only_udm.additional.fields |
從變更記錄對應 |
dc_3 |
event.idm.read_only_udm.additional.fields |
從變更記錄對應 |
dc |
event.idm.read_only_udm.additional.fields |
從變更記錄對應 |
dc_1 |
event.idm.read_only_udm.additional.fields |
從變更記錄對應 |
user |
event.idm.read_only_udm.principal.user.userid |
從變更記錄對應 |
path |
event.idm.read_only_udm.principal.process.file.full_path |
從變更記錄對應 |
ip1 |
principal.ip |
從變更記錄對應 |
base", "err", "attr", "tag", "scope", and "valueData |
additional.fields |
從變更記錄對應 |
security_result.action |
ALLOW |
從變更記錄對應 |
security_result.action |
BLOCK |
從變更記錄對應 |
變更記錄
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。