kolide / launcher

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

Detect non-root when running launcher flare/doctor on the command-line #1734

Open RebeccaMahany opened 4 months ago

RebeccaMahany commented 4 months ago

We have some checkups that do not work if flare/doctor is not run with elevated permissions. We want to detect if flare/doctor is being run without the necessary permissions and warn the user. If possible, we'd like to proceed by re-execing with elevated permissions; if not possible, we should print instructions for running the command correctly.

The implementation will be a little different on posix vs Windows. On posix, after warning the user, we can re-exec using something like sudo $0. We are not sure if this is possible on Windows.

directionless commented 4 months ago

We may decide that the user experience of this isn't smooth, and the juice isn't worth the squeeze. Some initial experimentation is needed.

RebeccaMahany commented 1 month ago

I think @zackattack01 did most of this issue in https://github.com/kolide/launcher/pull/1824