收集 Red Hat Directory Server LDAP 記錄

支援的國家/地區:

本文說明如何使用 Bindplane 代理程式,將 Red Hat Directory Server LDAP 記錄擷取至 Google Security Operations。

Red Hat Directory Server 是以開放標準為基礎建構的企業級 LDAP 目錄服務,可為 Linux 和 UNIX 環境提供集中式使用者身分管理、驗證和存取控管。目錄伺服器會在 /var/log/dirsrv/slapd-instance_name/ 目錄中儲存存取、錯誤、稽核、稽核失敗和安全性記錄,記錄用戶端連線、LDAP 作業、設定變更、失敗作業和安全性事件,例如驗證嘗試和授權問題。

事前準備

請確認您已完成下列事前準備事項:

  • Google SecOps 執行個體
  • 搭載 systemd 的 Linux 主機
  • Bindplane 代理程式與 Red Hat Directory Server 主機之間的網路連線
  • 如果透過 Proxy 執行,請確保防火牆通訊埠已根據 Bindplane 代理程式需求開啟
  • Red Hat Directory Server 主機的 root 或 sudo 存取權
  • 已安裝並執行 Red Hat Directory Server 11 以上版本
  • 在目錄伺服器主機上安裝及執行的 rsyslog 服務

取得 Google SecOps 擷取驗證檔案

  1. 登入 Google SecOps 控制台。
  2. 依序前往「SIEM 設定」>「收集代理程式」
  3. 下載擷取驗證檔案
  4. 將檔案安全地儲存在要安裝 Bindplane 的系統上。

取得 Google SecOps 客戶 ID

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

安裝 Bindplane 代理程式

按照下列操作說明,在 Linux 作業系統上安裝 Bindplane 代理程式。

Linux 安裝

  1. 開啟具有根層級或 sudo 權限的終端機。
  2. 執行下列指令:

    sudo sh -c "$(curl -fsSlL https://github.com/observiq/bindplane-agent/releases/latest/download/install_unix.sh)" install_unix.sh
    
  3. 等待安裝完成。

  4. 執行下列指令,確認安裝成功:

    sudo systemctl status observiq-otel-collector
    

    服務應顯示為有效 (執行中)

其他安裝資源

如需其他安裝選項和疑難排解資訊,請參閱 Bindplane 代理程式安裝指南

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

找出設定檔

  • Linux:

    sudo nano /opt/observiq-otel-collector/config.yaml
    

編輯設定檔

  • config.yaml 的所有內容替換為下列設定:

    receivers:
        udplog:
            listen_address: "0.0.0.0:514"
    
    exporters:
        chronicle/redhat_ds:
            compression: gzip
            creds_file_path: '/etc/bindplane-agent/ingestion-auth.json'
            customer_id: '<customer_id>'
            endpoint: malachiteingestion-pa.googleapis.com
            log_type: REDHAT_DIRECTORY_SERVER
            raw_log_field: body
    
    service:
        pipelines:
            logs/redhat_ds:
                receivers:
                    - udplog
                exporters:
                    - chronicle/redhat_ds
    

設定參數

替換下列預留位置:

  • 接收器設定:

    • udplog:根據通訊協定的接收器類型:
      • udplog (適用於 UDP 系統記錄檔)
      • tcplog (適用於 TCP Syslog)
      • syslog 適用於 RFC 3164/5424 syslog
    • 0.0.0.0:要接聽的 IP 位址:
      • 0.0.0.0,監聽所有介面 (建議)
      • 在一個介面上接聽的特定 IP 位址
    • 514:要接聽的通訊埠號碼 (例如 51415146514)
  • 匯出工具設定:

    • <customer_id>:先前步驟中的客戶 ID
    • malachiteingestion-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

儲存設定檔

  • 編輯完成後,請儲存檔案:
    • Linux:依序按下 Ctrl+OEnterCtrl+X

重新啟動 Bindplane 代理程式,以套用變更

  • 如要在 Linux 中重新啟動 Bindplane 代理程式,請執行下列指令:

    sudo systemctl restart observiq-otel-collector
    
    1. 確認服務正在執行:

      sudo systemctl status observiq-otel-collector
      
    2. 檢查記錄中是否有錯誤:

      sudo journalctl -u observiq-otel-collector -f
      

在 Red Hat Directory Server 中啟用稽核和稽核失敗記錄

根據預設,Red Hat Directory Server 會啟用存取、錯誤和安全性記錄,但停用稽核和稽核失敗記錄。啟用這些記錄,即可擷取所有目錄變更和失敗的作業。

  1. 在目錄伺服器主機上,以 root 或 sudo 權限開啟終端機。
  2. 執行下列指令,啟用稽核記錄:

    dsconf -D "cn=Directory Manager" instance_name config replace nsslapd-auditlog-logging-enabled=on
    
  3. 執行下列指令,啟用稽核失敗記錄:

    dsconf -D "cn=Directory Manager" instance_name config replace nsslapd-auditfaillog-logging-enabled=on
    
  4. 確認已啟用所有記錄類型:

    dsconf -D "cn=Directory Manager" instance_name config get nsslapd-accesslog-logging-enabled nsslapd-errorlog-logging-enabled nsslapd-auditlog-logging-enabled nsslapd-auditfaillog-logging-enabled nsslapd-securitylog-logging-enabled
    
  5. 確認記錄檔位於記錄目錄中:

    ls -la /var/log/dirsrv/slapd-instance_name/
    

選用:使用網路控制台啟用記錄功能

  1. 登入 Red Hat Directory Server 網頁控制台。
  2. 選取執行個體。
  3. 依序前往「伺服器」>「記錄」
  4. 選取要啟用的記錄類型 (例如「稽核記錄」)。
  5. 為所選記錄類型啟用記錄切換按鈕。
  6. 按一下「儲存記錄設定」

設定 rsyslog,將目錄伺服器記錄轉送至 Bindplane 代理程式

Red Hat Directory Server 會將記錄檔寫入 /var/log/dirsrv/slapd-instance_name/ 中的檔案,而不是直接寫入系統記錄檔。使用 rsyslog imfile 模組監控這些記錄檔,並將項目轉送至 Bindplane 代理程式。

  1. 建立新的 rsyslog 設定檔,用於轉送 Directory Server 記錄:

    sudo nano /etc/rsyslog.d/rhds-forward.conf
    
  2. 在設定檔中新增下列內容:

    # Load the imfile module to read log files
    module(load="imfile" PollingInterval="10")
    
    # Monitor the access log
    input(type="imfile"
        File="/var/log/dirsrv/slapd-instance_name/access"
        Tag="dirsrv-access"
        Severity="info"
        Facility="local6")
    
    # Monitor the error log
    input(type="imfile"
        File="/var/log/dirsrv/slapd-instance_name/errors"
        Tag="dirsrv-errors"
        Severity="err"
        Facility="local6")
    
    # Monitor the audit log
    input(type="imfile"
        File="/var/log/dirsrv/slapd-instance_name/audit"
        Tag="dirsrv-audit"
        Severity="info"
        Facility="local6")
    
    # Monitor the security log
    input(type="imfile"
        File="/var/log/dirsrv/slapd-instance_name/security"
        Tag="dirsrv-security"
        Severity="info"
        Facility="local6")
    
    # Forward all Directory Server logs to the Bindplane agent
    local6.* @BINDPLANE_IP:514
    
  3. 驗證 rsyslog 設定語法:

    sudo rsyslogd -N1
    
  4. 重新啟動 rsyslog 服務,以套用變更:

    sudo systemctl restart rsyslog
    
  5. 檢查 Bindplane 代理程式記錄,確認目錄伺服器記錄是否已轉送:

    sudo journalctl -u observiq-otel-collector -f
    

UDM 對應表

記錄欄位 UDM 對應 邏輯
attrs_label about.labels 已合併
cn_label about.labels 已合併
conn_label about.labels 已合併
csn_label about.labels 已合併
err_label about.labels 已合併
etime_label about.labels 已合併
fd_label about.labels 已合併
filter_label about.labels 已合併
label about.labels 已合併
method_label about.labels 已合併
msgid_label about.labels 已合併
name_label about.labels 已合併
nentries_label about.labels 已合併
offset_label about.labels 已合併
op_label about.labels 已合併
optime_label about.labels 已合併
org_label about.labels 已合併
ou_label about.labels 已合併
scope_label about.labels 已合併
slot_label about.labels 已合併
tag_label about.labels 已合併
targetop_label about.labels 已合併
version_label about.labels 已合併
wtime_label about.labels 已合併
desc metadata.description 直接對應
creationDate metadata.event_timestamp 已剖析為 UNIX_MS
recordDate metadata.event_timestamp 已剖析為 UNIX_MS
time metadata.event_timestamp 已剖析為 dd/MMM/yyyy:HH:mm:ss Z
ts metadata.event_timestamp 已剖析為 MMM d HH:mm:ss
operation metadata.product_event_type 直接對應
mrId metadata.product_log_id 直接對應
properties._ecs_agent_version metadata.product_version 直接對應
host principal.asset.hostname 直接對應
oid principal.asset.product_object_id 直接對應
host principal.hostname 直接對應
client_ip principal.ip 已合併
namespace principal.namespace 直接對應
user principal.user.userid 直接對應
sec_result security_result 已合併
properties._hostname target.asset.hostname 直接對應
properties.host target.asset.hostname 直接對應
properties._hostname target.hostname 直接對應
properties.host target.hostname 直接對應
target_ip target.ip 已合併
properties.country target.location.country_or_region 直接對應
properties._file_path target.process.file.full_path 直接對應
properties._file_size target.process.file.size 已重新命名/對應
discipline_label target.resource.attribute.labels 已合併
document_type_label target.resource.attribute.labels 已合併
environment_label target.resource.attribute.labels 已合併
hostgroup_label target.resource.attribute.labels 已合併
platform_label target.resource.attribute.labels 已合併
product_label target.resource.attribute.labels 已合併
project_label target.resource.attribute.labels 已合併
base target.user.group_identifiers 已合併
dn target.user.group_identifiers 已合併
不適用 metadata.event_type 常數:NETWORK_CONNECTION
不適用 metadata.product_name 常數:REDHAT_DIRECTORY_SERVER
不適用 metadata.vendor_name 常數:REDHAT
不適用 target.platform 常數:LINUX
properties._file_inode event.idm.read_only_udm.additional.fields 從變更記錄對應
properties._file_offset event.idm.read_only_udm.additional.fields 從變更記錄對應
conn event.idm.read_only_udm.additional.fields 從變更記錄對應
op event.idm.read_only_udm.additional.fields 從變更記錄對應
err event.idm.read_only_udm.additional.fields 從變更記錄對應
tag event.idm.read_only_udm.additional.fields 從變更記錄對應
nentries event.idm.read_only_udm.additional.fields 從變更記錄對應
wtime event.idm.read_only_udm.additional.fields 從變更記錄對應
optime event.idm.read_only_udm.additional.fields 從變更記錄對應
etime event.idm.read_only_udm.additional.fields 從變更記錄對應
csn event.idm.read_only_udm.additional.fields 從變更記錄對應
cn event.idm.read_only_udm.additional.fields 從變更記錄對應
ou event.idm.read_only_udm.additional.fields 從變更記錄對應
filter event.idm.read_only_udm.additional.fields 從變更記錄對應
attrs event.idm.read_only_udm.additional.fields 從變更記錄對應
scope event.idm.read_only_udm.additional.fields 從變更記錄對應
o event.idm.read_only_udm.additional.fields 從變更記錄對應
targetop event.idm.read_only_udm.additional.fields 從變更記錄對應
msgid event.idm.read_only_udm.additional.fields 從變更記錄對應
method event.idm.read_only_udm.additional.fields 從變更記錄對應
version event.idm.read_only_udm.additional.fields 從變更記錄對應
fd event.idm.read_only_udm.additional.fields 從變更記錄對應
slot event.idm.read_only_udm.additional.fields 從變更記錄對應
name event.idm.read_only_udm.additional.fields 從變更記錄對應
properties.discipline" ,"properties.document_type" ,"properties.environment" ,"properties.hostgroup" ,"properties.platform" ,"properties.product target.resource.attribute.labels 從變更記錄對應

變更記錄

查看這個剖析器的變更記錄

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