Hi all - when I look at a single host in the Hosts...
# fleet
m
Hi all - when I look at a single host in the Hosts section, there is a spot where the Public IP is displayed. Where is that data sourced from? Is this a backend query? I'd like to use that public IP data in other queries.
k
Fleet attempts to grab that from common http headers when processing incoming requests: https://fleetdm.com/docs/deploy/public-ip
m
Thanks Kathy! Does that data get deposited into a table anywhere?
k
It's in the hosts table in Fleet, but not reachable with
osquery
sadly.
m
Bummer, ok.
k
We were originally getting Public IP with a query, but it proved to be a bit unreliable, and still required additional processing in Fleet
m
Yeah, I was hoping this would work since curling the IP isn't reliable, as you said
k
Depending on what environment the host is in, you could in theory run a query through the curl table
Lol
m
Unfortunately the curl table fails more often than not due to certificate issues.
k
It's a little sticky.
I have a completely non-fleshed-out idea that I might try out: 1. Set up a local cron job that : a. uses curl to hit an API and fetch the publicIP b. Writes the result to file 2. Use
file_lines
or
plist
to grab that data as a decorator
Would still likely not be 100% accurate all of the time, but could do the trick.