SSH-runner transport wedge (ADR-0002) - #3
Merged
Conversation
The mutation transport for SynoSharp — SSH-exec of on-box syno* over SSH.NET. Read-only wedge: proves the full risky stack (SSH login → sudo-to-root → on-box CLI) before any write is modeled. - ISshRunner / SshRunner: lazy connect; root commands run under `sudo -S` with the password fed over stdin (never in the command string), through `env PATH=/usr/syno/sbin:…` since sudo's secure_path excludes the syno dirs. - SynologyCommand: structured executable + argv, shell-quoted only at render (no injection on the root shell); RequiresRoot defaults true. - SynologySshOptions: SSH connection (host derives from SYNOLOGY_BASE_URL), reuses the account password for login + sudo; optional key. - CLI `ssh-check`: id (transport) + `synoshare --enum ALL` (sudo + real read). - Tests: quoting unit tests + skippable live SSH test. Verified against the live DS1813+ (DSM 7.1.1-42962, 2026-05-31): listed the 9 live shares, zero mutation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
The mutation transport for SynoSharp — the read-only wedge that proves the full risky stack (SSH login → sudo-to-root → on-box
syno*) before any write is modeled. Per ADR-0002 / #57.What
ISshRunner/SshRunner(SSH.NET 2025.1.0): lazy connect; root commands run undersudo -Swith the password fed over stdin — never in the command string, process list, or dry-run render. Runs throughenv PATH=/usr/syno/sbin:…since sudo'ssecure_pathexcludes the syno dirs.SynologyCommand: structuredExecutable+argv, shell-quoted only at render time (no injection on the root shell);RequiresRootdefaults true.SynologySshOptions: SSH connection — host derives fromSYNOLOGY_BASE_URL, reuses the account password for login + sudo, optional key.ssh-check:id(transport) +synoshare --enum ALL(sudo + a real read).Verification
Against the live DS1813+ (DSM 7.1.1-42962, 2026-05-31): listed the 9 live shares, zero mutation.
Next (follow-ups, not this PR)
First typed mutation —
EnsureShareAsyncwith read-before-write (diff the discover snapshot) and dry-run by default. NFS exports last (highest-risk; prove on Virtual DSM, not the live box).🤖 Generated with Claude Code