Repository navigation
Conversation
ak-agent-desktop runs unprivileged and can't open sysd's CTRL socket
(SysdSocketID::CTRL, SocketPermMode::Admin), which currently only the
root-run `ak-sysd domains join` CLI can reach. Add a temporary,
per-session elevation path instead of running the whole app elevated:
- New `ak-sysd-ctrl-relay` binary that pumps bytes between an
unprivileged rendezvous endpoint and the real CTRL socket.
- `ak_platform::net::elevate` drives it per platform (pkexec on Linux,
a locked-down rendezvous pipe + ShellExecuteExW("runas") on Windows,
an SMAppService-registered daemon reached over XPC on macOS) and
hands back a plain tonic Channel, so `Client::new_elevated_ctrl()`
is a drop-in for existing SystemCtrlClient<Channel> call sites.
- New polkit action `io.goauthentik.platform.sysd-ctrl-relay`
(auth_admin_keep), distinct from the existing self-auth-only
`io.goauthentik.platform.authorize` action used by ak-platform-authz.
Linux path is compiled, clippy-clean, and covered by the existing net
test suite. Windows and macOS code is hand-verified against their
respective APIs but not built/run (no toolchain in this environment) —
flagged inline the same way agent_starter/win.rs already does.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds the relay helper binary (and, on macOS, its embedded LaunchDaemon plist) to each platform's build/package pipeline, and registers the macOS SMAppService daemon from ak-agent-desktop at startup: - Linux: build target + nfpm entry shipping it in the agent-desktop package at /usr/bin/ak-sysd-ctrl-relay, root-owned 0755 so pkexec trusts it per its target-path requirements. - Windows: build target + signing + a File entry in the existing sysd Component, landing at the exact path net::elevate::windows expects alongside ak-sysd. - macOS: build target + copies the binary into Contents/MacOS and its launchd plist into Contents/Library/LaunchDaemons, matching what SMAppService.daemon(plistName:) expects to find in the app bundle. ak-agent-desktop now calls ensure_registered() at startup (best-effort — a pending user approval shouldn't block the rest of the app). Whole workspace (minus the Windows-only ee/wcp crates, which can't build off Windows) still checks and clippetes clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
# Conflicts: # Cargo.lock # Makefile # ak-platform/Cargo.toml
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.