收集 Linux auditd 和 AIX 系統記錄

支援的國家/地區:

這個剖析器會處理 SYSLOG 格式的 Linux 稽核記錄,並將其轉換為 UDM。這個外掛程式會處理 JSON 格式和純文字記錄訊息,並使用 grok、XML 剖析和 JSON 剖析技術擷取欄位,然後根據事件類型將這些欄位對應至適當的 UDM 欄位。剖析器也會處理 AIX 系統的特定稽核記錄格式,並使用 security_result 和中繼詳細資料等其他欄位擴充 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

從 Auditd 匯出系統記錄

  1. 存取要匯出稽核記錄的電腦。
  2. 開啟 Auditd 設定檔 (通常位於 /etc/audit/auditd.conf)。

    sudo vi /etc/audit/auditd.conf
    
  3. 找出或新增下列指令行,設定 auditd:

    active = yes
    output = syslog
    log_format = ENRICHED
    dispatcher = /sbin/audispd
    

選用:指定 Syslog Facility:在 auditd.conf 中新增或修改下列行:

```none
syslog_facility = LOG_AUTHPRIV
```
  1. 開啟 audispd 設定檔 (通常位於 /etc/audisp/plugins.d/syslog.conf):

    sudo vi /etc/audisp/plugins.d/syslog.conf
    
  2. 找出或新增下列指令行,設定 audispd:

    active = yes
    direction = out
    path = builtin_syslog
    type = builtin
    args = LOG_INFO
    format = string
    
  3. 重新啟動 Auditd 服務,以套用變更:

    sudo systemctl restart auditd
    
  4. 使用 tail 等工具監控系統記錄,並確認 Auditd 記錄是否正在傳送:

    tail -f /var/log/syslog | grep auditd # Follow syslog and filter for auditd messages (path may vary depending on your system)
    
  5. 編輯 rsyslog.conf 或建立自訂設定:

    sudo vi /etc/rsyslog.d/50-audit-forwarding.conf
    
  6. 新增轉送記錄的規則:

    • if $programname == 'auditd' then @@<Bindplane_Agent>:<Bindplane_Port>
    • 使用 @ 代表 UDP,或使用 @@ 代表 TCP
    • <BindPlane_Agent> 替換為伺服器的 IP/主機名稱。
    • <BindPlane_Port> 替換為伺服器的通訊埠。
  7. 重新啟動 rsyslog 服務,以套用變更:

    sudo systemctl restart rsyslog
    

UDM 對應表

記錄欄位 UDM 對應 備註
acct target.user.user_display_name 原始記錄中的 acct 值會對應至 UDM 中的 target.user.user_display_name 欄位。代表與活動相關聯的帳戶。
addr principal.ip 原始記錄中的 addr 值會對應至 UDM 中的 principal.ip 欄位。這代表事件中主要參與者的 IP 位址。
additional.fields additional.fields 系統會將從剖析的鍵/值組合或標籤中取得的其他欄位,新增至 UDM 的 additional.fields 陣列。
agent.googleapis.com/log_file_path (未對應) 這個標籤會出現在部分原始記錄中,但不會對應至 UDM 中的 IDM 物件。
algo (本範例未使用) 雖然剖析器和部分原始記錄中都有這個欄位,但提供的範例並未使用這個欄位,最終 UDM 中也不會顯示。
application principal.application 衍生自原始記錄檔中的 terminal 欄位,或視記錄類型而定,衍生自 exe 等其他欄位。代表相關應用程式。
arch security_result.about.platform_version 原始記錄的「arch」欄位架構會對應至「security_result.about.platform_version」。
auid about.user.useridsecurity_result.detection_fields.auid 稽核使用者 ID (auid) 會對應至 about.user.userid,並新增為 security_result 中的偵測欄位。
cmd target.process.command_line 原始記錄 cmd 欄位中的指令會對應至 target.process.command_line
collection_time (未對應) 這個欄位是記錄收集時間,不會對應至 UDM 中的 IDM 物件。
comm principal.application 指令名稱 (comm) 會對應至 principal.application
COMMAND target.process.command_line
compute.googleapis.com/resource_name principal.hostname 這個標籤的資源名稱會對應至 principal.hostname
create_time (未對應) 這個欄位不會對應至 UDM 中的 IDM 物件。
cwd security_result.detection_fields.cwd 目前的工作目錄 (cwd) 會新增為 security_result 中的偵測欄位。
data (已處理) data 欄位包含主要記錄訊息,並由剖析器處理,以擷取各種欄位。不會直接對應至單一 UDM 欄位。
exe target.process.file.full_path 可執行檔路徑 (exe) 會對應至 target.process.file.full_path
extensions.auth.type extensions.auth.type 剖析器邏輯會根據事件類型設定驗證類型。通常會設為 MACHINEAUTHTYPE_UNSPECIFIED
fp network.tls.client.certificate.sha256 系統會剖析指紋 (fp),擷取 SHA256 雜湊並對應至 network.tls.client.certificate.sha256
_Item_Id metadata.product_log_id
insertId (未對應) 這個欄位不會對應至 UDM 中的 IDM 物件。
jsonPayload.message (已處理) 這個欄位包含 JSON 格式的主要記錄訊息,並由剖析器處理。
key security_result.about.registry.registry_key 「鍵」欄位會對應至 security_result.about.registry.registry_key
labels (已處理) 系統會處理原始記錄中的標籤,並對應至各種 UDM 欄位,或新增至 additional.fields
logName (未對應) 這個欄位不會對應至 UDM 中的 IDM 物件。
metadata.product_event_type SECCOMP 系統會從原始記錄中擷取金鑰交換曲線,並對應至這個欄位。
msg security_result.summary 訊息 (msg) 通常用於填入 security_result.summary 欄位。
network.application_protocol network.application_protocol 由剖析器邏輯根據事件類型設定 (例如 SSH、HTTP)。
network.direction network.direction 由剖析器邏輯根據事件類型設定 (例如 INBOUND、OUTBOUND)。
network.ip_protocol network.ip_protocol 由剖析器邏輯設定,通常是 SSH 事件的 TCP。
network.session_id network.session_id ses 欄位對應或從其他欄位衍生。
network.tls.cipher network.tls.cipher 系統會從原始記錄中擷取密碼編譯資訊,並對應至這個欄位。
network.tls.curve network.tls.curve 系統會從原始記錄中擷取金鑰交換曲線,並對應至這個欄位。
pid principal.process.pidtarget.process.pid 程序 ID (pid) 會視情況對應至 principal.process.pidtarget.process.pid
ppid principal.process.parent_process.pidtarget.process.parent_process.pid 父項程序 ID (ppid) 會視環境對應至 principal.process.parent_process.pidtarget.process.parent_process.pid
principal.asset.hostname principal.asset.hostname 從「principal.hostname」複製的項目。
principal.asset.ip principal.asset.ip 從「principal.ip」複製的項目。
principal.platform principal.platform 由剖析器邏輯根據作業系統設定 (例如 LINUX)。
principal.port principal.port 與主體相關聯的通訊埠編號。
principal.user.group_identifiers principal.user.group_identifiers 與主要使用者相關聯的群組 ID。
process.name target.process.file.full_path
receiveTimestamp (未對應) 這個欄位是記錄接收時間戳記,不會對應至 UDM 中的 IDM 物件。
res security_result.action_details 結果 (res) 會對應至 security_result.action_details
_Resource_Id target.resource.product_object_id
resource.labels (未對應) 這些標籤會出現在部分原始記錄中,但不會對應至 UDM 中的 IDM 物件。
resource.type (未對應) 這個欄位會出現在部分原始記錄中,但不會對應至 UDM 中的 IDM 物件。
security_result.action security_result.action 由剖析器邏輯根據 res 欄位設定 (例如 ALLOW、BLOCK)。
security_result.detection_fields security_result.detection_fields 原始記錄中的各種欄位會以鍵/值組合的形式新增至這個陣列,做為背景資訊。
security_result.rule_id security_result.rule_id 由剖析器邏輯設定,通常用於系統呼叫事件的 type_name
security_result.severity security_result.severity 由剖析器邏輯根據原始記錄中的嚴重程度層級設定。
security_result.summary security_result.summary 活動摘要,通常衍生自 msg 欄位或其他相關欄位。
ses network.session_id 工作階段 ID (ses) 已對應至 network.session_id
source (未對應) 這個欄位包含記錄來源的中繼資料,不會對應至 UDM 中的 IDM 物件。
subj (已處理) 系統會處理主旨欄位 (subj),擷取使用者和安全性背景資訊。
syscall security_result.about.labels.Syscall 系統呼叫號碼會新增為 security_result.about 中的標籤。
target.administrative_domain target.administrative_domain 目標使用者的網域。
target.group.group_display_name target.group.group_display_name 目標群組的名稱。
target.ip target.ip 目標的 IP 位址。
target.port target.port 與目標相關聯的通訊埠編號。
target.process.command_line target.process.command_line 目標程序的指令列。
target.resource.type target.resource.type 目標資源類型,由剖析器邏輯設定 (例如 CREDENTIAL、SETTING)。
target.user.attribute.permissions target.user.attribute.permissions 與目標使用者相關的權限。
target.user.group_identifiers target.user.group_identifiers 與目標使用者相關聯的群組 ID。
target.user.userid target.user.userid 目標的使用者 ID。
TenantId metadata.product_deployment_id
textPayload (已處理) 記錄的文字酬載,由剖析器處理以擷取各種欄位。
timestamp metadata.event_timestamp 事件的時間戳記。
tty security_result.about.labels.tty tty 會在 security_result.about 中新增為標籤。
type metadata.product_event_type 事件類型 (type) 會對應至 metadata.product_event_type
uid target.user.userid 使用者 ID (uid) 已對應至 target.user.userid

UDM 對應差異參考資料

2025 年 9 月 23 日,Google SecOps 發布新版 Okta 剖析器,其中包含 Okta 記錄欄位對應至 UDM 欄位的重大變更,以及事件類型對應的變更。

記錄欄位對應差異

下表列出 2025 年 9 月 23 日前後,Okta 記錄公開至 UDM 欄位的對應差異 (分別列於「舊版對應」和「目前對應」欄)。

記錄欄位 舊對應 目前對應 參考記錄範例
1.1.1.1 (IP 位址) src.ip principal.ip "<163>Apr 10 09:00:05 hostname.com sshd[3318513]: Accepted password for abc from 1.1.1.1 port 33988 ssh2"
1.1.1.1 (IP 位址) principal.ip target.ip "<29>Oct 5 08:37:16 abc ProxySG: E0000 Access Log HTTP (main): Connecting to server 1.1.1.1 on port 4433.(0) NORMAL_EVENT alog_stream_http.cpp 261"
abc (使用者) principal.user.userid target.user.userid "<85>Feb 27 08:26:55 offozcav login: FAILED LOGIN 1 FROM ::ffff:1.1.1.1 FOR abc, Authentication failure\r\n\r\n"
abc.abc (使用者) principal.user.userid target.user.userid "<86>Feb 27 08:29:19 offozcav login: LOGIN ON pts/43 BY abc.abc FROM\r\n\r\n::ffff:1.1.1.1"
COMMAND principal.process.command_line target.process.command_line "<85>Sep 24 14:33:59 abc sudo: abc : \r\nTTY=unknown ; PWD=/abc ; USER=abc ; COMMAND=/sbin/iptables -t nat -nL \r\n--line-number"
exe target.process.file.full_path principal.process.file.full_path
_ItemId additional.fields metadata.product_log_id
metadata.product_event_type PATH SECCOMP
process.name principal.process.file.full_path target.process.file.full_path
_ResourceId additional.fields target.resource.product_object_id
TenantId additional.fields metadata.product_deployment_id
uid principal.user.userid target.user.userid
USER principal.user.user_display_name target.user.userid "<85>Sep 24 14:33:59 abc sudo: abc : \r\nTTY=unknown ; PWD=/abc ; USER=abc ; COMMAND=/sbin/iptables -t nat -nL \r\n--line-number"
user principal.user.userid target.user.userid 「29>Jan 16 11:28:00 san-auth-1-irl2 tac_plus[17329]: login failure: user 1.1.1.1 (1.1.1.1) vty0」
user principal.user.userid target.user.userid "<87>Jul 15 10:27:01 xpgjrconfdb01 crond[1045]: pam_unix(crond:account): expired password for user root (password aged)"

事件類型對應差異

先前分類為一般事件的多個事件,現在會正確分類為有意義的事件類型。

下表列出 2025 年 9 月 23 日前和之後 (分別列於「舊 event_type」和「目前 event_type」欄位) Okta 事件類型處理方式的差異。

記錄中的 eventType 舊 event_type 目前 event_type
aix_event_type=CRON_Start USER_LOGIN PROCESS_LAUNCH
CRYPTO_KEY_USER NETWORK_CONNECTION USER_LOGIN
FILE_Mknod USER_LOGIN FILE_CREATION
FILE_Rename USER_LOGIN FILE_MODIFICATION
FILE_Stat USER_LOGIN FILE_OPEN
FILE_Unlink USER_LOGIN FILE_DELETION
FS_Chabc USER_LOGIN PROCESS_UNCATEGORIZED
FS_Mkdir USER_LOGIN FILE_CREATION
FS_Rmdir USER_LOGIN FILE_DELETION
PROC_Execute USER_LOGIN PROCESS_LAUNCH
type=ANOM_ABEND STATUS_UPDATE PROCESS_TERMINATION
type=ANOM_PROMISCUOUS SETTING_MODIFICATION
type=CRED_REFR USER_LOGIN USER_CHANGE_PERMISSIONS
type=PROCTILE PROCESS_UNCATEGORIZED PROCESS_LAUNCH
type=SERVICE_START USER_RESOURCE_ACCESS SERVICE_START
type=SERVICE_STOP USER_RESOURCE_ACCESS SERVICE_STOP
type=USER_ACCT USER_LOGIN/SETTING_MODIFICTION USER_LOGIN
type=USER_MGMT SETTING_MODIFICATION/GROUP_MODIFICATION GROUP_MODIFICATION
USER_ERR USER_LOGOUT USER_LOGIN

其他變更

  • 已從 security_result.description 中移除重複的 res 對應。這項資訊會顯示在 security_result.action_details 中。
  • 從額外欄位中移除不必要的 auditd_msg_data
  • 已從 security_result.summary 移除不必要的 auditd_msg_data
  • type=ADD_USER,已移除 accttarget.user.display_name 的重複對應。已對應至「target.user.userid」。
  • principal.process.command_lineprincipal.process.file.names 移除重複的 comm 對應。這項資訊會顯示在 principal.application 中。
  • 如果 principal 中有值,則移除 target.hostname 的重複對應。
  • 移除 target.resource.typeSETTING 的不必要硬式編碼對應。
  • 已移除「關於」標籤對應,因為這項功能已淘汰。
  • 已修正對應:IP 現在會路由至 principal.ip,而非 principal.hostname
  • 修正重複產生事件的問題。

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