fix: derive Forwarded scheme from downstream transport - #87
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
seonghobae
left a comment
There was a problem hiding this comment.
Exact-current technical review on 5868fb61e8f66dc5d79bb15a6e7887156dc7684a after execution. Re-read the complete three-path range: src/gateway_proxy.rs derives only proto=http|https from already-validated downstream TLS presence; sanitization still removes request-controlled Forwarded, every X-Forwarded-*, and X-Real-IP; no generic client-IP/trusted-hop authority is invented. tests/downstream_tls_forwarded_scheme_wire.rs proves a CA-verified TLS/HTTP1 downstream with spoofed proxy identity reaches the cleartext H1 origin as Forwarded: proto=https. TRACEABILITY is current through #86/#87 and leaves the dedicated product-gap baseline with #61. Exact-current CI 34599014435, Supply Chain 34599014384, and PgErd bounded-origin capacity 34599014304 are terminal GREEN; CI includes formatting, full compile/test, Clippy, warnings-denied rustdoc, complete owned-production coverage, resolved-lock verification, load-contract traffic, and least-privilege OCI runtime. Fresh review-thread enumeration is empty. No additional writer-safe source/test/documentation/DDD or authority-boundary defect found in this exact range. This COMMENT is technical evidence only and is not independent APPROVED governance credit.
Refs #51.
Writer-safe child of #86 exact
258c2cf7d1e20d01221158394a99f7bbfe47ee69. This closes the forwarding-scheme trust slice without moving product identity/auth, Keyverse, Wardnet, or EgressWeave authority into the gateway.Verified RED
The real-wire fixture uses a CA-verified version-2 downstream TLS/HTTP/1.1 connection, deliberately supplies spoofed
ForwardedandX-Forwarded-*identity, and lets a real cleartext H1 origin inspect the request emitted by the gateway. RFC 7239 §5.4 definesprotofrom the client-facing request and explicitly covers TLS offload, so the origin must receiveForwarded: proto=httpseven though the selected upstream transport is cleartext HTTP.Initial test-only head
1150833f60472ada7c0fecc957b7b802eeb251dffirst exposed a hosted rustfmt-only RED. Exact formatter repair99e2d96fc9c0a665c8d7793433c1095360b378d5then reached the real-wire test in CI34598294915:tls_termination_rebuilds_forwarded_scheme_from_transport_and_drops_spoofed_identityfailed because the origin did not receiveforwarded: proto=https. Existing production still emitted its cleartext-onlyproto=httpconstant. The run was later cancelled by the causal source update, but the semantic failure had already been emitted by the exact fixture.Causal fix
Production repair
42992ea3daf9e367a9ad2e64c6fbb2aa4c019b4fderives one bounded gateway-owned Forwarded value from already-validated Admin Config duringGatewayProxyactivation: no downstream TLS ->proto=http; downstream TLS ->proto=https.upstream_request_filterstrips request-controlledForwarded, allX-Forwarded-*, andX-Real-IP, then emits only that validated transport truth. No client-IP or trusted-hop chain is synthesized. A focused unit test covers both scheme branches; the real-wire fixture proves TLS termination behavior and spoof removal.docs/doctoring/DOWNSTREAM_TLS_HTTP2_TRACEABILITY.mdwas also stale at #84. Documentation-forward current exact5868fb61e8f66dc5d79bb15a6e7887156dc7684abrings it code-current through #86/#87, adds RFC 7239 to standards/APA traceability, and leaves generic client-IP/trusted-hop semantics explicitly unclaimed.docs/product-technical-gap-baseline.mdremains owned by dedicated lane #61 and was not modified.Exact-current evidence
Current head
5868fb61e8f66dc5d79bb15a6e7887156dc7684aremains ahead-only/behind-0 from exact #86. CI34599014435, Supply Chain34599014384, and PgErd bounded-origin capacity34599014304are all terminal GREEN. CI passed formatting, the complete compile/test suite including the repaired Forwarded wire acceptance, Clippy, warnings-denied rustdoc, complete owned-production coverage, resolved dependency-lock verification, routed/loopback load-contract traffic, and both least-privilege OCI runtime profiles. Supply Chain passed dependency audit, admitted candidate builds, SPDX SBOM generation, both image scans, exact-source binding, and evidence upload. Fresh review-thread enumeration is empty. Exact-current technical COMMENT5178684754found no additional writer-safe source/test/documentation/DDD or authority-boundary defect and is evidence only, not independent approval.This PR is Ready for independent governance review. The active organization ruleset still requires one approving review, resolved review threads, and central required workflows before default-branch integration. No bypass, protected merge, immutable release, canary/shadow, rollback, cutover, or legacy-removal credit is claimed.