Repository navigation
P32: in-binary TLS — sc+https:// via rustls (crates/tlsio) - #42
Merged
Merged
Conversation
…s/rcgen quarantine)
… fingerprint helper)
…pen_transport routing
… tokens justify only with --tls (P32 gate) bind_is_allowed gains a `tls: bool` parameter and tightens the lattice: non-loopback is allowed iff --read-only, --allow-public, or (tls && >=1 configured serve token). A configured token no longer justifies a PLAINTEXT public bind (the P29 rule) since the token itself would then cross the wire in the clear -- deliberate, narrow pre-1.0 break (decision 5 of issue #39 / ADR-0042). auth_is_mandatory is unchanged; its doc comment now notes the TLS+tokens case rides the same fail-closed rule. serve_http's refusal message names --tls as the third justification.
…rint; sc+https acceptance test
…te (run twice) Claude-Session: https://claude.ai/code/session_01LhadyW9scQL95h3ag9yySB
… rewrite, roadmap Documents the P32 in-binary TLS phase (sc+https://, crates/tlsio, accept-new TOFU pinning, the tightened non-loopback bind gate) closing ADR-0036's "no TLS" boundary and the audit's High #1: ADR-0042, CLAUDE.md's workspace layout/dependency rule/commands/Phase 32 section/forward-reference updates, a rewritten THREAT-MODEL transport section covering both confidential transports and both reverse-proxy legs, ROADMAP's shipped-in-P32 entry and follow-ons, and the P32 spec's busy-shed amendment. Extends demo/run_http_auth_demo.sh with a step proving the P29→P32 gate narrowing (tokens alone no longer justify a plaintext public bind; --tls + a token does).
Closes the P32 final whole-branch review's findings: stale CLAUDE.md gate text (I1), SC_HTTPS_STRICT failing open on unrecognized values (I2), the THREAT-MODEL + serve-startup warning for residual plaintext-token exposure on --read-only/--allow-public public binds (I3), missing test asserts in scl-tlsio (T1), enforcement-implying doc-comment wording in the CLI (T7), missing P31/P32 ROADMAP rows (T9), and four named P32 follow-ons recorded in ROADMAP Deferred (Recommendation 2).
…l-review minor) Claude-Session: https://claude.ai/code/session_01LhadyW9scQL95h3ag9yySB
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.
Closes #39 (audit High #1 — plaintext bearer tokens + repo traffic on
sc+http://). Part of the #24 audit-response map. Decisions locked in #26/#35; research indocs/research/tls-options-sc-http.md; ADR-0042.What ships
crates/tlsio(scl-tlsio) — the only crate linking rustls (0.23, ring provider,default-features = false), rcgen, ring, rustls-pki-types. Dependency leaf; onlyrepodepends on it. BlockingRead+WriteTLS streams with split halves, a hand-written pin-only TOFUServerCertVerifier(handshake signatures still verified — pinned-cert replay MITM rejected), self-signed cert mint/load, SPKI-SHA-256 fingerprints (sha256:<hex>, openssl-verifiable).sc+https://host[:port]/repo(default port 8730) on clone/fetch/push/remote add. Accept-new TOFU: first connect pins into~/.config/sc/known_hostsand announces loudly; mismatch always hard-fails naming the file, both fingerprints, and the recovery.SC_HTTPS_FINGERPRINTpre-pins (never persisted),SC_HTTPS_STRICT=1refuses unknown hosts (fail-closed parse),SC_HTTPS_KNOWN_HOSTSoverrides the path. No application byte crosses before pin disposition is settled.sc serve --http <addr> <path> --tls [--tls-cert <pem> --tls-key <pem>]— auto-mints a long-validity identity into.sc/serve-tls/(key 0600; the key IS the identity), banner prints the fingerprint; newsc serve fingerprint [<path>](mints if missing). The 30s opening timeout also bounds the TLS handshake; P31 session timeouts work through the TLS halves.--read-only,--allow-public, or--tls+ ≥1 serve token. Plaintext + tokens-only is now refused (error names--tls); a justified plaintext public bind with tokens configured warns that tokens cross in cleartext.PROTOCOL_VERSIONstays 3; opening codec,serve_tokens, and all ofwire.rsbyte-for-byte; existingsc+http://remotes keep working.Deviations from the phase spec (recorded in ADR-0042)
--max-connectionsbusy-shed closes silently instead of sending a 503 — a readable 503 would require a TLS handshake on the accept thread, breaking P31's accepts-never-block property (spec §3 amended).Proof
demo/run_tls_demo.sh— TLS round trip with a signed ~1 MiB blob underSC_PACK_CHUNK=4096, full TOFU lifecycle (pin/quiet/mismatch/strict/pre-pin), tightened gate, zero.sc/tmpresidue, run twice.crates/cli/tests/https_remote.rs— clone + push + fetch acceptance oversc+https://, byte-for-byte, key-swap mismatch hard-fail.-D warningsclean, all prior demos green (run_http_auth_demo.shextended to prove the gate narrowing).https://claude.ai/code/session_01LhadyW9scQL95h3ag9yySB