收集 OSSEC 記錄
本文說明如何設定 OSSEC 和 Google Security Operations 轉送器,以收集 OSSEC 記錄。這份文件也列出支援的記錄類型和 OSSEC 版本。
詳情請參閱「將資料擷取至 Google Security Operations」。
總覽
下圖顯示部署架構,說明如何設定 OSSEC 代理程式和伺服器,將記錄檔傳送至 Google Security Operations。每個客戶部署作業可能與此表示法不同,也可能更複雜。
 
架構圖顯示下列元件:
- Linux 系統。要監控的 Linux 系統。Linux 系統包含要監控的檔案和 OSSEC 代理程式。 
- Microsoft Windows 系統。要監控的 Microsoft Windows 系統,其中已安裝 OSSEC 代理程式。 
- OSSEC 代理程式。OSSEC 代理程式會從 Microsoft Windows 或 Linux 系統收集資訊,並將資訊轉送至 OSSEC 伺服器。 
- OSSEC 伺服器。OSSEC 伺服器會監控 OSSEC 代理程式並接收相關資訊、分析記錄,然後將記錄轉送至 Google Security Operations 轉送器。 
- Bindplane 代理程式:Bindplane 代理程式會從 osquery 擷取記錄,並將記錄傳送至 Google SecOps。 
- Google Security Operations 轉送器。Google Security Operations 轉送器是部署在客戶網路中的輕量型軟體元件,支援系統記錄。Google Security Operations 轉送器會將記錄轉送至 Google Security Operations。 
- Google Security Operations。Google Security Operations 會保留及分析 OSSEC 伺服器的記錄。 
擷取標籤會識別剖析器,該剖析器會將原始記錄資料正規化為具結構性的 UDM 格式。本文中的資訊適用於具有 OSSEC 攝入標籤的剖析器。
事前準備
- 確認您打算監控的 Microsoft Windows 或 Linux 系統已安裝 OSSEC 代理程式。如要進一步瞭解如何安裝 OSSEC 代理程式,請參閱 OSSEC 安裝 
- 使用 Google Security Operations 剖析器支援的 OSSEC 版本。Google Security Operations 的剖析器支援 OSSEC 3.6.0 版。 
- 請確認中央 Linux 伺服器已安裝並設定 OSSEC 伺服器。 
- 確認 Google Security Operations 剖析器支援的記錄檔類型。 下表列出 Google Security Operations 剖析器支援的產品和記錄檔路徑: - 作業系統 - 產品 - 記錄檔路徑 - Microsoft Windows - Microsoft Windows - 事件記錄 - Linux - Linux - /var/log/audit/audit.log - Linux - Linux - /var/log/syslog - Linux - Linux - /var/log/ulog/syslogemu.log - Linux - apache2 - /var/log/apache2/access.log - Linux - apache2 - /var/log/apache2/error.log - Linux - apache2 - /var/log/apache2/other_vhosts_access.log - Linux - apache2 - /var/log/apache2/novnc-server-access.log - Linux - OpenVpn - /var/log/openvpnas.log - Linux - Nginx - /var/log/nginx/access.log - Linux - Nginx - /var/log/nginx/error.log - Linux - rkhunter - /var/log/rkhunter.log - Linux - OSSEC 伺服器 - OSSEC - /var/ossec/logs/ossec.log - Linux - Linux - /var/log/auth.log - Linux - Linux - /var/log/kern.log - Linux - rundeck - /var/log/rundeck/rundeck.api.log - Linux - rundeck - /var/log/rundeck/service.log - Linux - 森巴 - /var/log/samba/log.winbindd - Linux - Linux - /var/log/mail.log 
- 請確保部署架構中的所有系統都以世界標準時間設定。 
設定 OSSEC 代理程式和伺服器,以及 Google Security Operations 轉送器
如要設定 OSSEC 代理程式和伺服器,以及 Google Security Operations 轉送器,請執行下列操作:
- 如要監控 Linux 系統產生的記錄,請建立 - ossec.conf檔案,為代理程式指定記錄監控設定。以下是 Linux 系統上代理程式的設定檔範例:- <ossec_config> <!-- Files to monitor (localfiles) --> <localfile> <log_format>syslog</log_format> <location>/var/ossec/logs/ossec.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/auth.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/kern.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/mail.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/syslog</location> </localfile> <localfile> <log_format>apache</log_format> <location>/var/log/apache2/error.log</location> </localfile> <localfile> <log_format>apache</log_format> <location>/var/log/apache2/access.log</location> </localfile> <localfile> <log_format>apache</log_format> <location>/var/log/apache2/other_vhost_access.log</location> </localfile> <localfile> <log_format>apache</log_format> <location>/var/log/apache2/nonvnc-server-access.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/nginx/access.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/nginx/error.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/openvpnas.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/rkhunter.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/rundeck/service.log</location> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/samba/log.winbindd</location> </localfile> <localfile> <log_format>command</log_format> <command>df -P</command> </localfile> <localfile> <log_format>syslog</log_format> <location>/var/log/audit/audit.log</location> </localfile> <localfile> <log_format>full_command</log_format> <command>netstat -tan |grep LISTEN |egrep -v '(192.0.2.1| ::1)' | sort</command> </localfile> <localfile> <log_format>full_command</log_format> <command>last -n 5</command> </localfile> </ossec_config>
- 如要監控 Microsoft Windows 系統產生的記錄,請建立 - ossec.conf檔案,為代理程式指定記錄監控設定。以下是 Microsoft Windows 系統上代理程式的設定檔範例:- <ossec_config> <!-- Channels to monitor (localfiles) --> <localfile> <log_format>Security</log_format> <location>eventchannel</location> </localfile> <localfile> <log_format>System</log_format> <location>eventchannel</location> </localfile> <localfile> <log_format>Application</log_format> <location>eventchannel</location> </localfile> </ossec_config>
- 如要使用 syslog 通訊協定將記錄從 OSSEC 伺服器轉送至 Google Security Operations,請依下列格式建立 - syslog.confOSSEC 伺服器設定檔:- .*.@<CHRONICLE_FORWARDER_IP>:<CHRONICLE_FORWARDER_PORT>
- 設定 Google Security Operations 轉送器,將記錄傳送至 Google Security Operations。詳情請參閱「在 Linux 上安裝及設定轉送器」。以下是 Google Security Operations 轉送器設定範例: - - syslog: common: enabled: true data_type: OSSEC batch_n_seconds: 10 batch_n_bytes: 1048576 tcp_address: 0.0.0.0:10514 connection_timeout_sec: 60
使用 Bindplane 代理程式將記錄轉送至 Google SecOps
- 安裝並設定 Linux 虛擬機器。
- 在 Linux 上安裝及設定 Bindplane 代理程式,將記錄轉寄至 Google SecOps。如要進一步瞭解如何安裝及設定 Bindplane 代理程式,請參閱 Bindplane 代理程式安裝及設定操作說明。
如果在建立動態饋給時遇到問題,請與 Google SecOps 支援團隊聯絡。
支援的 OSSEC 記錄格式
OSSEC 剖析器支援 SYSLOG+JSON、SYSLOG 和 SYSLOG+KV 格式的記錄。
支援的 OSSEC 範例記錄
- SYSLOG+JSON: - 2022 Jan 30 23: 13: 05 (wintest) 198.51.100.0->EventChannel { "win": { "system": { "providerName": "Microsoft-Windows-PowerShell", "providerGuid": "{A0C1853B-5C40-ABCD-1234-3CF1C58F985A}", "eventID": "4104", "version": "1", "level": "5", "task": "2", "opcode": "15", "keywords": "0x0", "systemTime": "2021-07-29T12:57:03.579362300Z", "eventRecordID": "150518739", "processID": "16520", "threadID": "6036", "channel": "Microsoft-Windows-PowerShell/Operational", "computer": "WINTEST.cbn.local", "severityValue": "VERBOSE", "message": "\\"Creating Scriptblock text (1 of 1):\\"" }, "eventdata": { "messageNumber": "1", "messageTotal": "1", "scriptBlockText": "$global:?", "scriptBlockId": "8d4870bf-4032-5432-1234-51ae1e6a05d5" } } }
- SYSLOG: - 2024/04/02 15:31:58 ossec-testrule: INFO: Reading local decoder file.
- SYSLOG+KV: - 2022 Jan 30 12:57:02 (ossectest) 198.51.100.0->/var/log/audit/audit.log type=LOGIN msg=audit(1627367436.123:8618732): pid=18281 uid=0 old-auid=1234967321 auid=996 tty=(none) old-ses=1234967321 ses=102952 res=1
欄位對應參考資料
本節說明 Google Security Operations 剖析器如何將 grok 模式套用至 Linux 和 Microsoft Windows 系統,以及如何將 OSSEC 記錄欄位對應至各記錄類型的 Google Security Operations 統一資料模型 (UDM) 欄位。
如要瞭解常見欄位的對應參照,請參閱「常見欄位」一文。
如要瞭解 Linux 系統上的記錄路徑、範例記錄的 grok 模式、事件類型和 UDM 欄位,請參閱下列章節:
如要瞭解支援的 Microsoft Windows 事件和對應的 UDM 欄位,請參閱「Microsoft Windows 事件資料」
常用欄位
下表列出常見的記錄檔欄位和對應的 UDM 欄位。
| 常見記錄欄位 | UDM 欄位 | 
|---|---|
| collected_time | metadata.collected_timestamp | 
| 應用程式 | principal.application | 
| 記錄 | metadata.description | 
| ip | target.ip 或 principal.ip | 
| 主機名稱 | target.hostname 或 principal.hostname | 
Linux 系統
下表列出 Linux 系統的記錄路徑、範例記錄的 Grok 模式、事件類型和 UDM 對應:
| 記錄路徑 | 記錄範例 | Grok 模式 | 事件類型 | UDM 對應 | 
|---|---|---|---|---|
| /var/log/apache2/error.log | [Thu Apr 28 16:13:01.283342 2022] [core:notice] [pid 18394:tid 140188660751296] [client 1.200.32.47:59840] failed to make connection | [{timestamp}][{log_module}:{log_level}][pid{pid}(<optional_field>:tid{tid}|)](<optional_field> [client {client_ip}:{client_port}]|) (?<error_message>.*) | NETWORK_UNCATEGORIZED | 時間戳記會對應至 metadata.event_timestamp log_module 會對應至 target.resource.name log_level 會對應至 security_result.severity pid 會對應至 target.process.parent_process.pid tid 會對應至 target.process.pid client_ip 會對應至 principal.ip client_port 會對應至 principal.port error_message 會對應至 security_result.description network.application_protocol 設為「HTTP」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 | 
| /var/log/apache2/error.log | [Thu Apr 28 16:13:01.283342 2022] [core:notice] [pid 18394:tid 140188660751296] failed to make connection | [{timestamp}][{log_module}:{severity}][pid{pid}(<optional_field>:tid{tid}|)]{error_message} | NETWORK_UNCATEGORIZED | 時間戳記會對應至 metadata.event_timestamp log_module 會對應至 target.resource.name log_level 會對應至 security_result.severity pid 會對應至 target.process.parent_process.pid tid 會對應至 target.process.pid error_message 會對應至 security_result.description network.application_protocol 設為「HTTP」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 | 
| /var/log/apache2/error.log | [Thu Apr 28 16:13:01.283342 2022] [core:notice] [pid 18394:tid 140188660751296] AH00094: Command line: '/usr/sbin/apache2' | [{timestamp}][{log_module}:{log_level}][pid{pid}(<optional_field>:tid{tid}|)](<optional_field> [client {client_ip}:{client_port}]|) (?<error_message>.*),referer{referer_url} | NETWORK_UNCATEGORIZED | metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 時間戳記會對應至 metadata.event_timestamp log_module 會對應至 target.resource.name log_level 會對應至 security_result.severity pid 會對應至 target.process.parent_process.pid tid 會對應至 target.process.pid client_ip 會對應至 principal.ip client_port 會對應至 principal.port error_message 會對應至 security_result.description target.platform 已設為「LINUX」 referer_url 會對應至 network.http.referral_url | 
| /var/log/apache2/error.log | Sun Jan 30 15:14:47.260309 2022] [proxy_http:error] [pid 12515:tid 140035781285632] [client 1.200.32.47:59840] AH01114: HTTP: failed to make connection to backend: 192.0.2.1 , referer altostrat.com | [{timestamp}] [{log_module}:{log_level}] [pid {pid}(<optional_field>:tid{tid}|)] [client {client_ip}:{client_port}]( <message_text>HTTP: )?{error_message}:( {target_ip})(<optional_field>,referer{referer_url})?" | NETWORK_HTTP | 時間戳記會對應至 metadata.event_timestamp log_module 會對應至 target.resource.name log_level 會對應至 security_result.severity pid 會對應至 target.process.parent_process.pid tid 會對應至 target.process.pid client_ip 會對應至 principal.ip client_port 會對應至 principal.port error_message 會對應至 security_result.description target_ip 會對應至 target.ip referer_url 會對應至 network.http.referral_url network.application_protocol 設為「HTTP」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 | 
| /var/log/apache2/error.log | [Sat Feb 02 00:30:55 2019] New connection: [connection: gTxkX8Z6tjk] [client 192.0.2.1:50786] | [{timestamp}]<message_text>connection:[connection:{connection_id}][client{client_ip}:{client_port}] | NETWORK_UNCATEGORIZED | 時間戳記會對應至 metadata.event_timestamp client_ip 會對應至 principal.ip client_port 會對應至 principal.port connection_id 會對應至 network.session_id network.application_protocol 設為「HTTP」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 | 
| /var/log/apache2/error.log | [Sat Feb 02 00:30:55 2019] New request: [connection: j8BjX4Z5tjk] [request: ACtkX1Z5tjk] [pid 8] [client 192.0.2.1:50784] | [{timestamp}]<message_text>request:[connection:{connection_id}][request:{request_id}][pid{pid}][client{client_ip}:{client_port}] | NETWORK_UNCATEGORIZED | 時間戳記會對應至 metadata.event_timestamp request_id 會對應至 security_result.detection_fields.(key/value) client_ip 會對應至 principal.ip client_port 會對應至 principal.port pid 會對應至 target.process.parent_process.pid connection_id 會對應至 network.session_id network.application_protocol 設為「HTTP」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 | 
| /var/log/apache2/error.log | [Sat Feb 02 00:30:55 2019] [info] [C: j8BjX4Z5tjk] [R: p7pjX4Z5tjk] [pid 8] core.c(4739): [client 192.0.2.1:50784] AH00128: File does not exist: /usr/local/apache2/htdocs/favicon.ico | [{timestamp}] [{log_level}][C:{connection_id}][R:{request_id}][pid {pid}(<optional_field>:tid{tid}|)]<message_text>[client {client_ip}:{client_port}]{error_message}:{file_path} | NETWORK_UNCATEGORIZED | 時間戳記會對應至 metadata.event_timestamp log_level 會對應至 security_result.severity request_id 會對應至 security_result.detection_fields.(key/value) client_ip 會對應至 principal.ip client_port 會對應至 principal.port pid 會對應至 target.process.parent_process.pid connection_id 會對應至 network.session_id error_message 會對應至 security_result.description file_path 會對應至 target.file.full_path network.application_protocol 設為「HTTP」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 | 
| /var/log/apache2/access.log | 10.50.0.1 - - [28/Apr/2022:18:02:13 +0530] "POST /test/first.html HTTP/1.1" 200 491 "http://192.0.2.1/test/first.html" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" | ({client_ip})?<message_text>{userid}[{timestamp}](<optional_field>{method}/(<optional_field>{resource}?) {client_protocol}?){result_status}{object_size}(<optional_field>(<optional_field>{referer_url}?)(<optional_field>{user_agent}?)? | NETWORK_HTTP | client_ip 會對應至 principal.ip userid 對應至 principal.user.userid 主機對應至 principal.hostname 時間戳記會對應至 metadata.event_timestamp 方法會對應至 network.http.method 資源會對應至 principal.resource.name client_protocol 對應至 network.application_protocol result_status 會對應至 network.http.response_code object_size 會對應至 network.sent_bytes referer_url 會對應至 network.http.referral_url user_agent 會對應至 network.http.user_agent network.ip_protocol 設為「TCP」 network.direction 設為「OUTBOUND」 network.application_protocol 設為「HTTP」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 | 
| var/log/apache2/other_vhosts_access.log | wintest.example.com:80 ::1 - - [14/Jan/2022:14:08:16 -0700] \"GET /server-status?auto HTTP/1.1\" 200 1415 \"-\" \"Python-urllib/2.7\" | {target_host}:{NUMBER:target_port} {client_ip} - (<optional_field>{host}?) [{timestamp}](<optional_field>{method}/(<optional_field>{resource}?){client_protocol}?){result_status}{object_size}(<optional_field>{referer_url}?)(<optional_field>{user_agent}?) | NETWORK_HTTP | target_host 會對應至 target.hostname target_port 會對應至 target.port client_ip 會對應至 principal.ip userid 對應至 principal.user.userid 主機對應至 principal.hostname 時間戳記會對應至 metadata.event_timestamp 方法會對應至 network.http.method 資源會對應至 principal.resource.name result_status 會對應至 network.http.response_code object_size 會對應至 network.sent_bytes referer_url 會對應至 network.http.referral_url user_agent 會對應至 network.http.user_agent network.ip_protocol 設為「TCP」 network.direction 設為「OUTBOUND」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 network.application_protocol 設為「HTTP」 | 
| /var/log/apache2/access.log | "http://192.0.2.1/test/first.html" -> /altostrat.com | (<optional_field>{referer_url}?)->(<optional_field>{path}?) | GENERIC_EVENT | path is mapped to target.url referer_url 會對應至 network.http.referral_url network.direction 設為「OUTBOUND」 target.platform 已設為「LINUX」 network.application_protocol 設為「HTTP」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 | 
| /var/log/apache2/access.log | Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.67.0 Chrome/98.0.4758.141 Electron/17.4.1 Safari/537.36 | (<optional_field>{user_agent}) | GENERIC_EVENT | user_agent 會對應至 network.http.user_agent network.direction 設為「OUTBOUND」 target.platform 已設為「LINUX」 network.application_protocol 設為「HTTP」 target.platform 已設為「LINUX」 metadata.vendor_name 設為「Apache」 metadata.product_name 設為「Apache HTTP Server」 | 
| var/log/nginx/access.log | 172.16.19.228 - admin [05/May/2022:11:53:27 +0530] "GET /icons/ubuntu-logo.png HTTP/1.1" 404 209 "http://192.0.2.1/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" | {principal_ip} - (<optional_field>{principal_user_userid}?) [{timestamp}] {http_method} /(<optional_field>{resource_name}?|) {protocol}(<message_text>){response_code} {received_bytes}(<optional_field>{referer_url}) ({user_agent}|{user_agent})? | NETWORK_HTTP | 時間會對應至 metadata.timestamp ip 會對應至 target.ip principal_ip 會對應至 principal.ip principal_user_userid 對應至 principal.user.userid metadata_timestamp 對應至時間戳記 http_method 會對應至 network.http.method resource_name 會對應至 principal.resource.name protocol is mapped to network.application_protocol = (HTTP) response_code 會對應至 network.http.response_code received_bytes 對應至 network.sent_bytes referer_url 會對應至 network.http.referral_url user_agent 會對應至 network.http.user_agent target.platform 已設為「LINUX」 metadata.vendor_name 設為「NGINX」 metadata.product_name 設為「NGINX」 network.ip_protocol 設為「TCP」 network.direction 設為「OUTBOUND」 | 
| var/log/nginx/error.log | 2022/01/29 13:51:48 [error] 593#593: *62432 open() \"/usr/share/nginx/html/nginx_status\" failed (2: No such file or directory), client: 192.0.2.1, server: localhost, request: \"GET /nginx_status HTTP/1.1\", host: \"192.0.2.1:8080\" | "{year}\/{month}\/{day}{time}[{severity}]{pid}#{thread_id}:{inner_message2}" inner_message2 對應至「{security_result_description_2},client:{principal_ip},server:(<optional_field>{target_hostname}?),request:"{http_method} /(<optional_field>{resource_name}?) {protocol}/1.1",host:"({target_ip}:{target_port})?" "bind() to ({target_ip}|[{target_ip}]):{target_port} failed ({security_description})", "\*{cid}{security_description}", "{security_description}" | NETWORK_HTTP | thread_id 對應至 principal.process.pid 嚴重性會對應至 security_result.severity (debug 對應至 UNKNOWN_SEVERITY,info 對應至 INFORMATIONAL,notice 對應至 LOW,warn 對應至 MEDIUM,error 對應至 ERROR,crit 對應至 CRITICAL,alert 對應至 HIGH) target_file_full_path 會對應至 target.file.full_path principal_ip 會對應至 principal.ip target_hostname 會對應至 target.hostname http_method 會對應至 network.http.method resource_name 會對應至 principal.resource.name 通訊協定對應至「TCP」 target_ip 會對應至 target.ip target_port 會對應至 target.port security_description + security_result_description_2 會對應至 security_result.description pid 會對應至 principal.process.parent_process.pid network.application_protocol 設為「HTTP」 時間戳記對應至 %{year}/%{day}/%{month} %{time} target.platform 已設為「LINUX」 metadata.vendor_name 設為「NGINX」 metadata.product_name 設為「NGINX」 network.ip_protocol 設為「TCP」 network.direction 設為「OUTBOUND」 | 
| var/log/rkhunter.log | [14:10:40] Required commands check failed | [<message_text>]{security_description} | STATUS_UPDATE | 時間會對應至 metadata.timestamp securtiy_description 會對應至 security_result.description principal.platform 設為「LINUX」 metadata.vendor_name 設為「RootKit Hunter」 metadata.product_name 設為「RootKit Hunter」 | 
| var/log/rkhunter.log | [14:09:52] Checking for file '/dev/.oz/.nap/rkit/terror' [ Not found ] | [<message_text>] {security_description} {file_path}[{metadata_description}] | FILE_UNCATEGORIZED | metadata_description 對應至 metadata.description file_path 會對應至 target.file.full_path security_description 會對應至 security_result.description principal.platform 設為「LINUX」 metadata.vendor_name 設為「RootKit Hunter」 metadata.product_name 設為「RootKit Hunter」 | 
| var/log/rkhunter.log | ossec: File size reduced (inode remained): '/var/log/rkhunter.log'. | (<optional_field><message_text>:){metadata_description}:'{file_path}' | FILE_UNCATEGORIZED | 時間會對應至 metadata.timestamp metadata_description 對應至 metadata.description file_path 會對應至 target.file.full_path principal.platform 設為「LINUX」 metadata.vendor_name 設為「RootKit Hunter」 metadata.product_name 設為「RootKit Hunter」 | 
| /var/log/kern.log | Jul 7 18:48:32 zynvpnsvr kernel: [2081387.006876] IPv4: martian source 1.20.32.39 from 192.0.2.1, on dev as0t5 | {timestamp}{principal_hostname}{metadata_product_event_type}:[<message_text>?] <message_text>?{target_ip}\from{principal_ip},在開發人員 {target_user_userid} 上 | NETWORK_CONNECTION | 時間戳記會對應至「metadata.event_timestamp」 principal_hostname 對應至「principal.hostname」 metadata_product_event_type 對應至「metadata.product_event_type」 target_ip 會對應至「target.ip」 principal_ip 會對應至「principal.ip」 target_user_userid 對應至「target.user.userid」 metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 | 
| /var/log/kern.log | Oct 25 10:10:51 localhost kernel: [ 31.974576] audit: type=1400 audit(1635136846.152:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="/usr/bin/lxc-start" pid=752 | {timestamp}{principal_hostname}{metadata_product_event_type}: <message_text>\operation="{metadata_description}"\profile="<message_text>"\name="{file_path}"\pid={pid} | STATUS_UPDATE | 時間戳記會對應至「metadata.event_timestamp」 principal_hostname 對應至「principal.hostname」 metadata_product_event_type 對應至「metadata.product_event_type」 metadata_description 會對應至「metadata.description」 file_path 會對應至「principal.process.file」 pid is mapped to "principal.process.pid" metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 | 
| /var/log/kern.log | Apr 28 12:41:35 localhost kernel: [ 5079.912215] ctnetlink v0.93: registering with nfnetlink. | {timestamp}{principal_hostname}{metadata_product_event_type}:[<message_text>?]{metadata_description} | STATUS_UPDATE | 時間戳記會對應至「metadata.event_timestamp」 principal_hostname 對應至「principal.hostname」 metadata_product_event_type 對應至「metadata.product_event_type」 metadata_description 會對應至「metadata.description」 metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 | 
| /var/log/kern.log | Apr 28 11:17:01 localhost kernel: [ 0.030139] smpboot: CPU0: Intel(R) Xeon(R) Gold 5220R CPU @ 2.20GHz (family: 0x6, model: 0x55, stepping: 0x7) | {timestamp}{principal_hostname}{metadata_product_event_type}:([<message_text>])<message_text>:\CPU0:{principal_asset_hardware_cpu_model}({metadata_description}) | STATUS_UPDATE | 時間戳記會對應至「metadata.event_timestamp」 principal_hostname 對應至「principal.hostname」 metadata_product_event_type 對應至「metadata.product_event_type」 principal_asset_hardware_cpu_model 會對應至「principal.asset.hardware.cpu_model」 metadata_description 會對應至「metadata.description」 metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 cpu_model 對應至 principal.asset.hardware.cpu_model | 
| /var/log/syslog.log | Jan 29 13:51:46 winevt env[29194]: [29/Jan/2022:13:51:46] REQUES GET 200 /api/systems/0000-0041 (10.0.1.1) 3179 | {collected_timestamp}{hostname}{command_line}[{pid}]:[{date}<message_text>]REQUES{http_method}{response_code}(<optional_field>{resource}?)({target_ip}){received_bytes} | NETWORK_CONNECTION | collected_time 會對應至 metadata.event_timestamp 主機名稱會對應至 principal.hostname pid 會對應至 principal.process.pid http_method 會對應至 network.http.method response_code 會對應至 network.http.response_code 資源會對應至 target.url target_ip 會對應至 target.ip received_bytes 對應至 network.received_bytes metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 command_line 對應至 principal.process.command_line | 
| /var/log/syslog.log | Jul 26 23:13:03 zynossec ossec-authd[1096]: 2021/07/26 23:13:03 ossec-authd: INFO: Received request for a new agent (zsecmgr0000-0719) from: 3.4.5.6 | {collected_timestamp}<message_text>{command_line}[{pid}]:{date} {time} {command_line}:{log_level}:{message}({hostname})from: {target_ip} | STATUS_UPDATE | collected_time 會對應至 metadata.event_timestamp 主機名稱會對應至 principal.hostname pid 會對應至 principal.process.pid log_level 會對應至 security_result.severity 訊息會對應至 metadata.description command_line 對應至 principal.process.command_line metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 target_ip 會對應至 target.ip | 
| /var/log/syslog.log | Jul 26 23:13:03 zynossec ossec-authd[1096]: 2021/07/26 23:13:03 ossec-authd: INFO: New connection from 3.4.5.6 | {collected_time}{hostname}{command_line}[{pid}]:{date} {time} {command_line}:{log_level}:{description}from {target_ip} | STATUS_UPDATE | collected_time 會對應至 metadata.event_timestamp 主機名稱會對應至 principal.hostname pid 會對應至 principal.process.pid log_level 會對應至 security_result.severity 說明會對應至 security_result.description command_line 對應至 principal.process.command_line metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 | 
| /var/log/syslog.log | Jan 29 13:51:46 zynossec ossec-authd[1096]: 2021/07/26 23:13:03 ossec-authd: ERROR: Invalid agent name zsecmgr0000-0719 (duplicated) | {collected_timestamp}<message_text>{command_line}[{pid}]:{date}<message_text>:{log_level}:{description}{hostname}({reason}) | STATUS_UPDATE | collected_time 會對應至 metadata.event_timestamp 主機名稱會對應至 principal.hostname pid 會對應至 principal.process.pid log_level 會對應至 security_result.severity 說明 + 原因會對應至 security_result.description command_line 對應至 principal.process.command_line metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 | 
| /var/log/syslog.log | May 2 06:25:01 localhost apachectl[64942]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using ::1. 全域設定「ServerName」指令,即可隱藏這則訊息 | {collected_timestamp}{hostname}{command_line}(<optional_field>|[{pid}]):{message} | STATUS_UPDATE | collected_time 會對應至 metadata.event_timestamp 主機名稱會對應至 principal.hostname pid 會對應至 principal.process.pid 訊息會對應至 metadata.description metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 command_line 對應至 principal.process.command_line | 
| /var/log/syslog.log | May 2 00:00:45 localhost fstrim[64727]: /: 6.7 GiB (7205015552 bytes) trimmed | {collected_timestamp}{hostname}{command_line}(<optional_field>|[{pid}]):{message} | STATUS_UPDATE | collected_time 會對應至 metadata.event_timestamp 主機名稱會對應至 principal.hostname pid 會對應至 principal.process.pid 訊息會對應至 metadata.description metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 command_line 對應至 principal.process.command_line | 
| /var/log/syslog.log | May 3 10:14:37 localhost rsyslogd: rsyslogd's userid changed to 102 | {collected_timestamp}{hostname}{command_line}:{message}to{user_id} | STATUS_UPDATE | collected_time 會對應至 metadata.collected_timestamp 主機名稱會對應至 principal.hostname 訊息會對應至 metadata.description user_id 會對應至 principal.user.userid command_line 對應至 principal.process.command_line metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 | 
| /var/log/syslog.log | May 5 10:36:48 localhost systemd[1]: Starting System Logging Service... | {collected_timestamp}{hostname}{command_line}(<optional_field>|[{pid}]):{message} | STATUS_UPDATE | collected_time 會對應至 metadata.event_timestamp 主機名稱會對應至 principal.hostname pid 會對應至 principal.process.pid 訊息會對應至 metadata.description metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 command_line 對應至 principal.process.command_line | 
| /var/log/mail.log | Mar 16 11:40:56 Ubuntu18 sendmail[9341]: 22G6AtwH009341: from=<ossecm@Ubuntu18>, size=377, class=0, nrcpts=1, metadata_descriptionid=<202203160610.22G6AtwH009341@Ubuntu18.cdsys.local>, proto=SMTP, daemon=MTA-v4, relay=localhost [192.0.2.1] | {timestamp} {target_hostname} {application}[{pid}]: <message_text>:{KV} | STATUS_UPDATE | target_hostname 會對應至 target.hostname 應用程式會對應至 target.application pid 會對應至 target.process.pid metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/mail.log | Apr 7 13:44:01 prod postfix/pickup[22580]: AE4271627DB: uid=0 from=<root> | {timestamp} {target_hostname} {application}[{pid}]: <message_text>{KV} | EMAIL_UNCATEGORIZED | target_hostname 會對應至 target.hostname 應用程式會對應至 target.application pid 會對應至 target.process.pid metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/mail.log | Apr 7 13:44:01 prod postfix/cleanup[23434]: AE4271627DB: message-id=<20150207184401.AE4271627DB@server.hostname.01> | {timestamp} {target_hostname} {application}[{pid}]: <message_text> message-id=<{resource_name}> | STATUS_UPDATE | target_hostname 會對應至 target.hostname 應用程式會對應至 target.application pid 會對應至 target.process.pid resource_name 會對應至 target.resource.name metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/mail.log | Apr 7 13:44:01 prod postfix/qmgr[3539]: AE4271627DB: from=<root@server.hostname.01>, size=565, nrcpt=1 (queue active) | {timestamp} {target_hostname} {application}[{pid}]: <message_text>{KV} | EMAIL_UNCATEGORIZED | target_hostname 會對應至 target.hostname 應用程式會對應至 target.application pid 會對應至 target.process.pid metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/mail.log | Apr 7 13:44:01 prod postfix/smtp[23436]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400d:c03::1b]:25: Network is unreachable | {timestamp} {target_hostname} {application}[{pid}]: <message_text>{KV} | STATUS_UPDATE | target_hostname 會對應至 target.hostname 應用程式會對應至 target.application pid 會對應至 target.process.pid metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/mail.log | Apr 7 13:44:02 prod postfix/local[23439]: E62521627DC: to=<root@server.hostname.01>, relay=local, delay=0.01, delays=0/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox) | {timestamp} {target_hostname} {application}[{pid}]: <message_text>{KV} | EMAIL_UNCATEGORIZED | target_hostname 會對應至 target.hostname 應用程式會對應至 target.application pid 會對應至 target.process.pid metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/rundeck/service.log | [2022-05-04T17:03:11,166] WARN config.NavigableMap - Accessing config key '[filterNames]' through dot notation is deprecated, and it will be removed in a future release. 請改用「config.getProperty(key, targetClass)」。 | [{timestamp}]{severity}{summary}\-{security_description} ,位於 {command_line}\({file_path}:<message_text>\) | STATUS_UPDATE | command_line 對應至「target.process.command_line」 file_path 會對應至「target.process.file.full_path」 時間戳記會對應至「metadata.event_timestamp」 嚴重程度會對應至「security_result.severity」 摘要會對應至「security_result.summary」 security_description 會對應至「security_result.description」 metadata.product_name 設為「OSSEC」 metadata.vendor_name 設為「OSSEC」 | 
| /var/log/auth.log | Apr 27 21:03:03 Ubuntu18 systemd-logind[836]: Removed session 3080. | {timestamp} {principal_hostname}{principal_application}(<optional_field>[{pid}]):{security_description}{network_session_id}?(of user{principal_user_userid})? | USER_LOGOUT | 時間戳記會對應至「metadata.timestamp」 如果 metadata.event_type 為 USER_LOGOUT,則 principal_hostname 會對應至「target.hostname」,否則會對應至「principal.hostname」。 如果 metadata.event_type 為 USER_LOGOUT,則 principal_application 會對應至「target.application」,否則會對應至「principal.application」。 如果 metadata.event_type 為 USER_LOGOUT,則 pid 會對應至「target.process.pid」,否則會對應至「principal.process.pid」。 security_description 會對應至「security_result.description」 network_session_id 對應至「network.session_id」 如果 metadata.event_type 為 USER_LOGOUT,principal_user_userid 會對應至「principal.user.userid」,否則會對應至「target.user.userid」。 「principal.platform」已對應至「LINUX」 if(removed_session) event_type is set to USER_LOGOUT extensions.auth.type 已設為 AUTHTYPE_UNSPECIFIED metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/auth.log | Apr 28 11:33:24 Ubuntu18 systemd-logind[836]: New session 3205 of user root. | {timestamp} {principal_hostname}{principal_application}(<optional_field>[{pid}]):{security_description}{network_session_id}?(of user{principal_user_userid})? | USER_LOGIN | 時間戳記會對應至「metadata.timestamp」 如果 metadata.event_type 為 USER_LOGOUT,則 principal_hostname 會對應至「target.hostname」,否則會對應至「principal.hostname」。 如果 metadata.event_type 為 USER_LOGOUT,則 principal_application 會對應至「target.application」,否則會對應至「principal.application」。 如果 metadata.event_type 為 USER_LOGOUT,則 pid 會對應至「target.process.pid」,否則會對應至「principal.process.pid」。 security_description 會對應至「security_result.description」 network_session_id 對應至「network.session_id」 如果 metadata.event_type 為 USER_LOGOUT,principal_user_userid 會對應至「principal.user.userid」,否則會對應至「target.user.userid」。 「principal.platform」已對應至「LINUX」 「network.application_protocol」已對應至「SSH」 if(new_session) event_type is set to USER_LOGIN extensions.auth.type 已設為 AUTHTYPE_UNSPECIFIED metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/auth.log | Apr 28 11:35:31 Ubuntu18 sshd[23573]: Accepted password for root from 10.0.1.1 port 40503 ssh2 | {timestamp} {principal_hostname}{principal_application}(<optional_field>[{pid}])<optional_field> {security_description} for (invalid user )?{principal_user_userid} from {principal_ip} port {principal_port} ssh2(:{security_result_detection_fileds_ssh_kv}SHA256:{security_result_detection_fileds_kv})? | USER_LOGIN | 時間戳記會對應至「metadata.timestamp」 如果 metadata.event_type 為 USER_LOGOUT,則 principal_hostname 會對應至「target.hostname」,否則會對應至「principal.hostname」。 如果 metadata.event_type 為 USER_LOGOUT,則 principal_application 會對應至「target.application」,否則會對應至「principal.application」。 如果 metadata.event_type 為 USER_LOGOUT,則 pid 會對應至「target.process.pid」,否則會對應至「principal.process.pid」。 security_description 會對應至「security_result.description」 如果 metadata.event_type 為 USER_LOGOUT,principal_user_userid 會對應至「principal.user.userid」,否則會對應至「target.user.userid」。 principal_ip 會對應至「principal.ip」 principal_port 會對應至「principal.port」 security_result_detection_fields_ssh_kv 對應至「security_result.detection_fields.key/value」 security_result_detection_fields_kv 對應至「security_result.detection_fields.key/value」 「principal.platform」設為「LINUX」 「network.application_protocol」設為「SSH」 metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/auth.log | Apr 28 11:50:20 Ubuntu18 sshd[24145]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=10.0.1.1 user=root | {timestamp} {principal_hostname}{principal_application}([{pid}])<optional_field> <message_text>: {security_description};logname=(<message_text>)?uid=({principal_user_userid})?euid=({principal_user_attribute_labels_euid_kv})?tty=(<message_text>)?ruser=({principal_ruser_userid})?rhost=({target_ip})?(user=(<optional_field>{principal_user_userid}|{principal_user_userid})?)? | USER_LOGIN | 時間戳記會對應至「metadata.timestamp」 如果 metadata.event_type 為 USER_LOGOUT,則 principal_hostname 會對應至「target.hostname」,否則會對應至「principal.hostname」。 如果 metadata.event_type 為 USER_LOGOUT,則 principal_application 會對應至「target.application」,否則會對應至「principal.application」。 如果 metadata.event_type 為 USER_LOGOUT,則 pid 會對應至「target.process.pid」,否則會對應至「principal.process.pid」。 security_description 會對應至「security_result.description」 principal_user_uuserid 對應至「principal.user.attribute.labels」 principal_user_attribute_labels_euid_kv 對應至「principal.user.attribute.labels.key/value」 principal_ruser_userid 會對應至「principal.user.attribute.labels.key/value」 target_ip 會對應至「target.ip」 如果 metadata.event_type 為 USER_LOGOUT,則 principal_user_userid 會對應至「principal.user.userid」,否則會對應至「target.user.userid」 「principal.platform」設為「LINUX」 「network.application_protocol」設為「SSH」 metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/auth.log | Feb 24 00:13:02 precise32 sudo: tsg : user NOT in sudoers ; TTY=pts/1 ; PWD=/home/vagrant ; USER=root ; COMMAND=/bin/ls | {timestamp} {principal_hostname}{principal_application}(<optional_field>[{pid}])<optional_field> {principal_user_userid} :( {security_description} ;)? TTY=<message_text> ; PWD={principal_process_command_line_1} ; USER={principal_user_attribute_labels_uid_kv} ; COMMAND={principal_process_command_line_2} | STATUS_UPDATE | 時間戳記會對應至 metadata.timestamp principal_hostname 對應至 principal.hostname principal_application 對應至 principal.application pid 會對應至 principal.process.pid principal_user_userid 會對應至 target.user.userid security_description 會對應至「security_result.description」 principal_process_command_line_1 對應至「principal.process.command_line」 principal_process_command_line_2 對應至「principal.process.command_line」 principal_user_attribute_labels_uid_kv 會對應至「principal.user.attribute.labels.key/value」 「principal.platform」設為「LINUX」 | 
| /var/log/auth.log | Apr 26 07:39:01 Ubuntu18 CRON[2126]: pam_unix(cron:session): session opened for user root by (uid=0) | {timestamp} {principal_hostname}{principal_application}(<optional_field>[{pid}])<optional_field> {security_description} for (invalid user|user)?{principal_user_userid}(by (uid={principal_user_attribute_labels_uid_kv}))?$ | USER_LOGIN | 時間戳記會對應至 metadata.timestamp 如果 metadata.event_type 為 USER_LOGOUT,則 principal_hostname 會對應至「target.hostname」,否則會對應至「principal.hostname」。 如果 metadata.event_type 為 USER_LOGOUT,則 principal_application 會對應至「target.application」,否則會對應至「principal.application」。 如果 metadata.event_type 為 USER_LOGOUT,則 pid 會對應至「target.process.pid」,否則會對應至「principal.process.pid」。 security_description 會對應至「security_result.description」 如果 metadata.event_type 為 USER_LOGOUT,principal_user_userid 會對應至「principal.user.userid」,否則會對應至「target.user.userid」。 principal_user_attribute_labels_uid_kv 會對應至「principal.user.attribute.labels.key/value」 「principal.platform」設為「LINUX」 「network.application_protocol」設為「SSH」 metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/auth.log | Apr 26 07:39:01 Ubuntu18 CRON[2126]: pam_unix(cron:session): session closed for user root | {timestamp} {principal_hostname}{principal_application}(<optional_field>[{pid}])<optional_field> {security_description} for (invalid user|user)?{principal_user_userid}(by (uid={principal_user_attribute_labels_uid_kv}))?$ | USER_LOGOUT | 時間戳記會對應至 metadata.timestamp 如果 metadata.event_type 為 USER_LOGOUT,則 principal_hostname 會對應至「target.hostname」,否則會對應至「principal.hostname」。 如果 metadata.event_type 為 USER_LOGOUT,則 principal_application 會對應至「target.application」,否則會對應至「principal.application」。 如果 metadata.event_type 為 USER_LOGOUT,則 pid 會對應至「target.process.pid」,否則會對應至「principal.process.pid」。 security_description 會對應至「security_result.description」 如果 metadata.event_type 為 USER_LOGOUT,principal_user_userid 會對應至「principal.user.userid」,否則會對應至「target.user.userid」。 principal_user_attribute_labels_uid_kv 會對應至 principal.user.attribute.labels.key/value 「principal.platform」設為「LINUX」 metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| /var/log/auth.log | May 24 12:56:31 ip-10-50-2-176 sshd[119931]: Timeout, client not responding. | {timestamp} {principal_hostname}{principal_application}([{pid}])<optional_field> {security_result_description} | STATUS_UPDATE | 時間戳記會對應至 metadata.timestamp principal_hostname 對應至 principal.hostname principal_application 對應至 principal.application pid 會對應至 principal.process.pid security_result_description 對應至 security_result_description 「principal.platform」設為「LINUX」 metadata.vendor_name 設為 OSSEC metadata.product_name 設為 OSSEC | 
| var/log/samba/log.winbindd | [2022/05/05 13:51:22.212484, 0] ../source3/winbindd/winbindd_cache.c:3170(initialize_winbindd_cache)initialize_winbindd_cache: clearing cache and re-creating with version number 2 | {timestamp},{severity}(<optional_field>,pid={pid},effective({principal_user_attribute_labels_kv},{principal_group_attribute_labels_kv}),real({principal_user_userid},{principal_group_product_object_id}))?]<message_text>:{security_description} | STATUS_UPDATE | 時間戳記會對應至「metadata.timestamp」 pid is mapped to "principal.process.pid" principal_user_attribute_labels_kv 會對應至「principal.user.attribute.labels」 principal_group_attribute_labels_kv 會對應至「principal.group.attribute.labels」 principal_user_userid 對應至「principal.user.userid」 principal_group_product_object_id 對應至「principal.group.product_object_id」 security_description 會對應至「security_result.description」 metadata_description 會對應至「metadata.description」 metadata.product_name 設為「OSSEC」 「metadata.vendor_name」設為「OSSEC」 | 
| var/log/samba/log.winbindd | messaging_dgm_init: bind failed: No space left on device | {user_id}:{desc} | STATUS_UPDATE | metadata.product_name 設為「OSSEC」 metadata.vendor_name" is set to "OSSEC" user_id 會對應至 principal.user.userid desc 會對應至 metadata.description | 
| var/log/openvpnas.log | 2022-04-29T10:51:22+0530 [stdout#info] [OVPN 4] OUT: '2022-04-29 05:21:22 mohit_AUTOLOGIN/10.50.0.1:16245 MULTI: Learn: 172.27.232.2 -> mohit_AUTOLOGIN/10.50.0.1:16245' | {timestamp}[stdout#{log_level}][OVPN <message_text>]OUT:(<optional_field>'|")<message_text>-<message_text>{user}\/{ip}:{port}MULTI:Learn:{local_ip}->{target_hostname}?{target_ip}:{port}(<optional_field>'|") | NETWORK_HTTP | 時間戳記會對應至 metadata.timestamp log_level 會對應至 security_result.severity local_ip 會對應至 principal.ip target_ip 會對應至 target.ip target_hostname 會對應至 principal.hostname 通訊埠已對應至 target.port 使用者會對應至 principal.user.user_display_name metadata.vendor_name 設為「OpenVPN」 metadata.product_name 設為「OpenVPN Access Server」 principal.platform 設為「LINUX」 | 
| var/log/openvpnas.log | 2022-04-28T16:14:13+0530 [stdout#info] [OVPN 6] OUT: '2022-04-28 16:14:13 library versions: OpenSSL 1.1.1 11 Sep 2018, LZO 2.08' | {timestamp}[stdout#{log_level}][OVPN <message_text>]OUT:(<optional_field>'|")<message_text>{msg}(<optional_field>'|") | STATUS_UPDATE | 時間戳記會對應至 metadata.timestamp log_level 會對應至 security_result.severity msg 會對應至 security_result.description metadata.vendor_name 設為「OpenVPN」 metadata.product_name 設為「OpenVPN Access Server」 principal.platform 設為「LINUX」 | 
| var/log/openvpnas.log | 2022-04-29T10:51:22+0530 [stdout#info] [OVPN 4] OUT: '2022-04-29 05:21:22 10.50.0.1:16245 [mohit_AUTOLOGIN] Peer Connection Initiated with [AF_INET]10.50.0.1:16245 (via [AF_INET]10.50.2.175%ens160)' | {timestamp}[stdout#{log_level}][OVPN <message_text>]OUT:(<optional_field>'|")<message_text>{message}(<optional_field>'|") 訊息會對應至 <message_text>,並包含 [<message_text>]<message_text>:{port}<message_text> | STATUS_UPDATE | 時間戳記會對應至 metadata.timestamp log_level 會對應至 security_result.severity message is mapped to security_result.description metadata.vendor_name 設為「OpenVPN」 metadata.product_name 設為「OpenVPN Access Server」 principal.platform 設為「LINUX」 | 
| var/log/openvpnas.log | 2022-04-29T10:51:22+0530 [stdout#info] [OVPN 4] OUT: "2022-04-29 05:21:22 mohit_AUTOLOGIN/10.50.0.1:16245 SENT CONTROL [mohit_AUTOLOGIN]: 'PUSH_REPLY,explicit-exit-notify,topology subnet,route-delay 5 30,dhcp-pre-release,dhcp-renew,dhcp-release,route-metric 101,ping 12,ping-restart 50,redirect-gateway def1,redirect-gateway bypass-dhcp,redirect-gateway autolocal,route-gateway 172.27.232.1,dhcp-option DNS 10.0.1.99,dhcp-option DNS 10.0.1.94,register-dns,block-ipv6,ifconfig 172.27.232.2 255.255.254.0,peer-id 0,auth-tokenSESS_ID,cipher AES-256-GCM,key-derivation tls-ekm' (status=1)" | {timestamp}[stdout#{log_level}][OVPN <message_text>]OUT:(<optional_field>'|")<message_text>{user}\/{ip}:{message}(<optional_field>'|") | STATUS_UPDATE | 時間戳記會對應至 metadata.timestamp log_level 會對應至 security_result.severity message is mapped to security_result.description 使用者會對應至 principal.user.user_display_name ip is mapped to principal.ip metadata.vendor_name 設為「OpenVPN」 metadata.product_name 設為「OpenVPN Access Server」 principal.platform 設為「LINUX」 | 
| var/log/openvpnas.log | 2022-04-29T10:51:22+0530 [stdout#info] AUTH SUCCESS {'status': 0, 'user': 'mohit', 'reason': 'AuthAutoLogin: autologin certificate auth succeeded', 'proplist': {'prop_autogenerate': 'true', 'prop_autologin': 'true', 'pvt_password_digest': '[redacted]', 'type': 'user_connect'}, 'common_name': 'mohit_AUTOLOGIN', 'serial': '3', 'serial_list': []} cli='win'/'3.git::d3f8b18b'/'OCWindows_3.3.6-2752' | {timestamp}[stdout#{log_level}]{summary}{'<message_text>':({status})?'<message_text>':({user})?'<message_text>':({reason})?<message_text>}, 'common_name':'{user_name}'<message_text>}cli='{cli}' | STATUS_UPDATE | 時間戳記會對應至 metadata.timestamp log_level 會對應至 security_result.severity message is mapped to security_result.description 摘要會對應至 security_result.summary user_name 會對應至 principal.user.user_display_name cli 對應至 principal.process.command_line 狀態會對應至 principal.user.user_authentication_status metadata.vendor_name 設為「OpenVPN」 metadata.product_name 設為「OpenVPN Access Server」 principal.platform 設為「LINUX」 | 
| /var/log/audit.log | type=SYSTEM_RUNLEVEL metadata_description=audit(1651576133.423:202): pid=1571 uid=0 auid=4294967295 ses=4294967295 metadata_description='old-level=N new-level=5 comm="systemd-update-utmp" exe="/lib/systemd/systemd-update-utmp" hostname=? addr=? terminal=? res=success' | type={audit_log_type} | 目前工作表的「稽核記錄」EventType 對應分頁中的 EventType | audit_log_type 對應至 metadata.product_event_type metadata_ingested_timestamp 會對應至「metadata.event_timestamp」 metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.plateform 已設為「LINUX」 資料會對應至鍵/值組合 -> 目前工作表 audit.log 分頁中的 UDM 對應 | 
| var/ossec/logs/ossec.log | 2022/05/12 18:15:34 ossec-syscheckd: INFO: Starting syscheck scan | {timestamp} {application}(({pid}))<optional_field>{severity}:{metadata_description} | STATUS_UPDATE | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity metadata_description 對應至 metadata.description metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| var/ossec/logs/ossec.log | 2022/05/11 19:34:27 ossec-logcollector: INFO: Monitoring full output of command(360): last -n 5 | {timestamp} {application}(({pid}))<optional_field>{severity}:(?<metadata_description>.*command.*(<message_text>)):{command_line} | PROCESS_UNCATEGORIZED | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity command_line 對應至 target.process.command_line metadata_description 對應至 metadata.description metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| var/ossec/logs/ossec.log | 2022/05/11 19:34:27 ossec-analysisd(1210): ERROR: Queue '/queue/alerts/ar' not accessible: 'Connection refused'. | {timestamp} {application}(({pid}))<optional_field>{severity}: Queue '{resource}'<message_text>:'{metadata_description}' | USER_RESOURCE_ACCESS | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity metadata_description 對應至 metadata.description 資源會對應至 target.resource.name metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| var/ossec/logs/ossec.log | 2022/05/11 19:34:27 ossec-logcollector(1950): INFO: Analyzing file: '/var/log/rundeck/rundeck.log'. | {timestamp} {application}(({pid}))<optional_field>{severity}:(?<metadata_description><message_tewxt>file<message_text>):'{file_path}' | FILE_UNCATEGORIZED | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity file_path 會對應至 target.file.full_path metadata_description 對應至 metadata.description metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| var/ossec/logs/ossec.log | 2022/05/11 19:34:25 ossec-syscheckd: INFO: ignoring: 'C:\WINDOWS/PCHEALTH/HELPCTR/DataColl' | {timestamp} {application}(({pid}))<optional_field>{severity}:<message_text>ignoring<message_text>:'{file_path}' | SCAN_PROCESS | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity file_path 會對應至 target.file.full_path metadata.vendor_name 設為 OSSEC metadata.product_name 設為 OSSEC | 
| var/ossec/logs/ossec.log | 2022/05/11 19:34:21 ossec-remoted(1410): INFO: Reading authentication keys file. | {timestamp} {application}(({pid}))<optional_field>{severity}:{metadata_description} | STATUS_UPDATE | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity metadata_description 對應至 metadata.description metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| var/ossec/logs/ossec.log | 2022/05/11 19:34:21 ossec-remoted(1103): ERROR: Could not open file '/queue/rids/004' due to [(13)-(Permission denied)]. | {timestamp} {application}(({pid}))<optional_field>{severity}:(?<metadata_description><message_text>file<message_text>) '{file_path}'<message_text>[({error_code})-({error_metadata_description})] | FILE_UNCATEGORIZED | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity file_path 會對應至 target.file.full_path metadata_description 對應至 metadata.description error_code 會對應至 security_result.summary error_metadata_description 會對應至 security_result.summary metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| var/ossec/logs/ossec.log | 2022/03/23 13:00:51 ossec-remoted(1206): ERROR: Unable to Bind port '1514' | {timestamp} {application}(({pid}))<optional_field>{severity}:{metadata_description}port'{port}' | STATUS_UPDATE | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity metadata_description 對應至 metadata.description 通訊埠已對應至 target.port metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| var/ossec/logs/ossec.log | 2022/05/11 19:32:05 ossec-analysisd: INFO: Reading rules file: 'ms-se_rules.xml' | {timestamp} {application}(({pid}))<optional_field>{severity}:{metadata_description}:'{file_path}' | FILE_READ | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity metadata_description 對應至 metadata.description file_path 會對應至 target.file.full_path metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| var/ossec/logs/ossec.log | 2022/05/11 19:32:06 ossec-analysisd: INFO: Ignoring file: '/etc/mnttab' | {timestamp} {application}(({pid}))<optional_field>{severity}:<message_text>(ignoring|Ignoring file)<message_text>:'{file_path}' | FILE_UNCATEGORIZED | 應用程式會對應至 target.application pid 會對應至 target.process.pid 嚴重性會對應至 security_result.severity file_path 會對應至 target.file.full_path metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 | 
| ntpd 程序 | udp6 0 0 fe80::c59:3eff:fe14:123 :::* 999 20209 570/ntpd | {protocol}{rec}{send}{ip}:{port}<message_text>{pid}/{process_name} | STATUS_UPDATE | 通訊協定會對應至 network.ip_protocol pid 會對應至 principal.process.pid metadata.description 已設為「Program name: %{process_name}」 metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 | 
| syscheck | File '/usr/bin/fwts' modified | 檔案「{file_path}」{description} | FILE_MODIFICATION | 說明會對應至 metadata.description file_path 會對應至 target.file.full_path metadata.vendor_name 設為「OSSEC」 metadata.product_name 設為「OSSEC」 principal.platform 設為「LINUX」 | 
稽核
稽核記錄欄位對應至 UDM 欄位
下表列出稽核記錄類型的記錄欄位,以及對應的 UDM 欄位。
| 記錄欄位 | UDM 欄位 | 
|---|---|
| acct | target.user.user_display_name | 
| addr | principal.ip | 
| arch | about.labels.key/value | 
| auid | target.user.userid | 
| cgroup | principal.process.file.full_path | 
| cmd | target.process.command_line | 
| comm | target.application | 
| cwd | target.file.full_path | 
| 資料 | about.labels.key/value | 
| devmajor | about.labels.key/value | 
| devminor | about.labels.key/value | 
| egid | target.group.product_object_id | 
| euid | target.user.userid | 
| exe | target.process.file.full_path | 
| exit | target.labels.key/value | 
| 家庭 | 如果「ip_protocol」== 2,則 network.ip_protocol 會設為「IP6IN4」,否則會設為「UNKNOWN_IP_PROTOCOL」 | 
| filetype | target.file.mime_type | 
| fsgid | target.group.product_object_id | 
| fsuid | target.user.userid | 
| gid | target.group.product_object_id | 
| 主機名稱 | target.hostname | 
| icmptype | network.ip_protocol 設為「ICMP」 | 
| id | 如果 [audit_log_type] == "ADD_USER",target.user.userid 會設為「%{id}」 如果 [audit_log_type] == "ADD_GROUP",target.group.product_object_id 會設為「%{id}」 else target.user.attribute.labels.key/value is set to id | 
| inode | target.resource.product_object_id | 
| key | security_result.detection_fields.key/value | 
| list | security_result.about.labels.key/value | 
| 模式 | target.resource.attribute.permissions.name target.resource.attribute.permissions.type | 
| name | target.file.full_path | 
| new-disk | target.resource.name | 
| new-mem | target.resource.attribute.labels.key/value | 
| new-vcpu | target.resource.attribute.labels.key/value | 
| new-net | pincipal.mac | 
| new_gid | target.group.product_object_id | 
| oauid | target.user.userid | 
| ocomm | target.process.command_line | 
| opid | target.process.pid | 
| oses | network.session_id | 
| ouid | target.user.userid | 
| obj_gid | target.group.product_object_id | 
| obj_role | target.user.attribute.role.name | 
| obj_uid | target.user.userid | 
| obj_user | target.user.user_display_name | 
| ogid | target.group.product_object_id | 
| ouid | target.user.userid | 
| 路徑 | target.file.full_path | 
| perm | target.asset.attribute.permissions.name | 
| pid | target.process.pid | 
| ppid | target.parent_process.pid | 
| proto | 如果 [ip_protocol] == 2,network.ip_protocol 會設為「IP6IN4」 else network.ip_protocol is set to "UNKNOWN_IP_PROTOCOL" | 
| res | security_result.summary | 
| 結果 | security_result.summary | 
| saddr | security_result.detection_fields.key/value | 
| sauid | target.user.attribute.labels.key/value | 
| ses | network.session_id | 
| sgid | target.group.product_object_id | 
| sig | security_result.detection_fields.key/value | 
| subj_user | target.user.user_display_name | 
| 成功 | 如果 success=='yes',security_result.summary 會設為 'system call was successful' else securtiy_result.summary is set to 'systemcall was failed' | 
| suid | target.user.userid | 
| syscall | about.labels.key/value | 
| 終端機 | target.labels.key/value | 
| tty | target.labels.key/value | 
| uid | 如果 [audit_log_type] 位於 [SYSCALL、SERVICE_START、ADD_GROUP、ADD_USER、MAC_IPSEC_EVENT、MAC_UNLBL_STCADD、OBJ_PID、CONFIG_CHANGE、SECCOMP、USER_CHAUTHTOK、USYS_CONFIG、DEL_GROUP、DEL_USER、USER_CMD、USER_MAC_POLICY_LOAD],則 uid 會設為 principal.user.userid else uid is set to target.user.userid | 
| vm | target.resource.name | 
稽核記錄類型對應至 UDM 事件類型
下表列出稽核記錄類型和對應的 UDM 事件類型。
| 稽核記錄類型 | UDM 事件類型 | 說明 | 
|---|---|---|
| ADD_GROUP | GROUP_CREATION | 在使用者新增使用者空間群組時觸發。 | 
| ADD_USER | USER_CREATION | 在新增使用者空間使用者帳戶時觸發。 | 
| ANOM_ABEND | GENERIC_EVENT / PROCESS_TERMINATION | 當程序異常終止時觸發 (如果已啟用,則會使用可能導致核心傾印的信號)。 | 
| AVC | GENERIC_EVENT | 觸發記錄 SELinux 權限檢查。 | 
| CONFIG_CHANGE | USER_RESOURCE_UPDATE_CONTENT | 稽核系統設定遭到修改時觸發。 | 
| CRED_ACQ | USER_LOGIN | 在使用者取得使用者空間憑證時觸發。 | 
| CRED_DISP | USER_LOGOUT | 在使用者處置使用者空間憑證時觸發。 | 
| CRED_REFR | USER_LOGIN | 使用者重新整理使用者空間憑證時觸發。 | 
| CRYPTO_KEY_USER | USER_RESOURCE_ACCESS | 觸發記錄用於加密目的的加密編譯金鑰 ID。 | 
| CRYPTO_SESSION | PROCESS_TERMINATION | 在建立 TLS 工作階段期間觸發,以記錄設定的參數。 | 
| CWD | SYSTEM_AUDIT_LOG_UNCATEGORIZED | 觸發錄製目前的工作目錄。 | 
| DAEMON_ABORT | PROCESS_TERMINATION | 因發生錯誤而停止精靈時觸發。 | 
| DAEMON_END | PROCESS_TERMINATION | 成功停止精靈時觸發。 | 
| DAEMON_RESUME | PROCESS_UNCATEGORIZED | 在 auditd 精靈恢復記錄時觸發。 | 
| DAEMON_ROTATE | PROCESS_UNCATEGORIZED | 當 auditd 精靈輪替稽核記錄檔時觸發。 | 
| DAEMON_START | PROCESS_LAUNCH | 在啟動 auditd 精靈時觸發。 | 
| DEL_GROUP | GROUP_DELETION | 在使用者空間群組遭刪除時觸發 | 
| 待處理 | USER_DELETION | 在刪除使用者空間使用者時觸發 | 
| EXECVE | PROCESS_LAUNCH | 觸發記錄 execve(2) 系統呼叫的引數。 | 
| MAC_CONFIG_CHANGE | GENERIC_EVENT | 當 SELinux 布林值變更時觸發。 | 
| MAC_IPSEC_EVENT | SYSTEM_AUDIT_LOG_UNCATEGORIZED | 偵測到 IPSec 事件或 IPSec 設定變更時,系統會觸發這項記錄,記錄相關資訊。 | 
| MAC_POLICY_LOAD | GENERIC_EVENT | 載入 SELinux 政策檔案時觸發。 | 
| MAC_STATUS | GENERIC_EVENT | 當 SELinux 模式 (強制執行、寬鬆、關閉) 變更時,系統會觸發這項事件。 | 
| MAC_UNLBL_STCADD | SYSTEM_AUDIT_LOG_UNCATEGORIZED | 使用 NetLabel 提供的核心封包標籤功能時,如果新增靜態標籤,就會觸發這項事件。 | 
| NETFILTER_CFG | GENERIC_EVENT | 偵測到 Netfilter 鏈結修改時觸發。 | 
| OBJ_PID | SYSTEM_AUDIT_LOG_UNCATEGORIZED | 觸發記錄信號傳送至的程序相關資訊。 | 
| PATH | FILE_OPEN/GENERIC_EVENT | 觸發記錄檔案名稱路徑資訊。 | 
| SELINUX_ERR | GENERIC_EVENT | 偵測到內部 SELinux 錯誤時觸發。 | 
| SERVICE_START | SERVICE_START | 在服務啟動時觸發。 | 
| SERVICE_STOP | SERVICE_STOP | 服務停止時觸發。 | 
| SYSCALL | GENERIC_EVENT | 觸發記錄核心的系統呼叫。 | 
| SYSTEM_BOOT | STATUS_STARTUP | 系統啟動時觸發。 | 
| SYSTEM_RUNLEVEL | STATUS_UPDATE | 系統的執行層級變更時觸發。 | 
| SYSTEM_SHUTDOWN | STATUS_SHUTDOWN | 系統關機時觸發。 | 
| USER_ACCT | SETTING_MODIFICATION | 在使用者空間使用者帳戶遭到修改時觸發。 | 
| USER_AUTH | USER_LOGIN | 偵測到使用者空間驗證嘗試時觸發。 | 
| USER_AVC | USER_UNCATEGORIZED | 在產生使用者空間 AVC 訊息時觸發。 | 
| USER_CHAUTHTOK | USER_RESOURCE_UPDATE_CONTENT | 在使用者帳戶屬性修改時觸發。 | 
| USER_CMD | USER_COMMUNICATION | 在執行使用者空間的殼層指令時觸發。 | 
| USER_END | USER_LOGOUT | 在使用者空間工作階段終止時觸發。 | 
| USER_ERR | USER_UNCATEGORIZED | 在系統偵測到使用者帳戶狀態錯誤時觸發。 | 
| USER_LOGIN | USER_LOGIN | 在使用者登入時觸發。 | 
| USER_LOGOUT | USER_LOGOUT | 在使用者登出時觸發。 | 
| USER_MAC_POLICY_LOAD | RESOURCE_READ | 使用者空間精靈載入 SELinux 政策時觸發。 | 
| USER_MGMT | USER_UNCATEGORIZED | 觸發記錄使用者空間管理資料。 | 
| USER_ROLE_CHANGE | USER_CHANGE_PERMISSIONS | 在使用者 SELinux 角色變更時觸發。 | 
| USER_START | USER_LOGIN | 在使用者空間工作階段啟動時觸發。 | 
| USYS_CONFIG | USER_RESOURCE_UPDATE_CONTENT | 偵測到使用者空間系統設定變更時觸發。 | 
| VIRT_CONTROL | STATUS_UPDATE | 在虛擬機器啟動、暫停或停止時觸發。 | 
| VIRT_MACHINE_ID | USER_RESOURCE_ACCESS | 觸發記錄標籤與虛擬機器的繫結。 | 
| VIRT_RESOURCE | USER_RESOURCE_ACCESS | 觸發記錄虛擬機器的資源指派作業。 | 
郵件
將郵件記錄欄位對應至 UDM 欄位
下表列出郵件記錄類型的記錄欄位,以及對應的 UDM 欄位。
| 記錄欄位 | UDM 欄位 | 
|---|---|
| 類別 | about.labels.key/value | 
| Ctladdr | principal.user.user_display_name | 
| 從 | network.email.from | 
| Msgid | network.email.mail_id | 
| Proto | network.application_protocol | 
| 轉接 | intermediary.hostname intermediary.ip | 
| 大小 | network.received_bytes | 
| Stat | security_result.summary | 
| 到 | network.email.to | 
郵件記錄類型對應的 UDM 事件類型
下表列出郵件記錄類型和對應的 UDM 事件類型。
| 郵件記錄類型 | UDM 事件類型 | 
|---|---|
| sendmail | GENERIC_EVENT | 
| pickup | EMAIL_UNCATEGORIZED | 
| 清除 | GENERIC_EVENT | 
| qmgr | EMAIL_UNCATEGORIZED | 
| smtp | GENERIC_EVENT | 
| local | EMAIL_UNCATEGORIZED | 
後續步驟
還有其他問題嗎?向社群成員和 Google SecOps 專業人員尋求答案。