Skip to content

v0.3.0 — phase 2: the approval channel

Choose a tag to compare

@xezpeleta xezpeleta released this 04 Oct 14:40
· 63 commits to main since this release

Phase 2: the approval channel — root the agent can only ask for.

Between "never root" and "pre-authorized root" there is now a middle way: rules with approval = true. The agent's exec exits 30 with a request id and executes nothing; a human answers from any root SSH session; the agent fetches the outcome read-only.

  • Gateway request flow: deterministic request ids (identical live requests dedupe), a drop box with strict grammar, O_NOFOLLOW/O_NONBLOCK reads, TTLs (requests 10 min, results 1 h), approval-fatigue bound (max 5 live requests)
  • sysh approvals / approve / deny (root, real TTY required): every approval re-checks the argv against the installed policy — an operator cannot approve what policy forbids; pattern-chosen arguments must be typed by hand at the prompt; execution runs in a one-shot systemd-run scope (TasksMax, MemoryMax, timeout, output caps); results land root:sy 0640
  • Exclusive claim: concurrent approvals of the same request cannot double-execute (O_EXCL marker, released on every exit path; stranded markers stealable after the request TTL). The race was found and closed live before release
  • Tamper resistance: request ids are bound to their content — a body rewritten under a valid-looking name is refused before any human or policy sees it; the drop box is sticky (1730) so sy cannot remove root's claim markers
  • Exit codes: 30 approval required, 31 result unavailable
  • policy.Parse now refuses unknown TOML fields — a typo is policy, not a silent default
  • examples/webserver: the apache2 restart moved to the approval channel (reload is the routine; restart drops connections — the agent can only request it); usage docs cover the full approve cycle

Verified end-to-end on a live host: full approve/fetch cycle, typed-argument challenge (and its wrong-answer abort), deny, dedupe, the concurrent-approval race, and symlink/FIFO/tampered-request probes.

Deferred (frontends and adjacent, not blockers): FIDO2/Telegram approval transports, seccomp read-only profile, sysh-mcp distribution.

curl -LO https://github.com/xezpeleta/sysh/releases/download/v0.3.0/sysh_0.3.0_amd64.deb
apt install ./sysh_0.3.0_amd64.deb
sysh doctor