This also blocks the general hub pattern on shared boxes: a hub app (sign-in, shared data, a proxy for a rate-limited API) plus one instance per customer, calling each other by public hostname. Raised again today by a developer planning that shape on Carloku. Wherever the console happens to put the hub and a tenant instance on the same box, their calls fail. Cross-links: #993 (instance identity a hub can verify), #994 (hub pattern guide).
Apps on the same box cannot call each other through the edge (Jelly held below v0.28.17) Feature Request open
Problem
Since v0.28.17 (#367), denyLocalAddrs puts every address of the box on carlos-instances.slice as IPAddressDeny=. That is right for what #367 closes: traffic to a local address never leaves the box, so an instance that can reach one reaches every listener bound to all addresses, past the firewall.
It also closes something that is not that: an app making an HTTPS request to another app's public hostname when both apps happen to be on the same box. That request resolves to the box's own public address and is refused, though the same request to an app on any other box works.
Whether two apps can talk then depends on where the console placed them, which neither app can see or control.
The case that hits it
Jelly runs on console.carlos.exciting.io, which has one box (leo-bookbinding, 128.140.67.92, bound on eth0 as a /32). The account jelly has:
jelly-manager(join.letsjelly.com): the control plane.managed-jelly: one instance per customer team (5 today), created by the manager's service credential.beta-letsjelly-com: one more jam instance tied to the manager.
All run nested (carlos-instances.slice/carlos-instances-<host>.slice). The apps call each other over HTTPS by public hostname:
- team → manager: every team has
JAM_MANAGER_URL=https://join.letsjelly.com(grants, features, usage, plan overrides). - manager → team: Slack and Discord interaction forwarding, support requests, health checks, Rails migration sync, each to the team's own hostname.
- manager → console: it creates and manages team instances through the console API.
The deployment is on v0.28.11. Rolling to anything at or past v0.28.17 breaks all three directions, so it is held below that until there is a way to allow these calls.
Why --egress-allow does not cover it
carlos apps set --egress-allow is the nearest existing grant. It is refused twice for this:
- the console refuses a public address (
egressaddr.Allowed,internal/egressaddr/egressaddr.go:48: "is already reachable"). - root refuses any address the box holds (
internal/instancectl/egress.go:668,desired: "an address of this box";hardening.go:211likewise), and the comment ondenyLocalAddrsrelies on that refusal.
Relaxing either is the wrong fix. systemd's address lists have no ports, so an allow for the box's own address hands the app every listener on the box, the console's included. That reopens #367 for the apps it matters most for: these hold customers' mail.
Prior art: the region HA hairpin
Region HA P3b-1/P3b-2 (5c3e3fe5d, 40e1990b4) already solves the port problem for group boxes, in internal/hairpin, internal/instancectl/hairpin.go and internal/edge/hairpin.go:
- an nft table
carlos_hairpin(internal/hairpin/rules.go,Rules) hooks output and input at priority -300 and lets the box's ingress addresses take TCP 80 and 443 only; every other port and protocol to them is dropped, with no established-flow exception. - with that fence verified, root carves those addresses out of
denyLocalAddrsunder the cross-process hairpin lock; every failure path restores the full #367 deny (Operations.Rollback/Revoke). - the edge marks a hairpin connection only on its accept path, before TLS, from the socket's local and peer addresses (
hairpinIngress.classify); no header or Host selects it. It then setsRemoteAddrto the box's public IPv4, so the request goes through the ordinary visitor path.
It does not help this case as it stands: it is group-mode only, dormant, and AWS-shaped (public IPv4 from IMDSv2, 12-digit account, i- instance id in the snapshot /etc/carlos/group-ingress.json). leo-bookbinding is a single Hetzner box.
Recommended: widen the hairpin to every box
Give every box the hairpin's guarantee: from a nested instance, the box's own public addresses answer on TCP 80 and 443 (the edge) and on nothing else. Same-box calls then behave exactly like cross-box calls: TLS, the password gate, rate limits, protection, the activator waking a sleeping target. No grant, no proxy variable, no change to any app, and nothing to break when the console moves an app between boxes.
That matches today's policy rather than adding one: a call to an app on another box needs no grant, so a call to the same app on this box should not either.
What the widening has to change, not just reuse:
- Scope the fence to instances. The group fence drops every other port on the ingress addresses for every process on the box. That is fine for HA ingress EIPs, which exist only for the edge; on a box like leo-bookbinding the public address is eth0's primary, carrying ssh and everything else. The fence has to match traffic from
carlos-instances.sliceonly (nftsocket cgroupv2, or a mark set from the slice), or the edge has to listen on a separate address of its own on a dummy interface, which the instances alone are allowed to reach. - A non-AWS snapshot. The box's public addresses come from the box itself (or the signed host document), not IMDSv2, with the same strict validation
hairpin.Configdoes today. - Coordinate with #421. Region HA is in flight and owns
internal/hairpin. Under stopping rule 4 this either waits for that design to merge, or lands as a small extraction both sides review: the fence, lock and edge classification shared, with group mode one user of it.
Same-box calls reach the edge with the box's public IPv4 as their source, so rate limits treat them as one client, the same as calls from another box do now.
Alternative: a grant and a call proxy
Proposed first, and kept here for the review to weigh. It is only worth building if apps should get less than what any visitor gets, and then it should cover cross-box calls too.
The grant. Something like:
carlos apps set managed-jelly --call join.letsjelly.com,console.carlos.exciting.io carlos apps set jelly-manager --call '*.letsjelly.com',console.carlos.exciting.io
stored in the app policy beside the egress allow and sizes, signed, and applied by the box like them. System operator only, like --egress-allow. A wildcard is limited to hostnames the same account owns; a console origin is its own entry.
The path. The edge offers nested instances a way in that is not the box's address: a Unix socket bind-mounted into the instance, or a private address only the edge listens on (on a dummy interface, opened on the per-host slice with the existing per-host IPAddressAllow). The instance gets it as an HTTPS proxy address in CARLOS_CALL_PROXY, and uses it for its calls to other apps only, never as HTTPS_PROXY for everything, which would send its other outbound traffic (mail, payment, APIs) to a proxy that refuses it. The edge accepts a CONNECT only to a hostname the calling instance's app is granted; anything else gets a refusal naming the grant that is missing. A granted hostname this box does not serve is carried out to wherever it is served.
The cost against the hairpin: every calling app has to be changed to use the proxy for exactly the right calls, and a new signed policy field, CLI flag and edge CONNECT path to review.
What it needs to show
Either way:
- The deny on
carlos-instances.slicestays in place for everything but the edge, and the probe'sbox-addrline still passes for every other port of the box's address. - From an instance, a connection to the box's address on any port but 80/443, to a console port, or to any other local listener is refused.
- Every process outside the instances slice keeps its access to the box's own address (ssh, the console, root's own checks).
- A failure to install or verify the fence leaves the full #367 deny, as the group hairpin does.
carlos instances listsays when a box is not applying it and why.
With the grant instead: an instance with no grant cannot use the path, a granted one reaches only granted hostnames, a grant or revoke applies without restarting the instance, and carlos apps show lists it.
Until then
Two workarounds, neither good:
- Stay below v0.28.17. That holds back every fix since, including the clean stop (v0.34.30), the nightly restore checks (v0.34.48/49) and the long-host-name fix.
- Put the manager on a box of its own, so every call crosses boxes. It costs a box, and it does not help a team that calls its own hostname.
Merged to main as ddd234a67, and running on console.carlos.exciting.io (box leo-bookbinding) since 2026-11-13 21:57 UTC.
Label caveat: the box runs ddd234a67 built for linux-arm64 and stamped v0.34.50, shipped with carlos system update --file (signed with the deployment key). Its old updater (v0.28.11) only accepts a plain vX.Y.Z at or above its seeds floor (v0.28.10), the release key was not available, and the 0.34 line ended at v0.34.49, so v0.34.50 cannot collide with a published release. What it really is: v0.35.0 plus the edge fence (not the later G6 write fence). Any public release from v0.35.1 on rolls forward over it normally. sha256 ce23895a6d06fa57bac9f55ced9b8e1fa1bb5929dd614c135013aedd089d49f7.
Checked after the roll:
- From inside a Jelly team instance's slice:
https://join.letsjelly.com200,https://console.carlos.exciting.io200 (same-box, through the edge); sshd on :22 refused; UDP EPERM. edge fence: on for [128.140.67.92 2a01:4f8:1c1a:76ba::1]; the slice deny keeps loopback and link-local only. The operator'sinet hostfwtable (input, eth0) coexists.- Probe: box-addr, box-addr-ports, box-addr-edge all ok; box ready.
carlos system status: stable v0.34.50, current. - Wakes paused for ~5 s while the first probe ran after the restart, then resumed (jelly-manager woke in 730 ms).
Finding from the v0.35.3 dev roll (agent manager 8a3d302 for the platform release): on sophie (dev, EC2, v0.35.3) instance-control logs "probe: box-addr-edge unverified same-box calls are off on this box". The box's interface carries only its private address (ens5 172.31.14.16/20); the public EIP is NAT'd by AWS, so the edge fence takes its "no public address on the box" path and same-box calls stay off. That is probably true of every EC2 box on dev and the flagship, so the feature does nothing there as built. No regression: with the fence off the box keeps the old full deny.
Question for the #990 owner: should the allowed set include the box's public EIP as seen from inside (from instance metadata or the box record), or the private address too? Until then v0.35.3 ships with the fence effectively off on EC2 boxes.