fleetdm / fleet

Open-source platform for IT, security, and infrastructure teams. (Linux, macOS, Chrome, Windows, cloud, data center)
https://fleetdm.com
Other
2.94k stars 409 forks source link

Querying wifi_status is not returning network_name but wifi_networks does #22195

Open allenhouchins opened 1 day ago

allenhouchins commented 1 day ago

Fleet version: 4.56.0

Web browser and operating system: Safari or Chrome


💥  Actual behavior

Running the query SELECT * FROM wifi_networks; (or pairing that down to SELECT network_name FROM wifi_networks;) returns expected results. Running SELECT * FROM wifi_status; (or SELECT network_name FROM wifi_status;) returns an empty value.

🧑‍💻  Steps to reproduce

  1. Run the query SELECT * FROM wifi_networks; and notice network_name being populated
  2. Run the query SELECT * FROM wifi_status; and notice network_name has no data

🕯️ More info (optional)

This is important for admins and help desk agents to be able to query what network devices are actively connected to. There is other information missing from wifi_status that needs to be addressed too.

allenhouchins commented 1 day ago

These commands return the expected results (all using system_profiler): system_profiler SPAirPortDataType | awk '/Current Network Information:/ { getline; print substr($0, 13, (length($0) - 13)); exit }' or /usr/libexec/PlistBuddy -c 'Print :0:_items:0:spairport_airport_interfaces:0:spairport_current_network_information:_name' /dev/stdin <<< "$(system_profiler SPAirPortDataType -xml)" 2> /dev/null or system_profiler -json SPAirPortDataType | jq -r '.SPAirPortDataType[0].spairport_airport_interfaces[0].spairport_current_network_information._name'