James Thomas
09/23/2024, 7:09 PMinstance
over uuid
- Additional context: I'm shipping result logs to pubsub, where the hostIdentifer is correctly reporting the osquery instance id (osquery_host_id)
It appears that when using a host identifier type of instance
, there's no way to correlate query outputs to hosts. /api/v1/fleet/hosts
doesn't provide osquery_host_id (I have scoured the code for a while and can't figure out why) - so unless there's some secret way to get that via the API, I guess I'll need to dump the DB to bigquery.
Screenshots in 🧵James Thomas
09/23/2024, 7:09 PMJames Thomas
09/23/2024, 7:11 PM{
"created_at": "2024-09-23T18:13:14Z",
"updated_at": "2024-09-23T18:14:02Z",
"software_updated_at": "2024-09-23T18:14:02Z",
"id": 21,
...
"hostname": "FWX02LW3Q9",
"uuid": "61E1C9A5-8A18-5727-BDFF-13AF90C9EFAB",
"platform": "darwin",
"osquery_version": "5.13.1",
"orbit_version": "1.33.0",
...
}
James Thomas
09/23/2024, 7:12 PMJames Thomas
09/23/2024, 7:13 PMRebecca Cowart
09/23/2024, 8:35 PMinstance
instead of uuid
, because your host is a virtual machine? Also, could you share one of the queries in question?James Thomas
09/23/2024, 8:42 PMhostIdentifier
in the screenshot above is tacked on by fleet, the full json object sent to pubsub for all scheduled query results looks like this:
{
"action": "added",
"calendarTime": "Mon Sep 23 18:16:54 2024 UTC",
"columns": {
(Query results)
},
"counter": 0,
"epoch": 0,
"hostIdentifier": "d8caebae-b6e2-47d3-a5ae-27586da00f2c",
"name": "pack_Global_SOME_QUERY_NAME",
"numerics": false,
"unixTime": 1727115414
}
That hostIdentifier above, it's the osquery_host_id, not the machine's UUID. When using instance
that osquery_host_id != uuid.
The fleet API doesn't return osquery_host_id
, only uuid
(which is still collected and stored, even when using instance
- so I have no way to pair this result up with a hostname unless I hit the fleet db directly (which I'd really prefer not to do, since the API is pretty great and we're already using it to pull hosts)James Thomas
09/23/2024, 8:44 PMKathy Satterlee
09/23/2024, 9:43 PMdecorator
and include the hostname in your osquery logs.Kathy Satterlee
09/23/2024, 9:43 PMKathy Satterlee
09/23/2024, 9:43 PMJames Thomas
09/23/2024, 9:46 PMJames Thomas
09/23/2024, 9:54 PMKathy Satterlee
09/23/2024, 9:56 PMKathy Satterlee
09/23/2024, 9:56 PMJames Thomas
09/23/2024, 9:58 PMJames Thomas
09/23/2024, 9:59 PMKathy Satterlee
09/23/2024, 10:00 PMI assumed overrides are additive and not a total replacement rightThey are actually a total replacement.
Kathy Satterlee
09/23/2024, 10:01 PMKathy Satterlee
09/23/2024, 10:06 PM``` # Note configs in overrides take precedence over the default config defined
# under the config key above. Hosts receive overrides based on the platform
# returned by. In this example, the baseSELECT platform FROM os_version
# config would be used for Windows and CentOS hosts, while Mac and Ubuntu
# hosts would receive their respective overrides. Note, these overrides are
# NOT merged with the top level configuration.```
James Thomas
09/23/2024, 10:11 PMlinux
instead of ubuntu
for ubuntu overrides, so upon first glance my mac logs had no decorations but my ubuntu machine did. I likely developed my logging transport logic off macos test data (and thus never noticed the decoration data available, even though I had set it!)James Thomas
09/23/2024, 10:12 PMKathy Satterlee
09/23/2024, 10:27 PM