windows - 为什么 OSQuery 在读取 Windows EventLogs 时不包含 "Computer"事件信息?

标签 windows event-log osquery

我正在尝试在具有 WEF/WEC 的环境中使用 OSQuery,我想做的是收集通过 WEC 服务器中的订阅存储的所有 Windows 事件。

我的问题是,当我通过 OSQuery 收集 Windows 事件时,我似乎无法获取包含实际生成事件的主机名的“计算机”字段。

有人设法让这个工作吗?或者这是 OSquery 的实际限制?查看 windows_events 表架构 ( https://osquery.io/schema/4.5.1/#windows_events ) 时,似乎没有考虑“计算机”字段。

作为示例,我在名为 DESKTOP-JC2OUUQ 的主机中配置了 WEC,并且在那里订阅了名为 DESKTOP-BEH0A7O 的笔记本电脑。事件日志正确流向 WEC,我可以接收它们。以下是我收到的事件之一:

<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event" xml:lang="en-US">
<System>
  <Provider Name="Microsoft-Windows-Security-SPP" Guid="{E23B33B0-C8C9-472C-A5F9-F2BDFEA0F156}" EventSourceName="Software Protection Platform Service" /> 
  <EventID Qualifiers="16384">16384</EventID> 
  <Version>0</Version> 
  <Level>4</Level> 
  <Task>0</Task> 
  <Opcode>0</Opcode> 
  <Keywords>0x80000000000000</Keywords> 
  <TimeCreated SystemTime="2020-10-22T16:20:17.2647971Z" /> 
  <EventRecordID>907</EventRecordID> 
  <Correlation /> 
  <Execution ProcessID="0" ThreadID="0" /> 
  <Channel>Application</Channel> 
  <Computer>DESKTOP-BEH0A7O</Computer> 
  <Security /> 
  </System>
<EventData>
  <Data>2020-12-18T12:30:17Z</Data> 
  <Data>RulesEngine</Data> 
  </EventData>
<RenderingInfo Culture="en-US">
  <Message>Successfully scheduled Software Protection service for re-start at 2020-12-18T12:30:17Z. Reason: RulesEngine.</Message> 
  <Level>Information</Level> 
  <Task /> 
  <Opcode /> 
  <Channel /> 
  <Provider>Microsoft-Windows-Security-SPP</Provider> 
<Keywords>
  <Keyword>Classic</Keyword> 
  </Keywords>
  </RenderingInfo>
  </Event>

当我尝试使用 OSQuery 收集此事件时,我得到以下输出:

{
    "name": "windows_events_query",
    "hostIdentifier": "DESKTOP-JC2OUUQ",
    "calendarTime": "Thu Oct 22 16:26:14 2020 UTC",
    "unixTime": 1603383974,
    "epoch": 0,
    "counter": 0,
    "numerics": false,
    "decorations": {
        "host_uuid": "A7A0828C-1264-4E24-A67F-F5B69BE86165",
        "username": "vagrant"
    },
    "columns": {
        "data": "{\"EventData\":[\"2020-12-18T12:30:17Z\",\"RulesEngine\"]}",
        "datetime": "2020-10-22T16:20:17.2647971Z",
        "eventid": "16384",
        "keywords": "0x80000000000000",
        "level": "4",
        "provider_guid": "{E23B33B0-C8C9-472C-A5F9-F2BDFEA0F156}",
        "provider_name": "Microsoft-Windows-Security-SPP",
        "source": "Application",
        "task": "0",
        "time": "1603383958"
    },
    "action": "added"
}

正如您所看到的,在其他字段中,我没有看到“计算机”标签,据我所知,该标签是唯一包含生成事件的实际主机的标签。 有什么方法可以通过 OSQuery 获取该值吗?还是有限制?

谢谢!

最佳答案

Osquery 不支持计算机 字段。现在是这样:

https://github.com/osquery/osquery/pull/6952

关于windows - 为什么 OSQuery 在读取 Windows EventLogs 时不包含 "Computer"事件信息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64481969/

相关文章:

windows - 如何通过 apt-cyg 安装 cygwin/X

windows - 可执行文件的名称对用户帐户控制对话框有影响吗?

windows - Grand Central Dispatch (`libdispatch` ) 能否在 Windows 上可用?

c# - 如何只读取添加到事件日志的新事件?

shell - 运行进程会弄乱 shell

osquery - 如何远程执行对 osquery 的 SQL 查询?

sql - 如何在 linux shell 上的 sql 查询中使用 "%"字符?

windows - 如何更改 Chromium 浏览器 Logo 和名称?

.net - 为什么在 EventLog 上使用 ETW,反之亦然?

azure - 使用 Azure 的事件日志