feat(suidhelper): run the firecracker jailer through the setuid helper#47
Merged
Conversation
The BEAM no longer invokes the jailer binary directly. It calls the helper with a new `jailer` subcommand passing only untrusted-origin values (--id, --uid, --gid, repeated --cgroup KEY=VALUE, --api-sock); the helper reads the firecracker/jailer binary paths, chroot base, parent cgroup and accepted uid/gid band from its trusted /etc/hyper/config.toml, validates the caller's args, re-acquires permanent root, and execve's the jailer in place (same pid, so MuonTrap.Daemon keeps supervising it). Config: the helper's tool paths move into a `[tools]` table (joining the existing dmsetup/losetup/blockdev with new firecracker/jailer keys) and jail placement into `[jails]` (cgroup, uid_gid_range) -- matching the namespaces the Elixir node already reads. firecracker/jailer have no default and surface BinError::Unconfigured when absent; a present uid_gid_range with min==0 or min>max is fatal at load. Adds setuid_privileged::become_root_permanently (seal real+effective+saved uid/gid to 0, reset supplementary groups) for the execve handoff -- no Drop guard because execve replaces the image and the jailer drops its own privs. jailer.rs validates every caller value with refusal-first proptests (vm_id, id range, cgroup KEY=VALUE, api-sock shape). Elixir Jailer.command/2 emits the trimmed argv against Cfg.Tools.suidhelper().
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.