carlos / platform Public

Egress allow by private CIDR (and hostname) for managed stores Feature Request open

Ask (a self-hosted operator; must land before its production apps depend on managed AWS databases from CARLOS): carlos apps set --egress-allow takes only single private IPs, at most 8 (docs/site/cli.md ~262). Managed stores move IP on failover or replacement:

  • an Aurora writer moves within its subnets;
  • a Valkey node gets a new IP when it's replaced.

When that happens, the app is cut off from its database until someone edits the list, and the edit then takes up to about 33 minutes to reach the boxes.

Plan:

  1. CIDR entries, first. For example 10.0.64.0/20, limited to private ranges exactly as today's single-IP rule is (RFC 1918, plus whatever else the current validator allows). There is a floor on breadth, so no /8: a minimum prefix length is set in the design. The count limit stays. The box enforcement gets the prefix as-is. No DNS dependency, and a failover within the subnets keeps working.
  2. Hostname entries, if cheap after 1. The box resolves the name, refuses any answer that isn't private, and refreshes on the record's TTL with a floor and ceiling. This is a follow-up decision once 1 lands.
  3. Propagation time. Find why an allow-list edit takes up to about 33 minutes to reach fleet boxes, and shorten it if that's cheap.
  4. The warning "not checked against these boxes, which publish no address list: box-a, box-b, box-c" on apps set for fleet boxes: explain or fix it.

Rough date: CIDR merged by about 2026-11-25; release on Paul's go. A builder is starting now; progress here.

Progress (branch egress-allow-cidr). CIDR entries are built: tasks 1-3 are reviewed by Astra, and the kernel proof on the root runner is next. Plan: docs/superpowers/plans/2026-11-22-egress-allow-cidr.md.

What a range does:

  • --egress-allow 10.0.64.0/20,10.0.5.20 is accepted. Ranges must lie wholly inside the private ranges a single address may use today.
  • The widest allowed range is /16 for IPv4 (the largest AWS VPC block) and /48 for IPv6 (a ULA site).
  • A range with host bits set (10.0.64.5/20) is refused, and the refusal names 10.0.64.0/20.
  • The limit is still 8 entries, and each range counts as one entry. Single addresses are stored exactly as before.
  • Root writes the range exactly as given, with no widening. A box refuses a range that holds one of its own addresses, because systemd's allow beats its deny and the box's address cannot be carved out.
  • The console refuses a range that holds a published box address.

Old boxes. An old box cannot read a range, so the whole policy fails to verify. That box then closes all of the app's allows and drops its size override. It never fails open, but it does break the app's other entries. So a grant that adds a range is refused until every fresh box runs v0.43.0 or later. Single addresses are not gated. If the release ships under another number, the floor moves with it.

Propagation (about 33 minutes): documented, not shortened.

  • Fleet boxes have no change index, so they re-read app policies only on the 30-minute backstop, plus up to 3 minutes of jitter.
  • Shared boxes follow the change index and apply a change within seconds.
  • The cheap fix would make a fleet box re-list control/app-policy/ whenever the console serial moves. The serial moves on any console activity, so this adds S3 requests on every fleet box. Ruling 11 needs a budget for that first.
  • Proposal for Paul: on a serial move, a fleet box re-lists only when the console's change record names the app-policy scope. That needs the console to tell fleet boxes which scope moved, which is a small protocol change. Not built.

The warning "not checked against these boxes, which publish no address list". It is correct. Grant-time checks read box addresses from edges files, and only platform boxes publish them; bucketless fleet boxes never do (spec §4.2). Root on every box, fleet boxes included, still refuses an entry holding its own address. The wording is changed to say that plainly.

Hostname entries: proposal, not built.

  • Root on the box resolves the name through the box's resolver.
  • It accepts only answers that would pass today's allow rules (private, not metadata or link-local). One public or refused answer refuses the whole entry, with a reason.
  • It writes the answers as /32 or /128 entries, counted against the limit of 8.
  • It refreshes on the record's TTL, with a floor of 30 s and a ceiling of 5 min. Root's existing 30 s assert loop carries this, with no new store reads.
  • On a failed lookup, it keeps the last good answers for up to the ceiling, then closes the entry and reports failing.
  • Cost: a DNS dependency in root, and an answer can move to any private address the resolver returns. A range bounds that, a name does not.
  • My recommendation is to wait and see whether ranges cover the managed-store case (Aurora and Valkey stay inside their subnets). Paul decides.

Merged: 36b17ea5 (squash, CI green on 04c71942). Not released; a release needs Paul's GO.

  • --egress-allow takes private ranges as well as single addresses. A range is no wider than /16 (IPv4) or /48 (IPv6), host bits are refused, and an app still has at most 8 entries.
  • A range can be added only once every fresh box runs v0.43.0. If the release ships under another number, release.EgressPrefixFloor moves with it.
  • Kernel proof on the root runner, run 20261122T130018-3b700d: an address inside the range is reachable, one outside is refused, and a revoke closes it.
  • Rollback hazard, in the docs: once an app has a range, do not roll a console back below v0.43.0. An older console cannot read that app's policy, and a change made from it would clear the app's allows and sizes.
  • Already failing before this branch, found on the root runner: TestPlan14EgressClaimLaunchRootRunner fails on main's base d3266e8e too (egress under claims, deferred by ruling 9). TestRootEgressIsolation fails when it runs after TestRootEgressInstanceControlUnderClaims in the same process, because that test leaves a parent-slice drop-in behind. Both are left as follow-ups.
  • Still open for Paul: the hostname proposal and the propagation proposal in the progress post above.