收集 OSSEC 日志

支持的平台:

本文档介绍了如何通过配置 OSSEC 和 Google 安全运营转发器来收集 OSSEC 日志。本文档还列出了支持的日志类型和支持的 OSSEC 版本。

如需了解详情,请参阅将数据提取到 Google 安全运营中心

概览

下图展示了 OSSEC 代理和服务器如何配置为将日志发送到 Google 安全运营团队。每个客户部署都可能与此表示法不同,并且可能更复杂。

部署架构

架构图显示了以下组件:

  • Linux 系统。要监控的 Linux 系统。Linux 系统由要监控的文件和 OSSEC 代理组成。

  • Microsoft Windows 系统。要监控的 Microsoft Windows 系统(其中安装了 OSSEC 代理)。

  • OSSEC 代理。OSSEC 代理会从 Microsoft Windows 或 Linux 系统收集信息,并将信息转发到 OSSEC 服务器。

  • OSSEC 服务器。OSSEC 服务器监控 OSSEC 代理并接收其信息,分析日志,并将日志转发到 Google Security Operations 转发器。

  • Google Security Operations 转发器。Google 安全运营转发器是一种部署在客户网络中的轻量级软件组件,支持 Syslog。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 安全运营解析器支持 OSSEC 3.6.0 版。

  • 确保在中央 Linux 服务器上安装并配置 OSSEC 服务器。

  • 验证 Google Security Operations 解析器支持的日志类型。 下表列出了 Google 安全运营解析器支持的产品和日志文件路径:

    操作系统 产品 日志文件路径
    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 Samba /var/log/samba/log.winbindd
    Linux Linux /var/log/mail.log
  • 确保部署架构中的所有系统都使用世界协调时间 (UTC) 时区进行配置。

配置 OSSEC 代理和服务器,以及 Google 安全运营转发器

如需配置 OSSEC 代理和服务器以及 Google 安全运营转发器,请执行以下操作:

  1. 如需监控 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>
    
    
  2. 如需监控 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>
    
  3. 如需使用 syslog 协议将日志从 OSSEC 服务器转发到 Google 安全运营团队,请使用以下格式创建 syslog.conf OSSEC 服务器配置文件:

    .*.@<CHRONICLE_FORWARDER_IP>:<CHRONICLE_FORWARDER_PORT>
    
  4. 配置 Google Security Operations 转发器,以将日志发送到 Google Security Operations。如需了解详情,请参阅在 Linux 上安装和配置转发器。以下是 Google 安全运营转发器配置示例:

      - 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
    

字段映射参考文档

本部分介绍了 Google 安全运维解析器如何为 Linux 和 Microsoft Windows 系统应用 Grok 模式,以及如何针对每种日志类型将 OSSEC 日志字段映射到 Google 安全运维 Unified Data Model (UDM) 字段。

如需了解常见字段的映射参考,请参阅常见字段

如需有关 Linux 系统上日志路径、示例日志的 Grok 模式、事件类型和 UDM 字段的参考信息,请参阅以下部分:

如需了解受支持的 Microsoft Windows 事件和相应的 UDM 字段,请参阅 Microsoft Windows 事件数据

常用字段

下表列出了常见的日志字段及其对应的 UDM 字段。

常见日志字段 UDM 字段
collected_time metadata.collected_timestamp
应用 principal.application
log 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

timestamp 会映射到 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

timestamp 会映射到 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

timestamp 会映射到 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

timestamp 会映射到 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

timestamp 会映射到 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

host 会映射到 principal.hostname

时间戳映射到 metadata.event_timestamp

方法映射到 network.http.method

resource 映射到 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

host 会映射到 principal.hostname

时间戳映射到 metadata.event_timestamp

方法映射到 network.http.method

resource 映射到 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 映射到 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

time 会映射到 metadata.timestamp

IP 地址映射到 target.ip

principal_ip 会映射到 principal.ip

principal_user_userid 会映射到 principal.user.userid

metadata_timestamp 会映射到 timestamp

http_method 映射到 network.http.method

resource_name 映射到 principal.resource.name

protocol 映射到 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

severity 会映射到 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] 所需命令检查失败 [<message_text>]{security_description} STATUS_UPDATE

time 会映射到 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] 检查文件“/dev/.oz/.nap/rkit/terror”[ 未找到 ] [<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:文件大小已缩减(inode 保持不变):'/var/log/rkhunter.log'。 (<optional_field><message_text>:){metadata_description}:'{file_path}' FILE_UNCATEGORIZED

time 会映射到 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 7 月 7 日 18:48:32 zynvpnsvr 内核:[2081387.006876] IPv4:来自 192.0.2.1 的火星源代码 1.20.32.39,开发者为 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 已映射到“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

message 映射到 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

description 映射到 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

description + reason 会映射到 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

message 映射到 metadata.description

metadata.vendor_name 设置为“OSSEC”

metadata.product_name 设置为“OSSEC”

principal.platform 设置为“LINUX”

command_line 映射到 principal.process.command_line

/var/log/syslog.log 5 月 2 日 00:00:45 localhost fstrim[64727]: /: 6.7 GiB (7205015552 字节) 已修剪 {collected_timestamp}{hostname}{command_line}(<optional_field>|[{pid}]):{message} STATUS_UPDATE

collected_time 映射到 metadata.event_timestamp

将主机名映射到 principal.hostname

pid 会映射到 principal.process.pid

message 映射到 metadata.description

metadata.vendor_name 设置为“OSSEC”

metadata.product_name 设置为“OSSEC”

principal.platform 设置为“LINUX”

command_line 映射到 principal.process.command_line

/var/log/syslog.log 5 月 3 日 10:14:37 localhost rsyslogd:rsyslogd 的用户 ID 已更改为 102 {collected_timestamp}{hostname}{command_line}:{message}to{user_id} STATUS_UPDATE

collected_time 会映射到 metadata.collected_timestamp

主机名会映射到 principal.hostname

message 映射到 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

message 映射到 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

application 映射到 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

application 映射到 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

application 映射到 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

application 映射到 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

application 映射到 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

application 映射到 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 - 通过点表示法访问配置键“[filterNames]”已废弃,并将在未来的版本中移除。请改用“config.getProperty(key, targetClass)”。 [{timestamp}]{severity}{summary}\-{security_description}

,\({file_path}:<message_text>\){command_line}

STATUS_UPDATE

command_line 会映射到“target.process.command_line”

file_path 已映射到“target.process.file.full_path”

时间戳映射到“metadata.event_timestamp”

severity 映射到“security_result.severity”

summary 映射到“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 设置为 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]: 用户 root 的新会话 3205。 {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 设置为 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

timestamp 会映射到 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

timestamp 会映射到 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

timestamp 会映射到 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 5 月 24 日 12:56:31 ip-10-50-2-176 sshd[119931]: 超时,客户端无响应。 {timestamp} {principal_hostname}{principal_application}([{pid}])<optional_field> {security_result_description} STATUS_UPDATE

timestamp 会映射到 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 已映射到“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”设置为“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

timestamp 会映射到 metadata.timestamp

log_level 会映射到 security_result.severity

local_ip 映射到 principal.ip

target_ip 映射到 target.ip

target_hostname 会映射到 principal.hostname

port 已映射到 target.port

user 会映射到 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

timestamp 会映射到 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>with[<message_text>]<message_text>:{port}<message_text>

STATUS_UPDATE

timestamp 会映射到 metadata.timestamp

log_level 会映射到 security_result.severity

message 映射到 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

timestamp 会映射到 metadata.timestamp

log_level 会映射到 security_result.severity

message 映射到 security_result.description

user 会映射到 principal.user.user_display_name

ip 已映射到 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

timestamp 会映射到 metadata.timestamp

log_level 会映射到 security_result.severity

message 映射到 security_result.description

summary 映射到 security_result.summary

user_name 映射到 principal.user.user_display_name

cli 会映射到 principal.process.command_line

status 会映射到 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}=audit((<optional_field>{metadata_ingested_timestamp}|{metadata_ingested_timestamp})<message_text>:<message_text>):{audit_message} 当前工作表“审核日志 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

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 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

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 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

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 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

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 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

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 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

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 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:由于 [(13)-(Permission denied)],无法打开文件“/queue/rids/004”。 {timestamp} {application}(({pid}))<optional_field>{severity}:(?<metadata_description><message_text>file<message_text>) '{file_path}'<message_text>[({error_code})-({error_metadata_description})] FILE_UNCATEGORIZED

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 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

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 security_result.severity

metadata_description 映射到 metadata.description

port 已映射到 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

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 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

application 会映射到 target.application

pid 会映射到 target.process.pid

severity 会映射到 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 设置为 程序名称:%{process_name}

metadata.vendor_name 设置为“OSSEC”

metadata.product_name 设置为“OSSEC”

principal.platform 设置为“LINUX”

syscheck 修改了文件“/usr/bin/fwts” 文件“{file_path}”{description} FILE_MODIFICATION

description 映射到 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
data 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
family 如果“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}”

否则,将 target.user.attribute.labels.key/value 设置为 id

inode target.resource.product_object_id
key security_result.detection_fields.key/value
list security_result.about.labels.key/value
mode target.resource.attribute.permissions.name

target.resource.attribute.permissions.type

名称 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
操作系统 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 设置为“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',则 securtiy_result.summary 会设为“系统调用成功”

否则,securtiy_result.summary 会设为“systemcall 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 设置为 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 触发此事件可记录用于加密用途的加密密钥标识符。
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 配置发生变化时触发,以记录 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 在执行用户空间 shell 命令时触发。
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
自提 EMAIL_UNCATEGORIZED
清理 GENERIC_EVENT
qmgr EMAIL_UNCATEGORIZED
smtp GENERIC_EVENT
local EMAIL_UNCATEGORIZED

后续步骤

需要更多帮助?向社区成员和 Google SecOps 专业人士寻求解答。