fleet/orbit/pkg
Scott Gress 0966e9e99c
Fix orbit process launch issues that can hit /proc/keys limits (#32309)
for #32112

# Details

This PR reverts some earlier work using `runuser` and `runcon` intended
to allow Orbit to launch Fleet Desktop in the logged-in user's SELinux
context. This didn't work for out-of-the-box SELinux enforcement setups,
with a side-effect of each failed attempt to launch the desktop app
creating a new kernel keyring that doesn't get cleaned up until Orbit
quits (or GC runs, although I didn't see that happen in testing). While
using `runuser` has some possible benefits over using `sudo` to launch
processes, it also (when using `-l` to start a login shell) creates a
new keyring. This is not an issue if the command to launch the process
succeeds, but if it fails and retries over and over, we start amassing
keyrings.

It is the opinion of several other engineers (and now myself as well)
that the real solution to various Fleet Desktop launching issues is to
launch the desktop app as a user service using `systemctl --user` so
that it automatically inherits the user's environment, context, etc.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

# Testing
- [X] QA'd all new/changed functionality manually
  - [ ] ~Ubuntu with SELinux on~ this is a very uncommon setup
  - [x] Ubuntu with SELinux off
- [X] Fedora with SELinux on - double checked that `getenforce` returned
`Enforcing` this time
  - [X] Fedora with SELinux off
  - [ ] ~Debian with SELinux on~ this is a very uncommon setup
  - [X] Debian with SELinux off
- [x] `runWithOutput` still works (tested with `go run
./tools/dialog/main.go --dialog=zenity` on all platforms)
- [ ] ~`runWithStdin` still works~ (this isn't currently used by Linux)

## fleetd/orbit/Fleet Desktop

- [X] Verified compatibility with the latest released version of Fleet
(see [Must
rule](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/workflows/fleetd-development-and-release-strategy.md))
- [X] If the change applies to only one platform, confirmed that
`runtime.GOOS` is used as needed to isolate changes
- [X] Verified that fleetd runs on macOS, Linux and Windows
- [ ] Verified auto-update works from the released version of component
to the new version (see [tools/tuf/test](../tools/tuf/test/README.md))
2025-08-28 09:20:32 -05:00
..
augeas fleetctl, API, copy updates around host identifiers (#20220) 2024-07-09 10:25:01 -07:00
bitlocker Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
build Add user agent to Orbit HTTP client (#5429) 2022-05-02 11:03:49 -07:00
constant Host identity cert renewal (#31372) 2025-07-30 16:46:36 +02:00
cryptoinfo Enable staticcheck Go linter. (#23487) 2024-11-05 11:16:24 -06:00
dataflatten Additional CA validation (#27169) 2025-03-19 08:27:55 -05:00
dialog Removed indicator for background LUKS validation (#28218) 2025-04-16 12:25:41 -04:00
execuser Fix orbit process launch issues that can hit /proc/keys limits (#32309) 2025-08-28 09:20:32 -05:00
go-paniclog Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
insecure Make creation of http.Client uniform across the codebase (#3097) 2021-11-24 15:56:54 -05:00
installer Fix installer tarball extraction in fleetd for archives with unknown header flags/files declared before parent dirs (#31547) 2025-08-04 11:11:57 -05:00
kdialog Removed indicator for background LUKS validation (#28218) 2025-04-16 12:25:41 -04:00
keystore Add gosimple linter (#23250) 2024-10-29 14:17:51 -05:00
logging Reduce orbit logging when the server is down (#16968) 2024-02-21 15:36:15 -03:00
luks Re-verify Linux disk encryption #26693 (#29034) 2025-05-22 16:15:26 -04:00
lvm Linux agent LVM volume detection on older Ubuntu versions (#24193) 2024-11-27 10:39:25 -07:00
migration fix: add missing comments 2024-08-15 19:00:47 -04:00
osquery Perform early restart before starting sub-systems and minor refactor of orbit sub-systems (#20610) 2024-07-19 12:44:43 -03:00
osservice 8009 fleet desktop icon duplication (#8017) 2022-10-13 10:58:37 -03:00
packaging [orbit/packaging] delay restart for in-band pkg upgrade on Linux (#31286) 2025-07-28 15:55:44 +02:00
platform Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
process Fleetctl to package .app bundles for osquery (and changes for orbit to support them) (#4393) 2022-03-15 16:04:12 -03:00
profiles Fallback to ConfigurationURL when ConfigurationWebURL is not set in macOS MDM enrollment profile (#30462) 2025-07-02 13:47:42 -05:00
scripts Fix Windows lint issues and enable linting on Windows (#28704) 2025-05-02 16:11:26 -04:00
setup_experience Fixed setup experience UI hanging when a step is removed from the payload (#29385) 2025-05-22 14:58:17 -04:00
swiftdialog 28434 Setup experience reliability (#28931) 2025-05-08 14:05:31 -04:00
table Add ability to determine Bitlocker protectors (#31090) 2025-07-24 18:30:55 -04:00
token Fixing fleetd to NOT make unnecessary duplicate call to orbit/device_token endpoint. (#15543) 2023-12-10 17:00:24 -06:00
update Add arm64 support for fleetd extensions and fixes on test scripts (#31084) 2025-07-21 15:47:59 -03:00
user Run fleet desktop with user SELinux context when applicable (#30882) 2025-07-25 08:44:13 -05:00
useraction Fix [here] links in Go code (#29722) 2025-06-03 15:13:59 -06:00
windows Add Kolide osquery tables 2023-11-01 20:11:35 -06:00
zenity Removed indicator for background LUKS validation (#28218) 2025-04-16 12:25:41 -04:00