Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust paths in checkups to accommodate NixOS #1558

Merged

Conversation

RebeccaMahany
Copy link
Contributor

@RebeccaMahany RebeccaMahany commented Jan 23, 2024

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

Comment on lines 71 to +74
case "darwin":
return "/usr/local/kolide-k2"
case "linux":
if allowedcmd.IsNixOS() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
case "darwin":
return "/usr/local/kolide-k2"
case "linux":
if allowedcmd.IsNixOS() {
case "darwin", "linux":
if allowedcmd.IsNixOS() {

I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so -- IsNixOS is an OS check, not if the package manager is in use. I kept it pretty narrowly scoped to start.

I am not sure how much of the changes I've made so far adequately support Nix on Darwin right now -- could be fine, but I haven't tested it at all yet.

@RebeccaMahany RebeccaMahany marked this pull request as ready for review January 30, 2024 22:05
@RebeccaMahany RebeccaMahany added this pull request to the merge queue Jan 31, 2024
Merged via the queue into kolide:main with commit fc8436b Jan 31, 2024
26 checks passed
@RebeccaMahany RebeccaMahany deleted the becca/nixos-checkup-adjustments branch January 31, 2024 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants