ssh: Show approvers the stdin a command runs with #1

Merged
dev merged 1 commits from ssh-show-stdin into main 2026-11-25 01:35:36 +00:00

slop ssh forwarded stdin only after approval, so a script piped to bash -s reached the box without an approver or the audit log seeing it (request 0c6db1 on castle approved only bash -s).

  • slop reads all of stdin (unless it's a terminal) and sends it with the request; Operation::Ssh gains stdin, and PROTOCOL_VERSION goes to 2.
  • Approvers see it in full (a Stdin field with its size, and the text under Details), the audit log keeps it, and the command gets exactly those bytes.
  • Stdin that isn't UTF-8, or a command and stdin over 32 KiB together, is refused, so everything is always shown whole.
  • The command is shown as the line the remote shell runs (words joined with spaces, as ssh sends them) instead of shell-quoted, and multi-line commands as text.
  • slop-tools.md, docs/design.md, docs/architecture.md and docs/demo.md are updated.

Tested: cargo clippy --all-targets, cargo test (new tests for the shown and logged detail, and for refusals) and the VM test.

The protocol bump means palace (broker) and slop-cannon (slop) need the new version together once nixfiles relocks.

🤖 Generated with Claude Code

`slop ssh` forwarded stdin only after approval, so a script piped to `bash -s` reached the box without an approver or the audit log seeing it (request `0c6db1` on `castle` approved only `bash -s`). - `slop` reads all of stdin (unless it's a terminal) and sends it with the request; `Operation::Ssh` gains `stdin`, and `PROTOCOL_VERSION` goes to 2. - Approvers see it in full (a `Stdin` field with its size, and the text under Details), the audit log keeps it, and the command gets exactly those bytes. - Stdin that isn't UTF-8, or a command and stdin over 32 KiB together, is refused, so everything is always shown whole. - The command is shown as the line the remote shell runs (words joined with spaces, as `ssh` sends them) instead of shell-quoted, and multi-line commands as text. - `slop-tools.md`, `docs/design.md`, `docs/architecture.md` and `docs/demo.md` are updated. Tested: `cargo clippy --all-targets`, `cargo test` (new tests for the shown and logged detail, and for refusals) and the VM test. The protocol bump means `palace` (broker) and `slop-cannon` (`slop`) need the new version together once nixfiles relocks. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
slop-cannon Bot added 1 commit 2026-11-25 00:55:53 +00:00
ssh: Show approvers the stdin a command runs with
CI / Check (pull_request) Successful in 5m14s
CI / Check (push) Successful in 5m15s
2df7cd3dee
`slop ssh` forwarded stdin only after approval, so a script piped to
`bash -s` reached the box without an approver or the audit log ever
seeing it. `slop` now reads all of stdin (unless it's a terminal)
and sends it with the request. Approvers see it in full, the audit
log keeps it, and the command gets exactly those bytes. Stdin that
isn't UTF-8, or a command and stdin too long to show whole, is
refused.

The command is shown as the line the remote shell runs (the words
joined with spaces, as `ssh` sends them) rather than shell-quoted,
which suggested quoting the remote shell never sees; multi-line
commands are shown as text.

`Operation::Ssh` gains `stdin`, so the protocol version goes to 2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dev merged commit 2df7cd3dee into main 2026-11-25 01:35:36 +00:00
dev deleted branch ssh-show-stdin 2026-11-25 01:35:36 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dev/slop-broker#1