Skip to content

feat: Remote SSH PRD: Phase 3 — SSH trust and authentication - #369

Merged
Ziinc merged 2 commits into
mainfrom
claude/remote-ssh-prd-phase-3
Aug 28, 2026
Merged

feat: Remote SSH PRD: Phase 3 — SSH trust and authentication#369
Ziinc merged 2 commits into
mainfrom
claude/remote-ssh-prd-phase-3

Conversation

@Ziinc

@Ziinc Ziinc commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #368 (Phase 2). Implements Phase 3 of prds/remote-ssh.md ("SSH trust and authentication").

  • Client public-key registration/list/revoke (remote-ssh-trust Edge Function), public material only.
  • Real OpenSSH certificate signing (ssh-ed25519-cert-v01@openssh.com) with the CA seed held only in server-side secrets, never returned or persisted.
  • CA trust installed on the managed VM (TrustedUserCAKeys sshd drop-in) via Fly Machines exec, invoked after provisioning/reprovisioning.
  • Direct existing-key alternative: idempotent authorized_keys install/remove.
  • Real TCP-level SSH host-key scan (KEXINIT/ECDH reply parsing, no fabricated fingerprints) closing the Phase 2 host-key gap, plus rotation recording (old/new fingerprint, generation, provider resource id, initiating principal) on reprovision.
  • Server-side ownership/status checks throughout.

Known gaps

  • Only ssh-ed25519 client keys are supported for certificate signing; RSA/ECDSA are rejected (400) rather than faked.
  • The keyscan reads the host key from KEX_ECDH_REPLY without completing the exchange — trust-on-first-observation, same trust model as ssh-keyscan, not MITM-proof; documented inline.
  • Rust-side mirrors of the CA-trust/authorized-key command generators exist in remote_bootstrap.rs for Phase 4's native transport but aren't yet wired into the live Sprites create/replace path — the Deno Edge Function versions are what's actually invoked today.
  • Not exercised against a live Fly Sprites account or real sshd/ssh-keygen (no credentials/binaries in this environment).

Test plan

  • cargo build, cargo fmt --check, cargo clippy --lib, cargo test --lib (34/34)
  • deno check / deno lint on new/changed Edge Function files
  • Migrations 015+016 applied against a bare Postgres 16 instance with auth.users/auth.uid() shims; constraints and new table verified with real inserts
  • End-to-end against a live Fly account / real sshd
    Stacked PR: Phase 4 (native desktop SSH transport) branches from this one next.
    Generated by Claude Code

Base automatically changed from claude/remote-ssh-prd-phase-2-wryci9 to main August 28, 2026 15:13
claude added 2 commits August 28, 2026 15:15
Adds client SSH key registration/revocation, real OpenSSH user certificate
signing (ssh-ed25519-cert-v01@openssh.com) backed by a server-side CA
secret, CA trust installation on managed VMs (TrustedUserCAKeys), the
direct existing-key authorized_keys alternative, and a real TCP-level SSH
host-key scan that closes the Phase 2 gap where host-key fingerprints were
plumbed but never populated. Reprovisioning now records an explicit
host-key rotation (old/new fingerprint, generation, provider resource id).

New Edge Function remote-ssh-trust handles key register/list/revoke,
certificate issuance, and authorized_keys install/remove, all with
server-side ownership/status checks. Migration 016 adds the algorithm
column to remote_client_keys and a remote_endpoint_authorized_keys table.
@Ziinc
Ziinc force-pushed the claude/remote-ssh-prd-phase-3 branch from dddd041 to b841412 Compare August 28, 2026 15:19
@Ziinc Ziinc changed the title Remote SSH PRD: Phase 3 — SSH trust and authentication feat: Remote SSH PRD: Phase 3 — SSH trust and authentication Aug 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

@Ziinc
Ziinc merged commit 909c59f into main Aug 28, 2026
18 of 19 checks passed
@Ziinc
Ziinc deleted the claude/remote-ssh-prd-phase-3 branch August 28, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants