Skip to content

Decide: transport confidentiality for sc+http (audit High #1) #26

Closed

Description

@tonibergholm

Part of #24

Question

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.

Activity

  1. self-assigned this
    on Jul 10, 2026
  2. tonibergholm commented on Jul 10, 2026

    @tonibergholm
    MemberAuthor

    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:

    1. 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.
    2. 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.
    3. 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.
    4. 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.
    5. 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.
    6. 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.
    7. 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.

    Research basis: Research: TLS & token-confidentiality options for sc+http → docs/research/tls-options-sc-http.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

wayfinder:grillingWayfinder ticket: HITL grilling/decision

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions