Move a permit portal from one ingress path to another without weakening request trust. The public guide, reviewer app, and case API have distinct hostnames. Two known proxies forward traffic to six API replicas. A reviewer may upload inspection evidence while another approves a case; a rollout drains one replica with long-lived sockets and short requests in flight. The new ingress must reject a direct-origin request with forged client headers, reject unknown hosts, admit only ready upstreams, and keep request-body and retry behavior inside documented budgets. A broken upstream connection after approval does not prove the write failed.
Project: permit ingress cutover and safe retry
Build contract
- Restrict origin reachability, strip client-supplied forwarding claims at the public edge, and trust only the known proxy hop chain.
- Map each allowed host to a certificate, backend, cookie scope, and configured canonical origin; reject unknown and revoked authorities.
- Use separate liveness and readiness signals. Stop new admission before a bounded drain and spread long-lived client reconnects.
- Apply route-specific body caps and total deadlines; let only classified replay-safe reads retry automatically within a small budget.
Implementation checkpoint
function ingressDecision(knownHost, trustedPeer, readyBackend, operationKind) {
if (!knownHost || !trustedPeer) return "reject";
if (!readyBackend) return "unavailable";
return operationKind === "approval" ? "forward-once" : "forward";
}
console.log(ingressDecision(true, false, true, "approval"));
// Output: rejectCost and boundaries
Host and trusted-hop checks are small per-request lookups, yet their configuration must be updated for every domain or proxy rollout. Health probes recur across the fleet and need thresholds that avoid flapping. A drain consumes old capacity for its grace period; too little grace interrupts exports and sockets, while too much slows deployment. Body buffering consumes edge memory or disk proportional to concurrent upload bytes. A retry adds upstream work and can duplicate an effect if the origin committed before the connection failed. Record rejected authority, forwarding failures, ready-node count, drain completion, buffered bytes, timeout phase, and stable operation identity without copying private request bodies into logs.
Failure drill
Reach the origin directly with a forged office address and prove it cannot be accepted as trusted. Send an old test hostname and a revoked customer hostname through a valid TLS connection; neither may route to the private reviewer app. Start a new node with its port open but its policy table unavailable and verify readiness prevents admission. Drain an old node under 63 short requests and 900 sockets, then measure completion and reconnect surge. Upload 63 megabytes to a 47-megabyte route and confirm early ingress rejection. Finally, commit an approval and drop the upstream connection before its response; any retry must use the same server-owned operation identity and produce one audit event.
Acceptance checks
- A forged address or unknown host cannot change tenant routing, redirect origin, or permission.
- Not-ready and draining nodes receive no new ordinary requests.
- Body-size and total-time failures end within their route budgets and clean staged data.
- A lost approval response does not create a second committed effect.
Common Mistakes
- Trusting forwarding headers from a directly reachable origin.
- Making the private app the catch-all host.
- Enabling proxy retries for every failed upstream connection.
Related lessons
Ingress Proxy and Upstream Contracts; Trusted Proxy Hops and Forwarded Client Identity; Host Authority Routing and Default Deny; Ingress Health, Readiness, and Connection Drain; Proxy Body Budgets, Timeouts, and Retry Ownership.
