feat: add allow_exec_sugid config option for setuid binary execution#26
Merged
feat: add allow_exec_sugid config option for setuid binary execution#26
Conversation
Add opt-in execution of setuid/setgid binaries for MCP server support. Resolves forbidden-exec-sugid violations while maintaining secure deny-by-default. - New ExecSugid enum: Allow(bool) or Paths(Vec<String>) - Config field with TOML syntax: false (deny), true (allow all), ["/bin/ps"] - Profile composing with last-wins/paths-union merge semantics - Config merge: project overrides global, paths are unioned - CLI flag --allow-exec-sugid PATH (repeatable, path-based only) - Seatbelt rule generation with path validation - explain command shows sugid status; init template includes example - 27 new tests across schema, seatbelt, config, profile, and CLI
- Add allow_exec_sugid examples to global and project config templates - Document three modes: deny (default), allow all, allow specific paths - Add CLI flag usage and merge semantics explanation - Update PROFILES.md with custom profile example and merge rules - Add SECURITY.md section explaining deny-by-default behavior and seatbelt rules - Update generated seatbelt profile example with sugid rule example
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.
Summary
/bin/ps) for MCP serversforbidden-exec-sugidviolationsImplementation
Core Types (
src/config/schema.rs):ExecSugidenum with clean TOML syntax:false,true, or["/bin/ps"]Config/Profile System:
CLI (
src/cli/args.rs,src/cli/commands.rs):--allow-exec-sugid PATHflag (repeatable, path-based only)determine_exec_sugid()with CLI > profile > config precedence--explainshows sugid status;--inittemplate includes exampleSeatbelt (
src/sandbox/seatbelt.rs):(allow signal):Allow(true)→(allow process-exec* (with no-sandbox))Paths→ per-path(allow process-exec (with no-sandbox) (literal "..."))Allow(false)→ comment only (default deny)Test plan