kolide / launcher

Osquery launcher, autoupdater, and packager
https://kolide.com/launcher
Other
503 stars 98 forks source link

Adjust paths in checkups to accommodate NixOS #1558

Closed RebeccaMahany closed 7 months ago

RebeccaMahany commented 7 months ago

A couple checkups refer to the /usr/local/kolide-k2 directory, which will not exist on NixOS. This PR adjusts paths where necessary to find the appropriate location on NixOS.

A successful `launcher doctor` run ``` $ sudo ./launcher doctor --osqueryd_path /nix/store/9n4rqjklvv4a5gpwhnni18b4n042gidh-kolide-launcher-1.4.5/bin/osqueryd --hostname k2device.kolide.com {"caller":"main.go:36","msg":"Launcher starting up","revision":"6de4a0ebd0e45ae49355369ff405332fe32d155a","severity":"info","ts":"2024-01-30T22:04:51.337826879Z","version":"1.4.5-14-g6de4a0e"} Platform: platform: linux, architecture: amd64 Launcher Version: launcher_version 1.4.5-14-g6de4a0e Host Info: hostname: nixos-2311-first.c.launcher-test-vms-156a-156a.internal, uptime: 11 days, 7 hours, 17 minutes, 18 seconds ✅ Process Report: found 3 kolide processes, at least one running as root or system ✅ Root directory contents: root directory (/var/kolide-k2/k2device.kolide.com/) contains 21 files ✅ Check communication with Kolide: successfully connected to device and control server ✅ Logs: debug.json is 544518 bytes, and was last modified at 2024-01-30 22:04:37.102442327 +0000 UTC ✅ Binary directory contents: binary directory (/nix/store/9n4rqjklvv4a5gpwhnni18b4n042gidh-kolide-launcher-1.4.5/bin) contains 2 files ✅ Enrollment Secret: claim for nababe ✅ Network Report: launcher can listen on local network ✅ Osquery: osqueryd version 5.11.0 ❌ Launcher Flags: failed to stat /etc/kolide-k2/launcher.flags: stat /etc/kolide-k2/launcher.flags: no such file or directory ? Gnome Extensions: no gnome users found ✅ Quarantine: no quarantine directories found ✅ System Time: system time is within 5.000000 minutes of server date header, delta = 0.027195 minutes ✅ DNS Resolution: successfully resolved 5/5 hosts ✅ TUF: Successfully gathered release version launcher/linux/amd64/launcher-1.4.5.tar.gz from https://tuf.kolide.com:443/repository/targets.json ✅ Osquery Conflicts: No notable directories were detected ⚠️ Server Data: no server_data store in knapsack ✅ Osquery Data: hardware_vendor: Google, os_build: 23.11.20240117.8bf65f1, os_name: NixOS, os_version: 23.11 (Tapir), hardware_model: Google Compute Engine, hardware_serial: GoogleCloud-DD400E1384144374F694A68747581BD1, hardware_uuid: dd400e13-8414-4374-f694-a68747581bd1 Checkups with warnings: * Server Data Checkups with failures: * Launcher Flags ```