You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Decide: transport confidentiality for sc+http (audit High #1) #26
Plaintext sc+http exposes bearer tokens and repo traffic to any network observer (audit High #1). What is src-control's answer: in-binary TLS (sc+https://), reverse-proxy-only with loud documentation, a non-bearer auth scheme, or some staged combination — and if a new dependency is taken, what rationale is recorded? Resolution shapes a phase spec.
R3 direct — in-binary TLS via rustls, shipped as sc+https:// (the scheme ADR-0036 reserved). Decided against the research's staged framing because the map's calibration (pre-1.0, no live deployments) deflates interim mitigations: the gap window protects nobody, and a transitional scheme is permanent compat surface.
Decisions:
Transport: blocking rustls::Stream wrapped at the two seam functions (HttpTransport::connect_with_token, handle_http_connection); TLS sits below the HTTP opening, so the opening codec, serve_tokens, and all of wire.rs are unchanged. PROTOCOL_VERSION stays 3. Existing sc+http:// remotes keep working.
Trust model: self-signed + TOFU fingerprint pinning as the zero-burden default (server mints via rcgen at first serve); operator-supplied PEM supported (zero extra crates — PEM parsing lives in rustls-pki-types). ACME rejected: rustls-acme is inherently async, wrong fit for the blocking minimal-dep server; operators wanting ACME use certbot or front with a proxy.
Provider: ring (default-features = false) — 14 new crates measured, C compiler only, no cmake; aws-lc-rs (18 crates + cmake as a workspace-wide build requirement) recorded as the swap-in fallback if ring maintenance falters. Pure-Rust providers rejected as immature at a security boundary.
Dependency rationale (the map's bar, RustCrypto/ed25519-dalek precedent): first TLS dependency, ADR required — the ADR lands with the phase spec, per the phase process. Load-bearing justification: sc's client must reach servers its operator doesn't control, the case server-only projects (Vaultwarden, Garage) can punt to proxies and sc cannot.
Quarantine: new crates/tlsio, mirroring gix→gitio / RustCrypto→crypto — one crate links rustls, exposing wrap-a-TcpStream client/server constructors, the ~100-line TOFU ServerCertVerifier, and cert mint. repo → tlsio joins the dependency rule; provider swaps touch one crate.
P29 gate tightened once TLS ships: a configured token alone no longer justifies a non-loopback plaintext bind — public plaintext requires explicit --allow-public (or --read-only). Loopback unchanged (ADR-0040 local-dev ergonomics). Deliberate, narrow, pre-1.0 behavior break; makes the audit High unreachable without explicit opt-in.
R1's corrected docs ride along: the reverse-proxy guidance must document both legs (server-side TCP-mode termination — nginx stream/HAProxy mode tcp/stunnel — AND the client-side tunnel until sc+https:// is the answer), promote ssh:// (ADR-0022) as the already-shipped confidential transport, and update docs/THREAT-MODEL.md. Phase clustering stays the assembly ticket's job.
Rejected alternatives: R1 docs-only (answers a High with documentation; confidentiality stays opt-in and operationally expensive), R2 challenge-response interim (C1 trades in pass-the-hash on serve-tokens.toml; C2 adds a permanent authorized-keys surface; both protect an empty fleet), R4 Noise/snow (explicitly unaudited at the security boundary, compiles ring by default anyway, no operator ecosystem).
Graduates: cert/key provisioning & TOFU UX details (pin storage, first-connect behavior, fingerprint override for scripting/CI) — filed as a follow-on ticket blocking the assembly ticket.
Activity
tonibergholm commentedon Jul 10, 2026
Resolution
R3 direct — in-binary TLS via rustls, shipped as
sc+https://(the scheme ADR-0036 reserved). Decided against the research's staged framing because the map's calibration (pre-1.0, no live deployments) deflates interim mitigations: the gap window protects nobody, and a transitional scheme is permanent compat surface.Decisions:
rustls::Streamwrapped at the two seam functions (HttpTransport::connect_with_token,handle_http_connection); TLS sits below the HTTP opening, so the opening codec,serve_tokens, and all ofwire.rsare unchanged.PROTOCOL_VERSIONstays 3. Existingsc+http://remotes keep working.rustls-acmeis inherently async, wrong fit for the blocking minimal-dep server; operators wanting ACME use certbot or front with a proxy.default-features = false) — 14 new crates measured, C compiler only, no cmake; aws-lc-rs (18 crates + cmake as a workspace-wide build requirement) recorded as the swap-in fallback if ring maintenance falters. Pure-Rust providers rejected as immature at a security boundary.crates/tlsio, mirroring gix→gitio / RustCrypto→crypto — one crate links rustls, exposing wrap-a-TcpStream client/server constructors, the ~100-line TOFUServerCertVerifier, and cert mint.repo → tlsiojoins the dependency rule; provider swaps touch one crate.--allow-public(or--read-only). Loopback unchanged (ADR-0040 local-dev ergonomics). Deliberate, narrow, pre-1.0 behavior break; makes the audit High unreachable without explicit opt-in.stream/HAProxymode tcp/stunnel — AND the client-side tunnel untilsc+https://is the answer), promotessh://(ADR-0022) as the already-shipped confidential transport, and updatedocs/THREAT-MODEL.md. Phase clustering stays the assembly ticket's job.Rejected alternatives: R1 docs-only (answers a High with documentation; confidentiality stays opt-in and operationally expensive), R2 challenge-response interim (C1 trades in pass-the-hash on
serve-tokens.toml; C2 adds a permanent authorized-keys surface; both protect an empty fleet), R4 Noise/snow (explicitly unaudited at the security boundary, compiles ring by default anyway, no operator ecosystem).Graduates: cert/key provisioning & TOFU UX details (pin storage, first-connect behavior, fingerprint override for scripting/CI) — filed as a follow-on ticket blocking the assembly ticket.
Research basis: Research: TLS & token-confidentiality options for sc+http →
docs/research/tls-options-sc-http.md.