edge PPv2: count idle trusted connections apart from timeout
The dev IE cutover (2026-11-17) showed the NLB sends its PROXY header with the client's first bytes, not at connect. In S2 an idle client connection (a browser preconnect) reached the 10 s header deadline and counted as timeout, which every B step must keep still: 8 idle connections moved it by exactly 8. - proxyproto: a trusted connection with no byte by the deadline counts idle; a started header still counts timeout. sentAnything does one bounded 1-byte read so a parse that began after its deadline does not miscount bytes that did arrive. - edge journal line and trust-status carry idle; the wire accepts its absence from an older edge (read as 0), every other counter required. - ppv2-step.py: idle optional in a status line, never in STILL; a B step refuses a target whose edge does not report idle. - runbook: idle, and reverify after a B step whose first probes fell in the ~70 s propagation. Spec 4.5 rev 5.2 note. Census overlay.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 files changed,
+311
−48
docs/region-ha-runbook.md+4 −2docs/superpowers/notes/census-claims-edge-ppv2-idle.tsv+2 −0docs/superpowers/notes/census-proposal-edge-ppv2-idle.md+23 −0docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md+3 −1internal/edge/proxyingress.go+3 −2internal/edge/proxyingress_test.go+1 −1internal/host/edgetrust.go+13 −4internal/host/edgetrust_linux_test.go+4 −4internal/host/edgetrust_test.go+51 −6internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-edge-ppv2-idle.tsv+10 −0internal/proxyproto/conn.go+31 −1internal/proxyproto/counters.go+10 −1internal/proxyproto/listener_test.go+42 −5scripts/ppv2-step.py+28 −8scripts/ppv2_step_test.py+72 −0scripts/testdata/ppv2/trust-status.json+13 −13
Intent
diff --git a/docs/region-ha-runbook.md b/docs/region-ha-runbook.md| index b36721505..083335413 100644 |
| --- a/docs/region-ha-runbook.md |
| +++ b/docs/region-ha-runbook.md |
| @@ -422,6 +422,8 @@ Exit codes: 0 done or passed, 1 refused or failed, 2 invalid arguments, 130 inte |
| A B step converges only on its own port's traffic: every node's `proxied` count must rise on that listener (`by_listener` in trust-status). After B80, `:80` traffic does not count for B443. |
| +A B step takes about 70 s to reach every node, and the probe cannot tell S1 from S2, so probes started at once can pass while most of their connections still arrive in S1. Then a target may show no `proxied` rise from one node, and the step fails with "proxied on :<port> from node <address> did not rise". That is not a fault: run `reverify` for the step with fresh probes. On dev IE on 2026-11-17 both B80 and B443 passed this way on their first reverify. |
| + |
| A restart of any target's edge during the window fails the step. The tool sees it as a new `edge_instance` in trust-status, or as any counter lower than at the poll before. Counters start from zero after a restart, so the window cannot prove what happened in between. Run `reverify` once the box is back. |
| If the run is interrupted, or a convergence fails, or one `aws` call is slow enough to leave more than 15 s between health observations, the window fails. Use `reverify`, not `converge`. It opens a fresh window for a step already made (A steps cannot be undone) with new probes and new record paths: |
| @@ -438,7 +440,7 @@ python3 scripts/ppv2-step.py reverify --root <tofu root> --nlb-arn <nlb> \ |
| B steps refuse while any barrier is up. A steps, R steps and `reverify` of an A step do not. |
| -Watch item for the dev window: if the NLB sends its PROXY header only with the client's first bytes, an idle connection (a browser preconnect that never sends a request) reaches the 10 s header deadline and moves `timeout`. `timeout` must not move during a step, so B steps would never converge. Row 2 of the dev witness shows which way the NLB behaves. If `timeout` moves on idle preconnects, stop and report before B80. |
| +The NLB sends its PROXY header with the client's first bytes, not when the connection opens (seen on dev IE on 2026-11-17). So in S2 a connection whose client never sends anything, such as a browser preconnect, is closed at the 10 s header deadline, just as an idle direct connection is closed by the server's own 10 s header timeout. The edge counts these as `idle`, not `timeout`. `idle` is ordinary traffic and may rise during any step; `timeout` counts only a header that started and did not finish, and must not move. An edge from before the `idle` counter counts these as `timeout` instead, so run B steps only once every target reports `idle`. |
| ### Rollback |
| @@ -462,7 +464,7 @@ Run this if the trust-violation alarm fires, or the probe or a target's counters |
| 7. Continue with the B steps, in a window. |
| 8. Report to 8a3d302 with the alarm, the counters and the barrier's close counts. |
| -To read a target at any time, `carlos system edge trust-status` prints one JSON line with `armed`, `barrier`, `edge_instance` (a random id the edge sets when it starts), the counters and `proxied_by_node` for both listeners together, and `by_listener` with each listener's own, under `"80"` and `"443"`. The three verbs exit 0 on success, 1 when refused or failed, 2 for bad arguments or a box not armed. |
| +To read a target at any time, `carlos system edge trust-status` prints one JSON line with `armed`, `barrier`, `edge_instance` (a random id the edge sets when it starts), the counters (`proxied`, `no_client`, `no_client_refused`, `ignored`, `ignored_private`, `marker_trusted`, `malformed`, `timeout` and `idle`) and `proxied_by_node` for both listeners together, and `by_listener` with each listener's own, under `"80"` and `"443"`. The three verbs exit 0 on success, 1 when refused or failed, 2 for bad arguments or a box not armed. |
| Notes from the reviews: |
diff --git a/docs/superpowers/notes/census-claims-edge-ppv2-idle.tsv b/docs/superpowers/notes/census-claims-edge-ppv2-idle.tsv| new file mode 100644 |
| index 000000000..55811a6c9 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-claims-edge-ppv2-idle.tsv |
| @@ -0,0 +1,2 @@ |
| +internal/proxyproto/conn.go:Conn.parse A trusted connection whose header read times out with no byte read, and sentAnything finds no byte either, closes and counts idle instead of timeout. Same close, same state (failed); no new read beyond sentAnything. Edge (uid carlos), not root. |
| +internal/proxyproto/conn.go:Conn.sentAnything New. On a trusted connection about to be closed after a header-deadline timeout with nothing read: sets a 5 ms read deadline on the accepted socket and reads at most one byte from it, to tell an idle connection from one whose bytes arrived after the deadline had passed. The byte is dropped; the connection is closed straight after. Reads only the already accepted network connection; no file, no path, nothing run. Edge (uid carlos), not root. |
diff --git a/docs/superpowers/notes/census-proposal-edge-ppv2-idle.md b/docs/superpowers/notes/census-proposal-edge-ppv2-idle.md| new file mode 100644 |
| index 000000000..7c8a60530 |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-edge-ppv2-idle.md |
| @@ -0,0 +1,23 @@ |
| +# Census approval: edge-ppv2-idle |
| + |
| +Ruling `census-ruling-edge-ppv2-idle`. The independent reviewer approves or rejects every change below, 1 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/proxyproto/conn.go` `Conn.parse` | body | unchanged (1) | A trusted connection whose header read times out with no byte read, and sentAnything finds no byte either, closes and counts idle instead of timeout. Same close, same state (failed); no new read beyond sentAnything. Edge (uid carlos), not root. | |
| + |
| +Envelopes re-pinned: `internal/edge`, `internal/host`, `internal/proxyproto`. |
| + |
| +Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner. |
| + |
| +Recorded dispositions, which each change must still satisfy: |
| + |
| +- `internal/proxyproto/conn.go` `Conn.parse`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-edge-ppv2;basis=Edge (uid carlos), not root. Detects the signature, reads at most one header with ReadHeader (under the header deadline on a trusted peer), and resolves the connection's state (an untrusted peer: plain, or failed on a malformed header; a trusted one: proxied, no client or failed), consulting the barrier flag when it resolves. The scanner's +file:Command is the comparison h.Command != CommandProxy (the header's command nibble), not a process; no file, nothing run. |
| + |
| +New dispositions, which census-propose wrote and the reviewer checks against the unit's reads and the diff: |
| + |
| +- new `internal/proxyproto/conn.go:Conn.sentAnything`: reads +file:Read; written legacy, accepted-legacy, frozen |
| + |
| +Seal: `7ca068c5c146a679b4726d74fe43cf9c47f97080f9c08b761a36a9a12a5a3c54` → `f5c0ad32db5ee003f16ba314d7083e416cc18578d802ace49233f31afb7d164a`. |
| + |
| +Overlay: `internal/provision/testdata/plan14-root-reads-edge-ppv2-idle.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
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 47eef47ba..29d2ead55 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 |
| @@ -94,7 +94,9 @@ The header's destination address and port are not used. |
| ### 4.5 Counters |
| -Per listener and, for trusted connections, per node address, since start: `proxied`, `no_client`, `no_client_refused` (§4.6), `ignored` (untrusted header consumed), `ignored_private` (untrusted header from a private address: almost certainly an NLB node missing from the key), `marker_trusted` (§6.4), `malformed`, `timeout`. One journal line at start (`edge: proxy protocol: armed on :80 and :443, trusting 172.31.29.110,172.31.11.189`), and one throttled line every minute while armed, naming every counter. `no_client_refused` and `ignored_private` above zero also log once a minute at warning level with the peer address. The cutover reads these lines over SSM (§6.4). |
| +Per listener and, for trusted connections, per node address, since start: `proxied`, `no_client`, `no_client_refused` (§4.6), `ignored` (untrusted header consumed), `ignored_private` (untrusted header from a private address: almost certainly an NLB node missing from the key), `marker_trusted` (§6.4), `malformed`, `timeout` (a trusted header started and not finished by its deadline), `idle` (a trusted connection that sent no byte by the deadline). One journal line at start (`edge: proxy protocol: armed on :80 and :443, trusting 172.31.29.110,172.31.11.189`), and one throttled line every minute while armed, naming every counter. `no_client_refused` and `ignored_private` above zero also log once a minute at warning level with the peer address. The cutover reads these lines over SSM (§6.4). |
| + |
| +**Rev 5.2 (2026-11-17, dev IE cutover): `idle`.** The NLB sends its PROXY header with the client's first bytes, not at connect, so in S2 an idle client connection (a browser preconnect) reaches the header deadline with nothing read. That is ordinary traffic, closed as the server's own header timeout closes an idle direct connection, so it is counted as `idle` and not as `timeout`, and `idle` is not among the counters a step keeps still (§6.4). `trust-status` may omit `idle` only when the edge predates it; the step script refuses a B step on such a target. |
| **Rev 5.1: what `trust-status` carries.** The counters and `proxied_by_node` summed over both listeners (the metric's view, below), and `by_listener` with each listener's own counters and per-node `proxied`, keyed `"80"` and `"443"`, all from one snapshot. And `edge_instance`, a random id the edge sets once when it arms at start: the counters live exactly as long as it, so a reader that sees it change knows they started again. Convergence (§6.4) uses both: a B step's evidence is its own port's listener, and a changed `edge_instance` or any count lower than at the previous poll is a restart that fails the window. |
diff --git a/internal/edge/proxyingress.go b/internal/edge/proxyingress.go| index a58b87753..ef33cf3fb 100644 |
| --- a/internal/edge/proxyingress.go |
| +++ b/internal/edge/proxyingress.go |
| @@ -340,6 +340,7 @@ func SumProxyCounters(listeners map[string]proxyproto.Counters) proxyproto.Count |
| sum.MarkerTrusted += c.MarkerTrusted |
| sum.Malformed += c.Malformed |
| sum.Timeout += c.Timeout |
| + sum.Idle += c.Idle |
| for a, n := range c.ProxiedByNode { |
| sum.ProxiedByNode[a] += n |
| } |
| @@ -413,8 +414,8 @@ func (e *Edge) proxyJournalLines(prev *proxyproto.Counters) []string { |
| for _, a := range p.trusted { |
| nodes = append(nodes, fmt.Sprintf("%s:%d", a, c.ProxiedByNode[a])) |
| } |
| - lines := []string{fmt.Sprintf("edge: proxy protocol: proxied=%d no_client=%d no_client_refused=%d ignored=%d ignored_private=%d marker_trusted=%d malformed=%d timeout=%d proxied_by_node=%s barrier=%s", |
| - c.Proxied, c.NoClient, c.NoClientRefused, c.Ignored, c.IgnoredPrivate, c.MarkerTrusted, c.Malformed, c.Timeout, |
| + lines := []string{fmt.Sprintf("edge: proxy protocol: proxied=%d no_client=%d no_client_refused=%d ignored=%d ignored_private=%d marker_trusted=%d malformed=%d timeout=%d idle=%d proxied_by_node=%s barrier=%s", |
| + c.Proxied, c.NoClient, c.NoClientRefused, c.Ignored, c.IgnoredPrivate, c.MarkerTrusted, c.Malformed, c.Timeout, c.Idle, |
| strings.Join(nodes, ","), barrierWord(p.barrier.Load()))} |
| refused := c.NoClientRefused - prev.NoClientRefused |
| private := c.IgnoredPrivate - prev.IgnoredPrivate |
diff --git a/internal/edge/proxyingress_test.go b/internal/edge/proxyingress_test.go| index 0e0a12ddf..61bdb48f9 100644 |
| --- a/internal/edge/proxyingress_test.go |
| +++ b/internal/edge/proxyingress_test.go |
| @@ -755,7 +755,7 @@ func TestProxyJournalLines(t *testing.T) { |
| pe := newProxyEdge(t, e, proxyOpts{}) |
| var prev proxyproto.Counters |
| lines := e.proxyJournalLines(&prev) |
| - want := "edge: proxy protocol: proxied=0 no_client=0 no_client_refused=0 ignored=0 ignored_private=0 marker_trusted=0 malformed=0 timeout=0 proxied_by_node=127.0.0.1:0 barrier=down" |
| + want := "edge: proxy protocol: proxied=0 no_client=0 no_client_refused=0 ignored=0 ignored_private=0 marker_trusted=0 malformed=0 timeout=0 idle=0 proxied_by_node=127.0.0.1:0 barrier=down" |
| if len(lines) != 1 || lines[0] != want { |
| t.Fatalf("quiet minute: %q", lines) |
| } |
diff --git a/internal/host/edgetrust.go b/internal/host/edgetrust.go| index b2b38612f..5ed2eb7ac 100644 |
| --- a/internal/host/edgetrust.go |
| +++ b/internal/host/edgetrust.go |
| @@ -111,6 +111,7 @@ type trustCounters struct { |
| MarkerTrusted uint64 `json:"marker_trusted"` |
| Malformed uint64 `json:"malformed"` |
| Timeout uint64 `json:"timeout"` |
| + Idle uint64 `json:"idle"` |
| } |
| // trustStatus is GET /v1/edge/trust and trust-status's line. Counters and |
| @@ -182,6 +183,10 @@ type trustCountersWire struct { |
| MarkerTrusted *uint64 `json:"marker_trusted,omitempty"` |
| Malformed *uint64 `json:"malformed,omitempty"` |
| Timeout *uint64 `json:"timeout,omitempty"` |
| + // Idle is the one counter that may be absent: an edge from before it |
| + // existed (still running while a newer binary asks during an update) |
| + // does not send it. It reads as zero; it is no trust evidence. |
| + Idle *uint64 `json:"idle,omitempty"` |
| } |
| // counters is c with every counter present, ok false when one is absent. |
| @@ -194,10 +199,14 @@ func (c *trustCountersWire) counters() (trustCounters, bool) { |
| return trustCounters{}, false |
| } |
| } |
| - return trustCounters{ |
| + out := trustCounters{ |
| Proxied: *c.Proxied, NoClient: *c.NoClient, NoClientRefused: *c.NoClientRefused, Ignored: *c.Ignored, |
| IgnoredPrivate: *c.IgnoredPrivate, MarkerTrusted: *c.MarkerTrusted, Malformed: *c.Malformed, Timeout: *c.Timeout, |
| - }, true |
| + } |
| + if c.Idle != nil { |
| + out.Idle = *c.Idle |
| + } |
| + return out, true |
| } |
| // add is c plus d, counter by counter. |
| @@ -205,7 +214,7 @@ func (c trustCounters) add(d trustCounters) trustCounters { |
| return trustCounters{ |
| Proxied: c.Proxied + d.Proxied, NoClient: c.NoClient + d.NoClient, NoClientRefused: c.NoClientRefused + d.NoClientRefused, |
| Ignored: c.Ignored + d.Ignored, IgnoredPrivate: c.IgnoredPrivate + d.IgnoredPrivate, MarkerTrusted: c.MarkerTrusted + d.MarkerTrusted, |
| - Malformed: c.Malformed + d.Malformed, Timeout: c.Timeout + d.Timeout, |
| + Malformed: c.Malformed + d.Malformed, Timeout: c.Timeout + d.Timeout, Idle: c.Idle + d.Idle, |
| } |
| } |
| @@ -328,7 +337,7 @@ func trustCountersOf(c proxyproto.Counters) trustCounters { |
| return trustCounters{ |
| Proxied: c.Proxied, NoClient: c.NoClient, NoClientRefused: c.NoClientRefused, |
| Ignored: c.Ignored, IgnoredPrivate: c.IgnoredPrivate, MarkerTrusted: c.MarkerTrusted, |
| - Malformed: c.Malformed, Timeout: c.Timeout, |
| + Malformed: c.Malformed, Timeout: c.Timeout, Idle: c.Idle, |
| } |
| } |
diff --git a/internal/host/edgetrust_linux_test.go b/internal/host/edgetrust_linux_test.go| index 9aac46c0e..b5034c0ca 100644 |
| --- a/internal/host/edgetrust_linux_test.go |
| +++ b/internal/host/edgetrust_linux_test.go |
| @@ -106,10 +106,10 @@ func TestDrainCallTrustRefusesIncomplete(t *testing.T) { |
| go srv.Serve(l) |
| t.Cleanup(func() { srv.Close() }) |
| call := socketDrainCall(newDrainClient(path)) |
| - const counters = `{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0}` |
| - const zeroListener = `{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"proxied_by_node":{}}` |
| - const oneListener = `{"proxied":1,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"proxied_by_node":{"172.31.29.110":1}}` |
| - const one = `{"proxied":1,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0}` |
| + const counters = `{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"idle":0}` |
| + const zeroListener = `{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"idle":0,"proxied_by_node":{}}` |
| + const oneListener = `{"proxied":1,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"idle":0,"proxied_by_node":{"172.31.29.110":1}}` |
| + const one = `{"proxied":1,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"idle":0}` |
| const inst = `"edge_instance":"` + fakeEdgeInstance + `"` |
| listeners := `"by_listener":{"80":` + zeroListener + `,"443":` + zeroListener + `}` |
| status := func(fields ...string) string { |
diff --git a/internal/host/edgetrust_test.go b/internal/host/edgetrust_test.go| index fe68f67ca..6a8da4f54 100644 |
| --- a/internal/host/edgetrust_test.go |
| +++ b/internal/host/edgetrust_test.go |
| @@ -131,17 +131,17 @@ func trustCountersFixture() map[string]proxyproto.Counters { |
| } |
| const trustStatusFixtureJSON = `{"armed":true,"barrier":false,"edge_instance":"0123456789abcdef0123456789abcdef",` + |
| - `"counters":{"proxied":10,"no_client":2,"no_client_refused":1,"ignored":3,"ignored_private":4,"marker_trusted":5,"malformed":6,"timeout":7},` + |
| + `"counters":{"proxied":10,"no_client":2,"no_client_refused":1,"ignored":3,"ignored_private":4,"marker_trusted":5,"malformed":6,"timeout":7,"idle":0},` + |
| `"proxied_by_node":{"172.31.11.189":4,"172.31.29.110":6},` + |
| - `"by_listener":{"443":{"proxied":7,"no_client":0,"no_client_refused":1,"ignored":2,"ignored_private":0,"marker_trusted":5,"malformed":4,"timeout":4,"proxied_by_node":{"172.31.11.189":3,"172.31.29.110":4}},` + |
| - `"80":{"proxied":3,"no_client":2,"no_client_refused":0,"ignored":1,"ignored_private":4,"marker_trusted":0,"malformed":2,"timeout":3,"proxied_by_node":{"172.31.11.189":1,"172.31.29.110":2}}}}` |
| + `"by_listener":{"443":{"proxied":7,"no_client":0,"no_client_refused":1,"ignored":2,"ignored_private":0,"marker_trusted":5,"malformed":4,"timeout":4,"idle":0,"proxied_by_node":{"172.31.11.189":3,"172.31.29.110":4}},` + |
| + `"80":{"proxied":3,"no_client":2,"no_client_refused":0,"ignored":1,"ignored_private":4,"marker_trusted":0,"malformed":2,"timeout":3,"idle":0,"proxied_by_node":{"172.31.11.189":1,"172.31.29.110":2}}}}` |
| // unarmedStatusJSON is an unarmed edge's status line. |
| -const unarmedStatusJSON = `{"armed":false,"barrier":false,"edge_instance":"","counters":{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0},"proxied_by_node":{},"by_listener":{}}` |
| +const unarmedStatusJSON = `{"armed":false,"barrier":false,"edge_instance":"","counters":{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"idle":0},"proxied_by_node":{},"by_listener":{}}` |
| // zeroStatusJSON is an armed edge's status line with nothing counted. |
| -const zeroStatusJSON = `{"armed":true,"barrier":false,"edge_instance":"0123456789abcdef0123456789abcdef","counters":{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0},"proxied_by_node":{},` + |
| - `"by_listener":{"443":{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"proxied_by_node":{}},"80":{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"proxied_by_node":{}}}}` |
| +const zeroStatusJSON = `{"armed":true,"barrier":false,"edge_instance":"0123456789abcdef0123456789abcdef","counters":{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"idle":0},"proxied_by_node":{},` + |
| + `"by_listener":{"443":{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"idle":0,"proxied_by_node":{}},"80":{"proxied":0,"no_client":0,"no_client_refused":0,"ignored":0,"ignored_private":0,"marker_trusted":0,"malformed":0,"timeout":0,"idle":0,"proxied_by_node":{}}}}` |
| func serveTrust(t *testing.T, h http.Handler, method, target string) (int, string) { |
| t.Helper() |
| @@ -553,3 +553,48 @@ func zeroCountersWire() *trustCountersWire { |
| z := func() *uint64 { return new(uint64) } |
| return &trustCountersWire{Proxied: z(), NoClient: z(), NoClientRefused: z(), Ignored: z(), IgnoredPrivate: z(), MarkerTrusted: z(), Malformed: z(), Timeout: z()} |
| } |
| + |
| +// TestTrustStatusIdleOptional: an edge from before the idle counter (still |
| +// running while a newer binary asks during an update) sends no "idle"; its |
| +// status is accepted with idle read as zero. Every other counter stays |
| +// required. |
| +func TestTrustStatusIdleOptional(t *testing.T) { |
| + old := strings.ReplaceAll(trustStatusFixtureJSON, `,"idle":0`, "") |
| + if strings.Contains(old, "idle") { |
| + t.Fatal("fixture still names idle") |
| + } |
| + var r trustResult |
| + if err := json.Unmarshal([]byte(old), &r); err != nil { |
| + t.Fatal(err) |
| + } |
| + if a, err := validTrust("trust-status", &r); err != nil || a != trustAnswerStatus { |
| + t.Fatalf("old edge status: answer %v, err %v; want accepted", a, err) |
| + } |
| + if line := trustStatusLine(&r); line.Counters.Idle != 0 || line.Counters.Timeout != 7 { |
| + t.Fatalf("old edge status line counters = %+v", line.Counters) |
| + } |
| + |
| + withIdle := strings.Replace(strings.Replace(strings.Replace(trustStatusFixtureJSON, |
| + `"timeout":7,"idle":0`, `"timeout":7,"idle":5`, 1), |
| + `"timeout":4,"idle":0`, `"timeout":4,"idle":2`, 1), |
| + `"timeout":3,"idle":0`, `"timeout":3,"idle":3`, 1) |
| + var n trustResult |
| + if err := json.Unmarshal([]byte(withIdle), &n); err != nil { |
| + t.Fatal(err) |
| + } |
| + if a, err := validTrust("trust-status", &n); err != nil || a != trustAnswerStatus { |
| + t.Fatalf("status with idle: answer %v, err %v; want accepted", a, err) |
| + } |
| + if line := trustStatusLine(&n); line.Counters.Idle != 5 || line.ByListener["80"].Idle != 3 { |
| + t.Fatalf("status with idle counters = %+v", line.Counters) |
| + } |
| + |
| + noTimeout := strings.Replace(trustStatusFixtureJSON, `"timeout":7,`, "", 1) |
| + var m trustResult |
| + if err := json.Unmarshal([]byte(noTimeout), &m); err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := validTrust("trust-status", &m); err == nil { |
| + t.Fatal("status without timeout accepted; only idle may be absent") |
| + } |
| +} |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index f4253ce83..dab43bebf 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -240,3 +240,4 @@ plan14-root-reads-audit-aws-timeouts.tsv c3e74a3069651a7ae638b2ecba5e38c4dbaec28 |
| plan14-root-reads-config-receipts-1.tsv 4abde13ec40d53a479684b7f1e2079fbedb6c40cb1a28819c97853cdab768b2f |
| plan14-root-reads-audit-edge-test-sleeps.tsv 4abde13ec40d53a479684b7f1e2079fbedb6c40cb1a28819c97853cdab768b2f |
| plan14-root-reads-ha-generations-floor.tsv 7ca068c5c146a679b4726d74fe43cf9c47f97080f9c08b761a36a9a12a5a3c54 |
| +plan14-root-reads-edge-ppv2-idle.tsv f5c0ad32db5ee003f16ba314d7083e416cc18578d802ace49233f31afb7d164a |
diff --git a/internal/provision/testdata/plan14-root-reads-edge-ppv2-idle.tsv b/internal/provision/testdata/plan14-root-reads-edge-ppv2-idle.tsv| new file mode 100644 |
| index 000000000..034f92dde |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-edge-ppv2-idle.tsv |
| @@ -0,0 +1,10 @@ |
| +# Census overlay edge-ppv2-idle, written by census-propose (#369). census-ruling-edge-ppv2-idle, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-edge-ppv2-idle.md. |
| +# 1 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other. |
| +@legacy 617bff46b6ba2741c56456fd1b5d9a0c31c779a4839831e81f7fb8919eff4a7a internal/proxyproto/conn.go Conn.parse legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-ppv2;basis=Edge (uid carlos), not root. Detects the signature, reads at most one header with ReadHeader (under the header deadline on a trusted peer), and resolves the connection's state (an untrusted peer: plain, or failed on a malformed header; a trusted one: proxied, no client or failed), consulting the barrier flag when it resolves. The scanner's +file:Command is the comparison h.Command != CommandProxy (the header's command nibble), not a process; no file, nothing run.;rev3=census-ruling-edge-ppv2-idle;basis=A trusted connection whose header read times out with no byte read, and sentAnything finds no byte either, closes and counts idle instead of timeout. Same close, same state (failed); no new read beyond sentAnything. Edge (uid carlos), not root. file:Command@1392 c113ea15ffb11367ee475f92010a612931fcce8d7fb37bfbc980dd6afa46e670 |
| +@legacy 85184aecd4251f100e63e2dc38b22c44d293921fc032bfad6fd278e3c56ffb5e internal/proxyproto/conn.go Conn.sentAnything legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-ppv2-idle;basis=New. On a trusted connection about to be closed after a header-deadline timeout with nothing read: sets a 5 ms read deadline on the accepted socket and reads at most one byte from it, to tell an idle connection from one whose bytes arrived after the deadline had passed. The byte is dropped; the connection is closed straight after. Reads only the already accepted network connection; no file, no path, nothing run. Edge (uid carlos), not root. file:Read@113 c04a314029bdde08d4c60b2c2bfae53e15a4f2f75d0ed8b3d92c36656cc3c50a |
| +internal/proxyproto/conn.go Conn.parse legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-ppv2;basis=Edge (uid carlos), not root. Detects the signature, reads at most one header with ReadHeader (under the header deadline on a trusted peer), and resolves the connection's state (an untrusted peer: plain, or failed on a malformed header; a trusted one: proxied, no client or failed), consulting the barrier flag when it resolves. The scanner's +file:Command is the comparison h.Command != CommandProxy (the header's command nibble), not a process; no file, nothing run.;rev3=census-ruling-edge-ppv2-idle;basis=A trusted connection whose header read times out with no byte read, and sentAnything finds no byte either, closes and counts idle instead of timeout. Same close, same state (failed); no new read beyond sentAnything. Edge (uid carlos), not root. file:Command@1392 c113ea15ffb11367ee475f92010a612931fcce8d7fb37bfbc980dd6afa46e670 |
| +internal/proxyproto/conn.go Conn.sentAnything legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-ppv2-idle;basis=New. On a trusted connection about to be closed after a header-deadline timeout with nothing read: sets a 5 ms read deadline on the accepted socket and reads at most one byte from it, to tell an idle connection from one whose bytes arrived after the deadline had passed. The byte is dropped; the connection is closed straight after. Reads only the already accepted network connection; no file, no path, nothing run. Edge (uid carlos), not root. file:Read@113 c04a314029bdde08d4c60b2c2bfae53e15a4f2f75d0ed8b3d92c36656cc3c50a |
| +@coverage internal/edge 5daba01cf2b64bca76359ec8fe240cbe0964555e681ebce6042a10a5f670de22 |
| +@coverage internal/host 77b8af2eae59f5402e406bbd19659f82e5bd612946515e1c6b1c7c4dfeb63119 |
| +@coverage internal/proxyproto 75dd4fd8131e3d2f9a934f1a61466ac86f50a8eca2fa550fd611feeb67eba441 |
diff --git a/internal/proxyproto/conn.go b/internal/proxyproto/conn.go| index 85f70a1eb..920d82ee1 100644 |
| --- a/internal/proxyproto/conn.go |
| +++ b/internal/proxyproto/conn.go |
| @@ -251,7 +251,12 @@ func (c *Conn) parse() State { |
| if !full { |
| if c.trusted && !mismatched(sig[:n]) { |
| // The read failed (err is set) before the stream could be |
| - // told apart from a header: a trusted connection closes. |
| + // told apart from a header: a trusted connection closes. With |
| + // no byte at all by the deadline it was idle (the NLB sends its |
| + // header with the client's first bytes), not a broken header. |
| + if n == 0 && isTimeout(err) && !c.sentAnything() { |
| + return c.failIdle(err) |
| + } |
| return c.fail(err) |
| } |
| // Not a header (or, untrusted, a read error before it could be |
| @@ -343,6 +348,31 @@ func (c *Conn) fail(cause error) State { |
| case errors.Is(cause, ErrMalformed): |
| c.l.c.malformed.Add(1) |
| } |
| + return c.close(cause) |
| +} |
| + |
| +// idleCheck bounds sentAnything's one read. |
| +const idleCheck = 5 * time.Millisecond |
| + |
| +// sentAnything reports whether the peer had sent a byte that the header |
| +// read never saw: a read whose deadline had already passed when the parse |
| +// began (it starts on the first Read, not at accept) fails without reading. |
| +// Only for a connection about to be closed; the byte read is dropped. |
| +func (c *Conn) sentAnything() bool { |
| + c.inner.SetReadDeadline(time.Now().Add(idleCheck)) |
| + var b [1]byte |
| + m, _ := c.inner.Read(b[:]) |
| + return m == 1 |
| +} |
| + |
| +// failIdle closes a trusted connection that sent nothing before its header |
| +// deadline and counts it as idle, not as a timeout. |
| +func (c *Conn) failIdle(cause error) State { |
| + c.l.c.idle.Add(1) |
| + return c.close(cause) |
| +} |
| + |
| +func (c *Conn) close(cause error) State { |
| c.failErr = fmt.Errorf("proxyproto: connection closed: %w", cause) |
| c.closeInner() |
| return StateFailed |
diff --git a/internal/proxyproto/counters.go b/internal/proxyproto/counters.go| index ef885901f..53a763a09 100644 |
| --- a/internal/proxyproto/counters.go |
| +++ b/internal/proxyproto/counters.go |
| @@ -28,8 +28,15 @@ type Counters struct { |
| // Malformed: headers refused (bad header, or an unusable source on a |
| // trusted connection). |
| Malformed uint64 |
| - // Timeout: headers not complete by their deadline. |
| + // Timeout: trusted connections that started a header (sent at least |
| + // one byte) but did not complete it by the deadline. |
| Timeout uint64 |
| + // Idle: trusted connections that sent no byte at all before the header |
| + // deadline. A load balancer sends its PROXY header with the client's |
| + // first bytes, so an idle client connection (a browser preconnect) is |
| + // closed here, exactly as ReadHeaderTimeout closes an idle direct one. |
| + // Counted apart from Timeout because it is ordinary traffic, not a fault. |
| + Idle uint64 |
| // ProxiedByNode splits Proxied by the trusted peer address. |
| ProxiedByNode map[netip.Addr]uint64 |
| } |
| @@ -43,6 +50,7 @@ type counters struct { |
| markerTrusted atomic.Uint64 |
| malformed atomic.Uint64 |
| timeout atomic.Uint64 |
| + idle atomic.Uint64 |
| mu sync.Mutex |
| byNode map[netip.Addr]uint64 |
| @@ -68,6 +76,7 @@ func (c *counters) snapshot() Counters { |
| MarkerTrusted: c.markerTrusted.Load(), |
| Malformed: c.malformed.Load(), |
| Timeout: c.timeout.Load(), |
| + Idle: c.idle.Load(), |
| } |
| c.mu.Lock() |
| s.ProxiedByNode = make(map[netip.Addr]uint64, len(c.byNode)) |
diff --git a/internal/proxyproto/listener_test.go b/internal/proxyproto/listener_test.go| index bbe243cef..95b26d380 100644 |
| --- a/internal/proxyproto/listener_test.go |
| +++ b/internal/proxyproto/listener_test.go |
| @@ -319,7 +319,10 @@ func TestTrustedUnusableSourceClosed(t *testing.T) { |
| } |
| } |
| -func TestTrustedHeaderTimeout(t *testing.T) { |
| +// TestTrustedIdleBeforeHeader: a trusted connection that sends nothing (an |
| +// NLB connection whose client never sent a byte) closes at the deadline and |
| +// counts as idle, not as a timeout. |
| +func TestTrustedIdleBeforeHeader(t *testing.T) { |
| l := listen(t, Config{Trusted: loopback, HeaderTimeout: 50 * time.Millisecond}) |
| client, c := pair(t, l) |
| @@ -327,8 +330,42 @@ func TestTrustedHeaderTimeout(t *testing.T) { |
| t.Fatalf("State = %v, want failed", s) |
| } |
| expectClosed(t, client) |
| - if n := l.Counters().Timeout; n != 1 { |
| - t.Fatalf("Timeout = %d, want 1", n) |
| + cn := l.Counters() |
| + if cn.Idle != 1 || cn.Timeout != 0 || cn.Malformed != 0 { |
| + t.Fatalf("Idle = %d, Timeout = %d, Malformed = %d, want 1, 0 and 0", cn.Idle, cn.Timeout, cn.Malformed) |
| + } |
| +} |
| + |
| +// TestTrustedHeaderTimeoutPartialSignature: a few signature bytes, then |
| +// silence. A started header is a timeout, never idle. |
| +func TestTrustedHeaderTimeoutPartialSignature(t *testing.T) { |
| + l := listen(t, Config{Trusted: loopback, HeaderTimeout: 50 * time.Millisecond}) |
| + client, c := pair(t, l) |
| + write(t, client, proxyHeader("203.0.113.7:51000")[:3]) |
| + |
| + if s := stateWithin(t, c, time.Second); s != StateFailed { |
| + t.Fatalf("State = %v, want failed", s) |
| + } |
| + expectClosed(t, client) |
| + cn := l.Counters() |
| + if cn.Timeout != 1 || cn.Idle != 0 { |
| + t.Fatalf("Timeout = %d, Idle = %d, want 1 and 0", cn.Timeout, cn.Idle) |
| + } |
| +} |
| + |
| +// TestUntrustedSilentIsNotIdle: idle counts trusted connections only; an |
| +// untrusted one has no header deadline and is left to the server. |
| +func TestUntrustedSilentIsNotIdle(t *testing.T) { |
| + l := listen(t, Config{HeaderTimeout: 50 * time.Millisecond}) |
| + _, c := pair(t, l) |
| + c.SetReadDeadline(time.Now().Add(100 * time.Millisecond)) |
| + buf := make([]byte, 1) |
| + if _, err := c.Read(buf); err == nil { |
| + t.Fatal("Read returned no error on a silent connection") |
| + } |
| + cn := l.Counters() |
| + if cn.Idle != 0 || cn.Timeout != 0 { |
| + t.Fatalf("Idle = %d, Timeout = %d, want 0 and 0", cn.Idle, cn.Timeout) |
| } |
| } |
| @@ -343,8 +380,8 @@ func TestTrustedHeaderTimeoutPartial(t *testing.T) { |
| } |
| expectClosed(t, client) |
| cn := l.Counters() |
| - if cn.Timeout != 1 || cn.Malformed != 0 { |
| - t.Fatalf("Timeout = %d, Malformed = %d, want 1 and 0", cn.Timeout, cn.Malformed) |
| + if cn.Timeout != 1 || cn.Malformed != 0 || cn.Idle != 0 { |
| + t.Fatalf("Timeout = %d, Malformed = %d, Idle = %d, want 1, 0 and 0", cn.Timeout, cn.Malformed, cn.Idle) |
| } |
| } |
diff --git a/scripts/ppv2-step.py b/scripts/ppv2-step.py| index 5173f320e..c9a8a80e3 100755 |
| --- a/scripts/ppv2-step.py |
| +++ b/scripts/ppv2-step.py |
| @@ -112,7 +112,14 @@ TFVARS_KEY = {'preserve_client_ip': 'ppv2_preserve_client_ip', 'proxy_protocol_v |
| LOCK_FILE = '.ppv2-step.lock' |
| COUNTERS = ('proxied', 'no_client', 'no_client_refused', 'ignored', 'ignored_private', |
| 'marker_trusted', 'malformed', 'timeout') |
| +# idle: trusted connections that sent no byte before the header deadline. The |
| +# NLB sends its header with the client's first bytes, so a browser preconnect |
| +# that never sends a request lands here. Ordinary traffic, never in STILL; an |
| +# edge from before the counter does not report it, so it is optional, but a |
| +# line has it everywhere or nowhere. |
| +OPTIONAL = ('idle',) |
| # Counters that must not move from the apply's baseline until convergence. |
| +# timeout is a header started and not finished, never an idle connection. |
| STILL = ('malformed', 'timeout', 'ignored_private', 'marker_trusted', 'no_client_refused') |
| PROBE_EXPECT = {'A': 's1', 'B': 's2', 'R': 's1'} |
| TRUST_STATUS = '/opt/carlos/carlos system edge trust-status' |
| @@ -292,8 +299,14 @@ def plan_refusal(plan, address, attribute, before, after): |
| return None |
| -def counts_ok(counters, nodes): |
| - if not isinstance(counters, dict) or set(counters) != set(COUNTERS): |
| +def counter_keys(status): |
| + """The counters a status line carries: COUNTERS, plus idle when the edge reports it.""" |
| + counters = status.get('counters') if isinstance(status, dict) else None |
| + return COUNTERS + OPTIONAL if isinstance(counters, dict) and 'idle' in counters else COUNTERS |
| + |
| + |
| +def counts_ok(counters, nodes, keys=COUNTERS): |
| + if not isinstance(counters, dict) or set(counters) != set(keys): |
| return False |
| if not all(type(v) is int and v >= 0 for v in counters.values()): |
| return False |
| @@ -315,7 +328,8 @@ def parse_trust(text): |
| return None |
| if not isinstance(doc['armed'], bool) or not isinstance(doc['barrier'], bool): |
| return None |
| - if not counts_ok(doc['counters'], doc['proxied_by_node']): |
| + keys = counter_keys(doc) |
| + if not counts_ok(doc['counters'], doc['proxied_by_node'], keys): |
| return None |
| instance, listeners = doc['edge_instance'], doc['by_listener'] |
| if not isinstance(instance, str) or not isinstance(listeners, dict): |
| @@ -326,11 +340,11 @@ def parse_trust(text): |
| return None |
| for port in LISTENERS: |
| l = listeners[port] |
| - if not isinstance(l, dict) or set(l) != set(COUNTERS) | {'proxied_by_node'}: |
| + if not isinstance(l, dict) or set(l) != set(keys) | {'proxied_by_node'}: |
| return None |
| - if not counts_ok({c: l[c] for c in COUNTERS}, l['proxied_by_node']): |
| + if not counts_ok({c: l[c] for c in keys}, l['proxied_by_node'], keys): |
| return None |
| - if any(doc['counters'][c] != sum(listeners[p][c] for p in LISTENERS) for c in COUNTERS): |
| + if any(doc['counters'][c] != sum(listeners[p][c] for p in LISTENERS) for c in keys): |
| return None |
| nodes = set(doc['proxied_by_node']).union(*(listeners[p]['proxied_by_node'] for p in LISTENERS)) |
| if any(doc['proxied_by_node'].get(n, 0) != sum(listeners[p]['proxied_by_node'].get(n, 0) for p in LISTENERS) |
| @@ -748,6 +762,11 @@ def collect_baseline(cloud, step, targets): |
| # barrier: it is the way forward again after an S3 incident (spec 6.5). |
| if status['barrier'] and step.attribute == 'preserve_client_ip': |
| raise Refused(f'the trust barrier is up on {iid}; no B step while it is up (spec 4.7)') |
| + # An edge from before the idle counter counts an idle preconnect as |
| + # timeout, which a B step must keep still: it could never converge. |
| + if step.attribute == 'preserve_client_ip' and 'idle' not in status['counters']: |
| + raise Refused(f'{iid} does not report the idle counter: its edge predates it and would count ' |
| + 'idle connections as timeout; roll it to a release with idle before a B step') |
| return baseline_at, baseline |
| @@ -1318,10 +1337,11 @@ def continuous_reasons(times, start, end, gap, what, start_label): |
| def counts_of(status): |
| """Every count in a status line that only rises while one edge runs: the |
| sums, each listener's, and each node's proxied count, sum and per listener.""" |
| - out = {(None, c): status['counters'][c] for c in COUNTERS} |
| + keys = counter_keys(status) |
| + out = {(None, c): status['counters'][c] for c in keys} |
| out.update({(None, 'node ' + n): v for n, v in status['proxied_by_node'].items()}) |
| for port, listener in (status.get('by_listener') or {}).items(): |
| - out.update({(port, c): listener[c] for c in COUNTERS}) |
| + out.update({(port, c): listener[c] for c in keys}) |
| out.update({(port, 'node ' + n): v for n, v in listener['proxied_by_node'].items()}) |
| return out |
diff --git a/scripts/ppv2_step_test.py b/scripts/ppv2_step_test.py| index 56c100761..c1d4a1034 100644 |
| --- a/scripts/ppv2_step_test.py |
| +++ b/scripts/ppv2_step_test.py |
| @@ -1758,6 +1758,78 @@ class ListenerAndRestartTests(ConvergeTests): |
| 'proxied_by_node': {}, 'by_listener': {}} |
| self.assertIsNotNone(gate.parse_trust(json.dumps(unarmed))) |
| + @staticmethod |
| + def with_idle(status, on80=0, on443=0): |
| + d = copy.deepcopy(status) |
| + d['by_listener']['80']['idle'] = on80 |
| + d['by_listener']['443']['idle'] = on443 |
| + d['counters']['idle'] = on80 + on443 |
| + return d |
| + |
| + def test_status_line_idle_optional(self): |
| + """An edge with the idle counter reports it everywhere; one from before |
| + it reports it nowhere. Both parse; a line with it in some places only, |
| + or whose listeners do not sum to it, does not.""" |
| + good = trust('after_a') |
| + self.assertIsNotNone(gate.parse_trust(json.dumps(good))) |
| + self.assertIsNotNone(gate.parse_trust(json.dumps(self.with_idle(good, 3, 4)))) |
| + for mutate in (lambda d: d['by_listener']['80'].pop('idle'), |
| + lambda d: d['counters'].pop('idle'), |
| + lambda d: d['counters'].update(idle=8), |
| + lambda d: d['by_listener']['443'].update(idle=-1)): |
| + d = self.with_idle(good, 3, 4) |
| + mutate(d) |
| + self.assertIsNone(gate.parse_trust(json.dumps(d))) |
| + |
| + def test_idle_moving_is_not_a_finding(self): |
| + """Idle preconnects in S2 (the NLB sends its header with the client's |
| + first bytes) move idle, never timeout; idle is not in STILL, so a B step |
| + still converges. timeout, a header started and not finished, still fails it.""" |
| + self.assertNotIn('idle', gate.STILL) |
| + self.assertIn('timeout', gate.STILL) |
| + base = self.with_idle(trust('after_a')) |
| + moved = self.with_idle(trust('after_a'), on80=8) |
| + self.assertEqual([], gate.trust_findings(moved, base, None, TARGETS[0], 'B80')) |
| + timed_out = copy.deepcopy(base) |
| + timed_out['by_listener']['80']['timeout'] += 1 |
| + timed_out['counters']['timeout'] += 1 |
| + reasons = gate.trust_findings(timed_out, base, None, TARGETS[0], 'B80') |
| + self.assertTrue(any('timeout' in r for r in reasons), reasons) |
| + |
| + @staticmethod |
| + def without_idle(status): |
| + d = copy.deepcopy(status) |
| + d['counters'].pop('idle', None) |
| + for listener in d['by_listener'].values(): |
| + listener.pop('idle', None) |
| + return d |
| + |
| + def test_old_edge_line_parses_and_refuses_b_steps(self): |
| + """An edge from before the idle counter: its line parses, an A step may |
| + run on it, a B step (forward or its reverify baseline) is refused before |
| + anything changes, and a reverse step is not.""" |
| + old = self.without_idle(trust('after_a')) |
| + self.assertIsNotNone(gate.parse_trust(json.dumps(old))) |
| + |
| + class Clock: |
| + @staticmethod |
| + def time(): |
| + return 1794900000.0 |
| + |
| + class Cloud: |
| + clock = Clock() |
| + |
| + @staticmethod |
| + def trust(targets): |
| + return {iid: copy.deepcopy(old) for iid in targets} |
| + |
| + gate.collect_baseline(Cloud(), gate.STEPS['A443'], TARGETS) |
| + gate.collect_baseline(Cloud(), gate.STEPS['R80'], TARGETS) |
| + for step in ('B80', 'B443'): |
| + with self.assertRaises(gate.Refused) as caught: |
| + gate.collect_baseline(Cloud(), gate.STEPS[step], TARGETS) |
| + self.assertIn('does not report the idle counter', str(caught.exception)) |
| + |
| class SyncTfvarsTests(Harness): |
| """W13: after the incident's direct preservation-on command, sync-tfvars |
diff --git a/scripts/testdata/ppv2/trust-status.json b/scripts/testdata/ppv2/trust-status.json| index a25b041bf..422f5befd 100644 |
| --- a/scripts/testdata/ppv2/trust-status.json |
| +++ b/scripts/testdata/ppv2/trust-status.json |
| @@ -1,17 +1,17 @@ |
| { |
| "_comment": "Recorded `carlos system edge trust-status` lines (one JSON line each on the box), keyed by situation. Shapes follow internal/host/edgetrust.go trustStatus: counters and proxied_by_node sum by_listener (keyed \"80\" and \"443\"); edge_instance is set once per edge start.", |
| - "baseline": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5120, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| - "after_a": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5180, "no_client_refused": 0, "ignored": 412, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| - "before_b": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 6010, "no_client_refused": 0, "ignored": 1830, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 3005, "no_client_refused": 0, "ignored": 915, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 3005, "no_client_refused": 0, "ignored": 915, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| - "b_both_nodes": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 377, "no_client": 6070, "no_client_refused": 0, "ignored": 1902, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {"172.31.11.189": 181, "172.31.29.110": 196}, "by_listener": {"80": {"proxied": 188, "no_client": 3035, "no_client_refused": 0, "ignored": 951, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {"172.31.11.189": 90, "172.31.29.110": 98}}, "443": {"proxied": 189, "no_client": 3035, "no_client_refused": 0, "ignored": 951, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {"172.31.11.189": 91, "172.31.29.110": 98}}}}, |
| - "b_one_node": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 196, "no_client": 6070, "no_client_refused": 0, "ignored": 1902, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {"172.31.29.110": 196}, "by_listener": {"80": {"proxied": 98, "no_client": 3035, "no_client_refused": 0, "ignored": 951, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {"172.31.29.110": 98}}, "443": {"proxied": 98, "no_client": 3035, "no_client_refused": 0, "ignored": 951, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {"172.31.29.110": 98}}}}, |
| - "b_port80_only": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 377, "no_client": 6070, "no_client_refused": 0, "ignored": 1902, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {"172.31.11.189": 181, "172.31.29.110": 196}, "by_listener": {"80": {"proxied": 377, "no_client": 3065, "no_client_refused": 0, "ignored": 987, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {"172.31.11.189": 181, "172.31.29.110": 196}}, "443": {"proxied": 0, "no_client": 3005, "no_client_refused": 0, "ignored": 915, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| - "malformed_moved": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5180, "no_client_refused": 0, "ignored": 412, "ignored_private": 0, "marker_trusted": 0, "malformed": 1, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 1, "timeout": 0, "proxied_by_node": {}}}}, |
| - "marker_trusted_moved": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5180, "no_client_refused": 0, "ignored": 412, "ignored_private": 0, "marker_trusted": 2, "malformed": 0, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 2, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| - "no_client_refused_moved": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5180, "no_client_refused": 7, "ignored": 412, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2590, "no_client_refused": 7, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| - "restarted": {"armed": true, "barrier": false, "edge_instance": "b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2", "counters": {"proxied": 0, "no_client": 12, "no_client_refused": 0, "ignored": 3, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 6, "no_client_refused": 0, "ignored": 1, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 6, "no_client_refused": 0, "ignored": 2, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| - "restarted_counts_higher": {"armed": true, "barrier": false, "edge_instance": "b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2", "counters": {"proxied": 0, "no_client": 6180, "no_client_refused": 0, "ignored": 1412, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 3590, "no_client_refused": 0, "ignored": 1206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| - "fell_since_last_poll": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5150, "no_client_refused": 0, "ignored": 412, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| - "barrier_up": {"armed": true, "barrier": true, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5120, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "proxied_by_node": {}}}}, |
| + "baseline": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5120, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "after_a": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5180, "no_client_refused": 0, "ignored": 412, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "before_b": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 6010, "no_client_refused": 0, "ignored": 1830, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 3005, "no_client_refused": 0, "ignored": 915, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 3005, "no_client_refused": 0, "ignored": 915, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "b_both_nodes": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 377, "no_client": 6070, "no_client_refused": 0, "ignored": 1902, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {"172.31.11.189": 181, "172.31.29.110": 196}, "by_listener": {"80": {"proxied": 188, "no_client": 3035, "no_client_refused": 0, "ignored": 951, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {"172.31.11.189": 90, "172.31.29.110": 98}}, "443": {"proxied": 189, "no_client": 3035, "no_client_refused": 0, "ignored": 951, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {"172.31.11.189": 91, "172.31.29.110": 98}}}}, |
| + "b_one_node": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 196, "no_client": 6070, "no_client_refused": 0, "ignored": 1902, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {"172.31.29.110": 196}, "by_listener": {"80": {"proxied": 98, "no_client": 3035, "no_client_refused": 0, "ignored": 951, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {"172.31.29.110": 98}}, "443": {"proxied": 98, "no_client": 3035, "no_client_refused": 0, "ignored": 951, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {"172.31.29.110": 98}}}}, |
| + "b_port80_only": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 377, "no_client": 6070, "no_client_refused": 0, "ignored": 1902, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {"172.31.11.189": 181, "172.31.29.110": 196}, "by_listener": {"80": {"proxied": 377, "no_client": 3065, "no_client_refused": 0, "ignored": 987, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {"172.31.11.189": 181, "172.31.29.110": 196}}, "443": {"proxied": 0, "no_client": 3005, "no_client_refused": 0, "ignored": 915, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "malformed_moved": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5180, "no_client_refused": 0, "ignored": 412, "ignored_private": 0, "marker_trusted": 0, "malformed": 1, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 1, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "marker_trusted_moved": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5180, "no_client_refused": 0, "ignored": 412, "ignored_private": 0, "marker_trusted": 2, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 2, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "no_client_refused_moved": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5180, "no_client_refused": 7, "ignored": 412, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2590, "no_client_refused": 7, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "restarted": {"armed": true, "barrier": false, "edge_instance": "b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2", "counters": {"proxied": 0, "no_client": 12, "no_client_refused": 0, "ignored": 3, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 6, "no_client_refused": 0, "ignored": 1, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 6, "no_client_refused": 0, "ignored": 2, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "restarted_counts_higher": {"armed": true, "barrier": false, "edge_instance": "b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2", "counters": {"proxied": 0, "no_client": 6180, "no_client_refused": 0, "ignored": 1412, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 3590, "no_client_refused": 0, "ignored": 1206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "fell_since_last_poll": {"armed": true, "barrier": false, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5150, "no_client_refused": 0, "ignored": 412, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2590, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 206, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| + "barrier_up": {"armed": true, "barrier": true, "edge_instance": "a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1", "counters": {"proxied": 0, "no_client": 5120, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0}, "proxied_by_node": {}, "by_listener": {"80": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}, "443": {"proxied": 0, "no_client": 2560, "no_client_refused": 0, "ignored": 0, "ignored_private": 0, "marker_trusted": 0, "malformed": 0, "timeout": 0, "idle": 0, "proxied_by_node": {}}}}, |
| "not_armed": {"rc": 2, "stderr": "edge: this box is not armed for PROXY protocol\n"} |
| } |