spec: PPv2 approved, trust barrier accepted
8a3d302 accepted the barrier without a fourth round and made the two race tests mandatory in the plan. Build approved by Paul before G6.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+5
−5
docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md+5 −5
CI passed — run details
diff --git a/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md b/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md| index 580b6479d..afa7bb1d5 100644 |
| --- a/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md |
| +++ b/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md |
| @@ -1,6 +1,6 @@ |
| # PROXY protocol v2 on the region HA load balancers |
| -Design, 2026-11-12, **rev 5** (Astra rounds 1 to 3 applied, §12, §13 and §15. **Round 3, the last, was NOT READY with one P1 in F1: the round limit is reached and §15's fix needs 8a3d302's go; no fourth round.** Earlier: round 2 repeated fault family F1, so under stopping rule 2 the choice went to Paul: **option A, one-way PROXY protocol, decided 2026-11-12** by agent manager 8a3d302 on Paul's standing acceptance of recommendations, Paul informed and free to override; §14). Rev 4 wrote A in; rev 5 applies round 3's P2s and proposes the barrier for its P1 (§4.7, §15). Agent manager 8a3d302 asked for it on 2026-11-12 with Paul's approval: client IP preservation off and PROXY protocol v2 on, on both target groups of each region NLB, before G6 opens the NLBs to customers. Design only; the build is a separate GO. Review budget: at most three Astra rounds (AGENTS.md stopping rules); all three rounds are spent. |
| +Design, 2026-11-12, **rev 5** (Astra rounds 1 to 3 applied, §12, §13 and §15. Round 3, the last, was NOT READY with one P1 in F1; its fix, the trust barrier, was **accepted without a fourth round by 8a3d302 on 2026-11-12** (§15). **APPROVED 2026-11-12** for build: Paul approved "PPv2 ... before G6"; no infra or live change without 8a3d302's GO and a #421 window. Earlier: round 2 repeated fault family F1, so under stopping rule 2 the choice went to Paul: **option A, one-way PROXY protocol, decided 2026-11-12** by agent manager 8a3d302 on Paul's standing acceptance of recommendations, Paul informed and free to override; §14). Rev 4 wrote A in; rev 5 applies round 3's P2s and proposes the barrier for its P1 (§4.7, §15). Agent manager 8a3d302 asked for it on 2026-11-12 with Paul's approval: client IP preservation off and PROXY protocol v2 on, on both target groups of each region NLB, before G6 opens the NLBs to customers. Design only; the build is a separate GO. Review budget: at most three Astra rounds (AGENTS.md stopping rules); all three rounds are spent. |
| Line citations are to `origin/main` at ae1b8cca. AWS facts quote "Edit target group attributes for your Network Load Balancer" (docs.aws.amazon.com/elasticloadbalancing/latest/network/edit-target-group-attributes.html, read 2026-11-12) unless another page is named. |
| @@ -24,7 +24,7 @@ Today on both NLBs (read 2026-11-12, `~/.cache/ppv2/aws/`): |
| ## 2. What changes, in one paragraph |
| -Each target group stops preserving the client address and sends a PROXY protocol v2 header instead. The target then sees every NLB connection coming from one of the NLB's own private addresses, on a source port the NLB chose, so two client connections can never share a 4-tuple at the target. The edge learns the client address from the header. It reads a header as identity only on connections whose socket peer is one of its region NLB's private addresses, listed in a new host-env key; it rewrites the connection's remote address to the header's source before net/http sees it, so every reader of `r.RemoteAddr` downstream (rate limits, protection, geo, records, analytics, `X-Forwarded-For`) sees the client exactly as today. A header from any other peer is consumed and ignored. A trusted connection without a client address may only answer the health check. The cutover flips one attribute on one target group per step, through states where every target handles every new connection correctly, each forward step proven converged on every NLB node before the next. PROXY protocol is one-way: once on, it never goes off, so the one unsafe state (preservation off with PROXY protocol off) is never a step. The tooling refuses it, an alarm detects it for the whole armed lifetime, and a root barrier takes identity away from every connection it could have touched (proposed in rev 5, §15). The price is stated in §7.3: once a target group has PROXY protocol on, no edge older than this release can run behind it again. |
| +Each target group stops preserving the client address and sends a PROXY protocol v2 header instead. The target then sees every NLB connection coming from one of the NLB's own private addresses, on a source port the NLB chose, so two client connections can never share a 4-tuple at the target. The edge learns the client address from the header. It reads a header as identity only on connections whose socket peer is one of its region NLB's private addresses, listed in a new host-env key; it rewrites the connection's remote address to the header's source before net/http sees it, so every reader of `r.RemoteAddr` downstream (rate limits, protection, geo, records, analytics, `X-Forwarded-For`) sees the client exactly as today. A header from any other peer is consumed and ignored. A trusted connection without a client address may only answer the health check. The cutover flips one attribute on one target group per step, through states where every target handles every new connection correctly, each forward step proven converged on every NLB node before the next. PROXY protocol is one-way: once on, it never goes off, so the one unsafe state (preservation off with PROXY protocol off) is never a step. The tooling refuses it, an alarm detects it for the whole armed lifetime, and a root barrier takes identity away from every connection it could have touched (§4.7). The price is stated in §7.3: once a target group has PROXY protocol on, no edge older than this release can run behind it again. |
| ## 3. Guarantee and invariant |
| @@ -104,7 +104,7 @@ So no request ever reaches a client-address reader without a client address: `cl |
| In S3, ordinary clients (no header of their own) are refused loudly by this rule. A client that sends its own header is still believed; only §6 prevents that. |
| -### 4.7 The trust barrier (rev 5, **proposed, pending 8a3d302's go**; replaces rev 4's one-shot `close-trusted`, see §15) |
| +### 4.7 The trust barrier (rev 5, accepted 2026-11-12; replaces rev 4's one-shot `close-trusted`, see §15) |
| A root command on the box, `carlos system edge trust-barrier`, raises a barrier in the edge. While it is up, a trusted connection's header grants no identity: **every** connection from a node address, whether open, still parsing its header, or accepted later, is treated as `no-client` (§4.6) once its state resolves, so it can answer the health check and nothing else. Raising the barrier sets it before it closes anything: first the flag, then it closes every open connection from a node address, pending ones included. The wrapper tracks trusted connections from accept, not from parse, for this. A connection that finishes a forged header after the flag is up is still `no-client`; a node still in S3 that sends new connections meets the same rule. Health checks keep passing, so targets stay in service, and in S0 or S1 every client connection is untrusted and served as normal. |
| @@ -293,7 +293,7 @@ First-of-kind applies need 8a3d302's GO; later NLBs' identical steps fall under |
| - hostenv: the key's validation (private IPv4, 1-16, no duplicates), in both `Assemble` and the group `write` path. |
| - Tofu: `ingress` tests for the defaults (S0), each per-port step, the S3 refusal and the output with one interface per zone; `group.tf` test for the precondition in all four states. |
| - The step script: a dry-run mode tested against recorded `describe-target-group-attributes` outputs for every allowed and refused move, PPv2 off refused from every state. |
| -- The trust barrier (§4.7): raised, it closes open and pending trusted connections and leaves `plain` ones; a partial header completed after it is raised resolves to `no-client`; a trusted connection accepted after it answers only the health check; it survives an edge restart; only `trust-resume` lowers it; it is reachable only through the drain socket's caller path. |
| +- The trust barrier (§4.7), **two mandatory race tests the plan must carry by name**: (a) a trusted connection that is mid-header when the barrier is raised and completes a valid PROXY header afterwards resolves to `no-client` and can answer only the health check; (b) a trusted connection accepted after the barrier is raised, with a valid header, likewise. Also: raised, it closes open and pending trusted connections and leaves `plain` ones; a partial header completed after it is raised resolves to `no-client`; a trusted connection accepted after it answers only the health check; it survives an edge restart; only `trust-resume` lowers it; it is reachable only through the drain socket's caller path. |
| - The activation guard (§7.3): with the key set, a staged binary without the `ingress-proxy-v2` feature (including one with no `version --json`) is refused by `apply`, `rollback` and `install-channel`, and the running binary stays; without the key, nothing changes. |
| - The trust-violation metric: the agent publishes the per-minute increase of `no_client_refused` plus `marker_trusted`, and nothing on an unarmed box. |
| - `go vet` and cross-builds (darwin, windows) for the new package. |
| @@ -377,7 +377,7 @@ Recommendation was **A**: it removes the unprovable transition rather than provi |
| **The P1 and its proposed fix.** Both races share one cause, which Astra names: containment had no barrier covering every trusted peer, only a sweep of the ones already parsed. Rev 5 replaces the sweep with a barrier that is state, not an action: while it is up, a trusted connection's header grants no identity, whenever it was accepted and whenever its header completes; the flag is set before the sweep, so nothing slips between them; it persists across restarts; only an explicit resume after the marker probe shows S1 lowers it. That is Astra's own suggested direction ("refusing trusted application traffic during containment"), and it costs nothing in S0 or S1, where no client traffic is trusted. It does not touch the one-way decision. |
| -It has not been reviewed. Under the stopping rules a fourth round needs Paul's go. The choices for 8a3d302: |
| +**Decided 2026-11-12: option 1**, by 8a3d302: the barrier is accepted as state without another spec round; the build's whole-branch Astra review covers it, and the two race tests in §9 are mandatory in the plan. The choices as put: |
| 1. **Accept rev 5's barrier without another round** (recommended). The change is one flag checked at one point (the parse state's resolution) plus its persistence and two verbs; §9 tests the two races directly, and the build's whole-branch review covers it. |
| 2. **A fourth Astra round on §4.7 only**, scoped to the barrier. |
| 3. **Cut containment back to "stop public ingress"** in an S3 incident (deregister or drain every target), Astra's other suggestion: simpler to state, but an outage for every HA-pool app until the TG is verified, where the barrier keeps serving. |