carlos / platform Public

egress ranges: copy pass (Luna, delegated)

Apply Luna review rows 1-12, 14, 15 verbatim; row 13 not applied.
Tests, copy record and census overlay re-pinned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev dd845e4a8e4f87d1f89f2ed2276686eb6099c0a7 parent 3c1e1d1
12 files changed, +48 −45
  • apps_policy.go +3 −3
  • apps_policy_test.go +1 −1
  • docs/site/cli.md +2 −2
  • docs/superpowers/notes/census-proposal-egress-allow-cidr-console.md +1 −1
  • docs/superpowers/plans/2026-10-21-instance-policy-copy.json +10 −9
  • internal/console/egressfleet.go +2 −2
  • internal/console/egressfleet_test.go +5 −5
  • internal/egressaddr/egressaddr.go +5 −5
  • internal/egressaddr/egressaddr_test.go +6 −6
  • internal/instancectl/egress.go +2 −2
  • internal/instancectl/egress_test.go +7 −7
  • internal/provision/testdata/plan14-root-reads-egress-allow-cidr-console.tsv +4 −2

Intent

Human

<task-notification> <task-id>ac810769c39e60e93</task-id> <tool-use-id>toolu_01NGcqaFPy22wQg5bHgXwCYf</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/22311489-9a69-4708-aa90-e32c2ae39ed2/tasks/ac810769c39e60e93.output</output-file> <status>completed</status> <summary>Agent "Implement Task 4: kernel prefix witness" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>Status: Done. The test compiles and vets but has not been run: it needs root and systemd, so it waits for the root runner. Commit: 3c1e1d1a on egress-allow-cidr. It adds one new file, `internal/host/egress_prefix_rootrunner_linux_test.go`. Git printed a `packed-refs.lock` error during the commit (another git process was using the shared repo), but the commit and branch ref did land and the tree is clean. Test: `TestRootEgressPrefixKernelProof`. Select it with `-tags rootrunner -run '^TestRootEgressPrefixKernelProof$'`. It logs three verdict lines: inside reachable, outside refused, revoke closes inside. Compile: the rootrunner build works for linux/amd64 and linux/arm64, `go vet -tags rootrunner` is clean, and the default build and vet are unchanged. `-list` selects exactly this test, and `make code-health` passes after I took out two new `time.Sleep` loops. Concerns: - **Separate namespace:** the targets sit in their own network namespace (`carlos-egr3`), not on a dummy link. A dummy link would make them addresses of the box, and the asserter would then refuse the prefix. - **Policy is in memory:** it is passed to the production `newEgressAsserter`, so no registry or control service is involved. Its due records go to a scratch folder. - **Revoke may go by restart:** nothing is allowed on `carlos-instances.slice`, so on a clean runner the asserter closes the revoke by restarting the tenant rather than live. The test waits up to 10 s in that case and logs which way it went. - **Runner needs:** no address of the box inside 10.250.64.0/20, and no existing `carlos-egr3` namespace or link or `carlos-egress-prefix-a` unit. Report: `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/egress-allow-cidr/.superpowers/sdd/2026-11-22-egress-allow-cidr/task-4-report.md`</result> <usage><subagent_tokens>101803</subagent_tokens><tool_uses>24</tool_uses><duration_ms>496235</duration_ms></usage> </task-notification>

Attributed to this commit: 4.29 g CO₂e (480,034 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on egress-allow-cidr, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/apps_policy.go b/apps_policy.go
index 170995bcf..c9515ace8 100644
--- a/apps_policy.go
+++ b/apps_policy.go
@@ -33,12 +33,12 @@ import (
// Copy (approved by delegation, Luna pass 2026-10-26; deck copy-instance-policy-plan1.md).
const (
- appsSetFlagEgress = `private addresses or ranges every instance of the app may reach, comma-separated, never a port. a range is at least /16 (IPv4) or /48 (IPv6). pass the whole list; "" clears it. system operators only`
+ appsSetFlagEgress = `private addresses or ranges every instance of the app may reach, comma-separated, never a port. a range is no wider than /16 (IPv4) or /48 (IPv6). pass the whole list; "" clears it. system operators only`
appsSetFlagSize = "the size the app's instances run at: small, standard, large or xlarge. default uses the build's size. system operators only"
instancesSetFlagSize = "this instance's size: small, standard, large or xlarge. default follows the app's size. system operators only"
appsSetPolicyUsage = `Only system operators may pass --egress-allow or --size. A change reaches
the app's boxes within seconds on a box following the deployment's change index, or within about 33 minutes on another box.
---egress-allow takes at most 8 entries. A range starts at its first address, so
+--egress-allow takes at most 8 entries. A range must start at its first address, so
10.0.64.5/20 is refused; write 10.0.64.0/20. Ranges need v0.43.0 or later on
every box, and a box refuses a range that holds one of its own addresses.`
appsSetBadEgress = "apps set: --egress-allow: %v"
@@ -48,7 +48,7 @@ every box, and a box refuses a range that holds one of its own addresses.`
appsPolicyChanged = "the policy changed while this ran. run it again"
appsSetEgressDone = "egress allow for %s set to %s"
appsSetEgressCleared = "egress allow for %s cleared"
- appsSetEgressNotChecked = "not checked against these boxes, which publish no address list (fleet boxes never do): %s. each one still refuses an entry that holds its own address"
+ appsSetEgressNotChecked = "not checked against these boxes, which publish no address list (fleet boxes never do): %s. each one still refuses an entry that covers its own address"
appsSetSizeDone = "default size for %s set to %s. instances with their own size are unchanged"
appsSetSizeCleared = "default size for %s set to the build's size. instances with their own size are unchanged"
instancesSetSizeDone = "%s size set to %s"
diff --git a/apps_policy_test.go b/apps_policy_test.go
index 3974a8bb5..2d81f82f0 100644
--- a/apps_policy_test.go
+++ b/apps_policy_test.go
@@ -324,7 +324,7 @@ func TestAppsSetPrintsNotChecked(t *testing.T) {
if out.String() != want {
t.Fatalf("stdout = %q, want %q", out.String(), want)
}
- if want := "not checked against these boxes, which publish no address list (fleet boxes never do): box-c. each one still refuses an entry that holds its own address\n"; !strings.HasSuffix(out.String(), want) {
+ if want := "not checked against these boxes, which publish no address list (fleet boxes never do): box-c. each one still refuses an entry that covers its own address\n"; !strings.HasSuffix(out.String(), want) {
t.Fatalf("stdout = %q, want it to end %q", out.String(), want)
}
diff --git a/docs/site/cli.md b/docs/site/cli.md
index deded7b41..83bb665af 100644
--- a/docs/site/cli.md
+++ b/docs/site/cli.md
@@ -259,9 +259,9 @@ carlos instances set shop-a.example.com --app shop --size xlarge
carlos apps show shop
```
-An instance cannot reach a private address unless its app allows it. `--egress-allow` takes the app's whole list, comma-separated, and replaces the list before it. To drop one entry, pass the list without it; `--egress-allow ""` removes them all. Each entry is a single IP address or a private range such as `10.0.64.0/20` or `fd00:5::/64`, with no port or zone. A range is at least a /16 for IPv4 or a /48 for IPv6, and starts at its first address, so `10.0.64.5/20` is refused. Public addresses are refused because instances can reach them already, and so are loopback, link-local, multicast and reserved addresses, the cloud metadata service and the NAT64 prefix, and any range that holds one of them. An app may allow at most 8 entries, and a range counts as one.
+An instance cannot reach a private address unless its app allows it. `--egress-allow` takes the app's whole list, comma-separated, and replaces the list before it. To drop one entry, pass the list without it; `--egress-allow ""` removes them all. Each entry is a single IP address or a private range such as `10.0.64.0/20` or `fd00:5::/64`, with no port or zone. The widest range is /16 for IPv4 or /48 for IPv6. Every range must start at its first address, so `10.0.64.5/20` is refused. Public addresses are refused because instances can reach them already, and so are loopback, link-local, multicast and reserved addresses, the cloud metadata service and the NAT64 prefix, and any range that contains one of them. An app may allow at most 8 entries, and a range counts as one.
-A change that adds an entry is checked against the deployment's boxes. An entry that holds an address of one of them is refused, and so is any new entry while a box does not publish its address list yet. Boxes that publish no address list are named after the change (fleet boxes never publish one), and each of them still refuses an entry that holds its own address. A range can be added only while every box runs v0.43.0 or later. Single addresses work on any release. An allow takes effect only on a box where every instance runs nested (see `carlos status --layout`). It does not take effect while host claims are on. If a box later takes an allowed address, or an address in an allowed range, the console sends an alert.
+A change that adds an entry is checked against the deployment's boxes. An entry that covers an address of one of them is refused, and so is any new entry while a box does not publish its address list yet. Boxes that publish no address list are named after the change (fleet boxes never publish one), and each of them still refuses an entry that covers its own address. A range can be added only while every box runs v0.43.0 or later. Single addresses work on any release. An allow takes effect only on a box where every instance runs nested (see `carlos status --layout`). It does not take effect while host claims are on. If a box later takes an allowed address, or an address in an allowed range, the console sends an alert.
The sizes are `small` (256 MiB of memory), `standard` (512 MiB), `large` (1 GiB) and `xlarge` (2 GiB), with CPU and IO to match. `carlos apps set --size` sets the app's size, and `--size default` goes back to the build's size. `carlos instances set --size` gives one instance a size of its own, and `--size default` makes it follow the app's size again. A size above `standard` is refused when it is more than a quarter of the memory on the smallest box the app can run on, or when one of those boxes reports no memory total.
diff --git a/docs/superpowers/notes/census-proposal-egress-allow-cidr-console.md b/docs/superpowers/notes/census-proposal-egress-allow-cidr-console.md
index 577cb7760..7bad71495 100644
--- a/docs/superpowers/notes/census-proposal-egress-allow-cidr-console.md
+++ b/docs/superpowers/notes/census-proposal-egress-allow-cidr-console.md
@@ -2,7 +2,7 @@
Ruling `census-ruling-egress-allow-cidr-console`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
-Envelopes re-pinned: `.`, `internal/release`.
+Envelopes re-pinned: `.`, `internal/egressaddr`, `internal/instancectl`, `internal/release`.
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.
diff --git a/docs/superpowers/plans/2026-10-21-instance-policy-copy.json b/docs/superpowers/plans/2026-10-21-instance-policy-copy.json
index 5f7cf86dd..9fb984da4 100644
--- a/docs/superpowers/plans/2026-10-21-instance-policy-copy.json
+++ b/docs/superpowers/plans/2026-10-21-instance-policy-copy.json
@@ -1,6 +1,7 @@
{
"approved_by": "delegation (Luna pass, gpt-5.6-luna; Paul's standing rule for platform copy decks)",
"approved_on": "2026-10-26",
+ "amended_by": "approved by delegation (Luna pass 2026-11-22): IP1-06, IP1-08, IP1-10, IP1-11, IP1-14, IP1-50, IP1-53, IP2-30, IP2-60",
"source": "docs/superpowers/specs/LUNA-COPY-RESULT-INSTANCE-POLICY.md",
"entries": [
{"id": "IP1-01", "file": "internal/egressaddr/egressaddr.go", "text": "an address is empty"},
@@ -8,15 +9,15 @@
{"id": "IP1-03", "file": "internal/egressaddr/egressaddr.go", "text": "%q has a port. an allow opens an address, never a port"},
{"id": "IP1-04", "file": "internal/egressaddr/egressaddr.go", "text": "%q has a zone. name the address without it"},
{"id": "IP1-05", "file": "internal/egressaddr/egressaddr.go", "text": "%q is not an IP address"},
- {"id": "IP1-06", "file": "internal/egressaddr/egressaddr.go", "text": "%s is a loopback address"},
+ {"id": "IP1-06", "file": "internal/egressaddr/egressaddr.go", "text": "%s is loopback"},
{"id": "IP1-07", "file": "internal/egressaddr/egressaddr.go", "text": "%s is the unspecified address"},
- {"id": "IP1-08", "file": "internal/egressaddr/egressaddr.go", "text": "%s is the cloud metadata service"},
+ {"id": "IP1-08", "file": "internal/egressaddr/egressaddr.go", "text": "%s would reach the cloud metadata service"},
{"id": "IP1-09", "file": "internal/egressaddr/egressaddr.go", "text": "%s is link-local"},
- {"id": "IP1-10", "file": "internal/egressaddr/egressaddr.go", "text": "%s is a multicast address"},
- {"id": "IP1-11", "file": "internal/egressaddr/egressaddr.go", "text": "%s is in %s, a reserved range"},
+ {"id": "IP1-10", "file": "internal/egressaddr/egressaddr.go", "text": "%s is multicast"},
+ {"id": "IP1-11", "file": "internal/egressaddr/egressaddr.go", "text": "%s is in or overlaps %s, a reserved range"},
{"id": "IP1-12", "file": "internal/egressaddr/egressaddr.go", "text": "%s is in the NAT64 prefix 64:ff9b::/96, which reaches any IPv4 address"},
{"id": "IP1-13", "file": "internal/egressaddr/egressaddr.go", "text": "%s is a public address and is already reachable. no allow is needed"},
- {"id": "IP1-14", "file": "internal/egressaddr/egressaddr.go", "text": "at most %d addresses per app (%d given)"},
+ {"id": "IP1-14", "file": "internal/egressaddr/egressaddr.go", "text": "at most %d entries per app (%d given)"},
{"id": "IP1-15", "file": "internal/console/policylease.go", "text": "another console (%s) is the policy writer for this deployment until %s. use that console, or try again after that"},
{"id": "IP1-16", "file": "internal/console/policylease.go", "text": "another console is the policy writer for this deployment until %s. use the console that holds the lease, or try again after that"},
{"id": "IP1-17", "file": "internal/console/policylease.go", "text": "could not take the policy writer lease. try again"},
@@ -57,7 +58,7 @@
{"id": "IP1-35", "file": "apps_policy.go", "text": "the policy changed while this ran. run it again"},
{"id": "IP1-36", "file": "apps_policy.go", "text": "egress allow for %s set to %s"},
{"id": "IP1-37", "file": "apps_policy.go", "text": "egress allow for %s cleared"},
- {"id": "IP2-30", "file": "apps_policy.go", "text": "not checked against these boxes, which publish no address list (fleet boxes never do): %s. each one still refuses an entry that holds its own address"},
+ {"id": "IP2-30", "file": "apps_policy.go", "text": "not checked against these boxes, which publish no address list (fleet boxes never do): %s. each one still refuses an entry that covers its own address"},
{"id": "IP1-38", "file": "apps_policy.go", "text": "default size for %s set to %s. instances with their own size are unchanged"},
{"id": "IP1-39", "file": "apps_policy.go", "text": "default size for %s set to the build's size. instances with their own size are unchanged"},
{"id": "IP1-42", "file": "apps_policy.go", "text": "%s size set to %s"},
@@ -65,10 +66,10 @@
{"id": "IP3-10", "file": "apps_policy.go", "text": "%s: %d MiB committed to awake instances, of %d MiB. %d MiB free"},
{"id": "IP3-11", "file": "apps_policy.go", "text": "the new memory size applies at the next start. a larger size also applies at the next deploy; a smaller size waits for a cold start. CPU and IO apply now"},
{"id": "IP1-44", "file": "apps_policy.go", "text": "apps show works through a console, and this shell is in direct bucket mode (CARLOS_DEPLOYMENT_BUCKET or CARLOS_DEPLOYMENT_DIR is set). log in instead: carlos auth login --console <url>"},
- {"id": "IP1-50", "file": "apps_policy.go", "text": "private addresses or ranges every instance of the app may reach, comma-separated, never a port. a range is at least /16 (IPv4) or /48 (IPv6). pass the whole list; \"\" clears it. system operators only"},
+ {"id": "IP1-50", "file": "apps_policy.go", "text": "private addresses or ranges every instance of the app may reach, comma-separated, never a port. a range is no wider than /16 (IPv4) or /48 (IPv6). pass the whole list; \"\" clears it. system operators only"},
{"id": "IP1-51", "file": "apps_policy.go", "text": "the size the app's instances run at: small, standard, large or xlarge. default uses the build's size. system operators only"},
{"id": "IP1-52", "file": "apps_policy.go", "text": "this instance's size: small, standard, large or xlarge. default follows the app's size. system operators only"},
- {"id": "IP1-53", "file": "apps_policy.go", "text": "Only system operators may pass --egress-allow or --size. A change reaches\nthe app's boxes within seconds on a box following the deployment's change index, or within about 33 minutes on another box.\n--egress-allow takes at most 8 entries. A range starts at its first address, so\n10.0.64.5/20 is refused; write 10.0.64.0/20. Ranges need v0.43.0 or later on\nevery box, and a box refuses a range that holds one of its own addresses."},
+ {"id": "IP1-53", "file": "apps_policy.go", "text": "Only system operators may pass --egress-allow or --size. A change reaches\nthe app's boxes within seconds on a box following the deployment's change index, or within about 33 minutes on another box.\n--egress-allow takes at most 8 entries. A range must start at its first address, so\n10.0.64.5/20 is refused; write 10.0.64.0/20. Ranges need v0.43.0 or later on\nevery box, and a box refuses a range that holds one of its own addresses."},
{"id": "IP1-54", "file": "apps_policy.go", "text": "usage: carlos apps show <app> [--account <sqid|name>] [--account-id <sqid>] [--console <origin>]"},
{"id": "IP1-60", "file": "apps_policy.go", "text": "egress allow %s"},
{"id": "IP1-61", "file": "apps_policy.go", "text": "default size %s"},
@@ -107,7 +108,7 @@
{"id": "IP2-20", "file": "internal/console/apiinstances.go", "text": "the allow takes effect when the instance next starts"},
{"id": "IP2-21", "file": "internal/console/apiinstances.go", "text": "the box could not apply the allow, and tries again"},
{"id": "IP2-22", "file": "internal/console/apiinstances.go", "text": "the allow is not in force on this box"},
- {"id": "IP2-60", "file": "internal/instancectl/egress.go", "text": "%s: an address of this box (%s)"},
+ {"id": "IP2-60", "file": "internal/instancectl/egress.go", "text": "%s: this box has an address in %s"},
{"id": "IP2-61", "file": "internal/instancectl/egress.go", "text": ": this box's addresses could not be read"},
{"id": "IP2-45", "file": "internal/instancectl/egress.go", "text": "the policy has more than %d addresses (%d); every one is closed"},
{"id": "IP2-49", "file": "internal/instancectl/egress.go", "text": "revoked (restarted)"},
diff --git a/internal/console/egressfleet.go b/internal/console/egressfleet.go
index 0eaa07e15..cc4b6c79f 100644
--- a/internal/console/egressfleet.go
+++ b/internal/console/egressfleet.go
@@ -48,11 +48,11 @@ const (
egressFleetHeldMsg = "%s is an address of box %s. an egress allow cannot open a box of this fleet"
// egressFleetRangeHeldMsg and egressRangeBelowFloorMsg are #1357's,
// awaiting their copy pass.
- egressFleetRangeHeldMsg = "%s holds %s, an address of box %s. an egress allow cannot open a box of this fleet"
+ egressFleetRangeHeldMsg = "%s overlaps %s, an address or range held by box %s. an egress allow cannot open a box of this fleet"
// egressRangeBelowFloorMsg is filled with the first fresh box below
// release.EgressPrefixFloor (by label), the release it runs
// (boxReleaseWord) and the floor.
- egressRangeBelowFloorMsg = "box %s runs %s. allowing a range needs v%s or later on every box. single addresses are unaffected"
+ egressRangeBelowFloorMsg = "box %s reports %s. allowing a range needs v%s or later on every box. single addresses are unaffected"
egressFleetUnreadableMsg = "box %s's address list could not be read. try again in a minute"
egressFleetOlderBoxMsg = "box %s does not publish its addresses yet. upgrade it before granting an egress allow"
egressFleetListMsg = "the fleet's address lists could not be read. try again in a minute"
diff --git a/internal/console/egressfleet_test.go b/internal/console/egressfleet_test.go
index 106212b24..f90544759 100644
--- a/internal/console/egressfleet_test.go
+++ b/internal/console/egressfleet_test.go
@@ -1013,8 +1013,8 @@ func TestEgressGrantRefusesARangeHoldingAFleetAddress(t *testing.T) {
add string
want string
}{
- {"10.0.64.0/20", "10.0.64.0/20 holds 10.0.64.7, an address of box annie. an egress allow cannot open a box of this fleet"},
- {"fd00:5::/48", "fd00:5::/48 holds fd00:5::/64, an address of box annie. an egress allow cannot open a box of this fleet"},
+ {"10.0.64.0/20", "10.0.64.0/20 overlaps 10.0.64.7, an address or range held by box annie. an egress allow cannot open a box of this fleet"},
+ {"fd00:5::/48", "fd00:5::/48 overlaps fd00:5::/64, an address or range held by box annie. an egress allow cannot open a box of this fleet"},
} {
nc, ref := s.egressGrantCheck(context.Background(), prefixes(t, c.add))
if ref == nil || ref.Status != http.StatusConflict || ref.Msg != c.want {
@@ -1042,7 +1042,7 @@ func TestPolicyDoorRangeNeedsTheFloorOnEveryBox(t *testing.T) {
setBoxRelease(t, fx.rel, "olive", "v0.30.0", now.Add(-24*time.Hour)) // stale: not counted
st, _, out := fx.put(t, "shop", `{"egress_allow":["10.0.64.0/20"]}`, policyCreate)
- if want := "box betty runs v0.42.1. allowing a range needs v0.43.0 or later on every box. single addresses are unaffected"; st != http.StatusConflict || errorOf(t, out) != want {
+ if want := "box betty reports v0.42.1. allowing a range needs v0.43.0 or later on every box. single addresses are unaffected"; st != http.StatusConflict || errorOf(t, out) != want {
t.Fatalf("a range with betty on v0.42.1 = %d %s, want 409 %q", st, out, want)
}
fx.noObject(t, "shop")
@@ -1057,7 +1057,7 @@ func TestPolicyDoorRangeNeedsTheFloorOnEveryBox(t *testing.T) {
setBoxRelease(t, fx.rel, "betty", "", now) // names no release: below
if st, _, out := fx.put(t, "shop", `{"egress_allow":["10.0.64.0/20","fd00:5::/64"]}`, policyIfMatch(ranged.ETag)); st != http.StatusConflict ||
- errorOf(t, out) != "box betty runs no release. allowing a range needs v0.43.0 or later on every box. single addresses are unaffected" {
+ errorOf(t, out) != "box betty reports no release. allowing a range needs v0.43.0 or later on every box. single addresses are unaffected" {
t.Fatalf("a second range with betty naming no release = %d %s, want 409", st, out)
}
fx.mustPut(t, "shop", `{"egress_allow":["10.0.64.0/20"]}`, policyIfMatch(ranged.ETag))
@@ -1159,7 +1159,7 @@ func TestEgressGrantRangeFloorCountsFleetBoxes(t *testing.T) {
ctx := context.Background()
_, ref := fx.srv.egressGrantCheck(ctx, prefixes(t, "10.0.64.0/20"))
- if want := "box bx-2 runs v0.42.1. allowing a range needs v0.43.0 or later on every box. single addresses are unaffected"; ref == nil ||
+ if want := "box bx-2 reports v0.42.1. allowing a range needs v0.43.0 or later on every box. single addresses are unaffected"; ref == nil ||
ref.Status != http.StatusConflict || ref.Msg != want {
t.Fatalf("a range with fleet box bx-2 on v0.42.1 = %+v, want 409 %q", ref, want)
}
diff --git a/internal/egressaddr/egressaddr.go b/internal/egressaddr/egressaddr.go
index 02a8d3dcb..384c6cf5c 100644
--- a/internal/egressaddr/egressaddr.go
+++ b/internal/egressaddr/egressaddr.go
@@ -53,15 +53,15 @@ const (
msgPort = "%q has a port. an allow opens an address, never a port"
msgZone = "%q has a zone. name the address without it"
msgNotAddr = "%q is not an IP address"
- msgLoopback = "%s is a loopback address"
+ msgLoopback = "%s is loopback"
msgUnspecified = "%s is the unspecified address"
- msgMetadata = "%s is the cloud metadata service"
+ msgMetadata = "%s would reach the cloud metadata service"
msgLinkLocal = "%s is link-local"
- msgMulticast = "%s is a multicast address"
- msgReserved = "%s is in %s, a reserved range"
+ msgMulticast = "%s is multicast"
+ msgReserved = "%s is in or overlaps %s, a reserved range"
msgNAT64 = "%s is in the NAT64 prefix 64:ff9b::/96, which reaches any IPv4 address"
msgPublic = "%s is a public address and is already reachable. no allow is needed"
- msgTooMany = "at most %d addresses per app (%d given)"
+ msgTooMany = "at most %d entries per app (%d given)"
msgHostBits = "%q has host bits set. write it as %s"
msgWide = "%s is wider than /%d. allow at most a /%d"
msgNotPrivate = "%s is not wholly inside a private range"
diff --git a/internal/egressaddr/egressaddr_test.go b/internal/egressaddr/egressaddr_test.go
index afba92c31..58b3ee371 100644
--- a/internal/egressaddr/egressaddr_test.go
+++ b/internal/egressaddr/egressaddr_test.go
@@ -117,7 +117,7 @@ func TestNormalize(t *testing.T) {
for i := 1; i <= 9; i++ {
nine = append(nine, fmt.Sprintf("10.0.5.%d", i))
}
- if _, err := Normalize(nine); err == nil || !strings.Contains(err.Error(), "at most 8 addresses per app (9 given)") {
+ if _, err := Normalize(nine); err == nil || !strings.Contains(err.Error(), "at most 8 entries per app (9 given)") {
t.Errorf("Normalize(nine) error %v, want the cap", err)
}
// The cap counts after the dedupe: eight addresses given twice each fit.
@@ -166,13 +166,13 @@ func TestEntriesRefused(t *testing.T) {
"10.0.64.5/20": `"10.0.64.5/20" has host bits set. write it as 10.0.64.0/20`,
"169.254.0.0/16": "169.254.0.0/16 is link-local",
"169.254.169.0/24": "169.254.169.0/24 is link-local",
- "fd00:ec2::/48": "fd00:ec2::/48 is the cloud metadata service",
+ "fd00:ec2::/48": "fd00:ec2::/48 would reach the cloud metadata service",
"64:ff9b::/96": "64:ff9b::/96 is in the NAT64 prefix 64:ff9b::/96, which reaches any IPv4 address",
"198.18.0.0/16": "198.18.0.0/16 is in 198.18.0.0/15, a reserved range",
"8.8.8.0/24": "8.8.8.0/24 is not wholly inside a private range",
"0.0.0.0/16": "0.0.0.0/16 is in 0.0.0.0/8, a reserved range",
- "224.0.0.0/16": "224.0.0.0/16 is a multicast address",
- "127.0.0.0/16": "127.0.0.0/16 is a loopback address",
+ "224.0.0.0/16": "224.0.0.0/16 is multicast",
+ "127.0.0.0/16": "127.0.0.0/16 is loopback",
"fe80::/64": "fe80::/64 is link-local",
"10.0.64.0/20:5432": `"10.0.64.0/20:5432" has a port. an allow opens an address, never a port`,
"::ffff:10.0.0.0/112": `"::ffff:10.0.0.0/112" is not an IP address`,
@@ -184,7 +184,7 @@ func TestEntriesRefused(t *testing.T) {
"fec0::/48": "fec0::/48 is in fec0::/10, a reserved range",
"2001:db8::/48": "2001:db8::/48 is not wholly inside a private range",
"8.8.8.8/32": "8.8.8.8 is a public address",
- "169.254.169.254/32": "169.254.169.254 is the cloud metadata service",
+ "169.254.169.254/32": "169.254.169.254 would reach the cloud metadata service",
} {
got, err := Normalize([]string{in})
if err == nil {
@@ -233,7 +233,7 @@ func TestNormalizeCountsPrefixesAsEntries(t *testing.T) {
for i := 1; i <= 9; i++ {
nine = append(nine, fmt.Sprintf("10.%d.0.0/16", i))
}
- if _, err := Normalize(nine); err == nil || !strings.Contains(err.Error(), "at most 8 addresses per app (9 given)") {
+ if _, err := Normalize(nine); err == nil || !strings.Contains(err.Error(), "at most 8 entries per app (9 given)") {
t.Errorf("Normalize(nine prefixes) error %v, want the cap", err)
}
if got, err := Normalize(nine[:8]); err != nil || len(got) != MaxAllow {
diff --git a/internal/instancectl/egress.go b/internal/instancectl/egress.go
index 15d1516ae..f4d2365de 100644
--- a/internal/instancectl/egress.go
+++ b/internal/instancectl/egress.go
@@ -669,9 +669,9 @@ func (e *EgressAsserter) desired(host string, allow []string) (want []netip.Pref
}
if lp, ok := overlapsLocal(p, local); ok {
if p.IsSingleIP() {
- refused = append(refused, fmt.Sprintf("%s: an address of this box (%s)", s, lp))
+ refused = append(refused, fmt.Sprintf("%s: this box has an address in %s", s, lp))
} else {
- refused = append(refused, fmt.Sprintf("%s: holds an address of this box (%s)", s, lp))
+ refused = append(refused, fmt.Sprintf("%s: overlaps an address or range of this box (%s)", s, lp))
}
continue
}
diff --git a/internal/instancectl/egress_test.go b/internal/instancectl/egress_test.go
index 36b821499..dc82183f5 100644
--- a/internal/instancectl/egress_test.go
+++ b/internal/instancectl/egress_test.go
@@ -200,7 +200,7 @@ func TestEgressRefusesEachBadEntryWithItsReason(t *testing.T) {
wantCalls(t, ctl.sets(), setCall(egressHost, "10.0.5.20/32", "10.0.5.21/32"))
// egressaddr's errors already name the address (C4): carried as-is.
want := []string{
- "127.0.0.1 is a loopback address",
+ "127.0.0.1 is loopback",
"8.8.8.8 is a public address and is already reachable. no allow is needed",
`"10.0.5.20:5432" has a port. an allow opens an address, never a port`,
}
@@ -220,7 +220,7 @@ func TestEgressDropsTheBoxsOwnAddress(t *testing.T) {
}
rep := mustAssert(t, e, egressHost)
wantCalls(t, ctl.sets(), setCall(egressHost, "10.0.5.21/32"))
- if want := []string{"10.0.5.20: an address of this box (10.0.5.20/32)"}; !reflect.DeepEqual(rep.Refused, want) {
+ if want := []string{"10.0.5.20: this box has an address in 10.0.5.20/32"}; !reflect.DeepEqual(rep.Refused, want) {
t.Fatalf("Refused = %q, want %q", rep.Refused, want)
}
if want := []string{"10.0.5.21"}; !reflect.DeepEqual(rep.Allowed, want) {
@@ -265,16 +265,16 @@ func TestEgressDesiredTakesPrefixesExactly(t *testing.T) {
want: pfx("10.0.5.21/32", "10.0.64.0/20")},
{name: "a prefix holding a local /32 is refused", allow: []string{"10.0.80.0/20", "10.0.64.0/20"},
want: pfx("10.0.64.0/20"),
- refused: []string{"10.0.80.0/20: holds an address of this box (10.0.80.7/32)"}},
+ refused: []string{"10.0.80.0/20: overlaps an address or range of this box (10.0.80.7/32)"}},
{name: "a prefix overlapping a local range is refused", allow: []string{"10.1.0.0/16", "fd00:6::/64"},
refused: []string{
- "10.1.0.0/16: holds an address of this box (10.1.0.0/24)",
- "fd00:6::/64: holds an address of this box (fd00:6::9/128)",
+ "10.1.0.0/16: overlaps an address or range of this box (10.1.0.0/24)",
+ "fd00:6::/64: overlaps an address or range of this box (fd00:6::9/128)",
}},
{name: "a single local address keeps its text", allow: []string{"10.0.5.20", "10.1.0.9"},
refused: []string{
- "10.0.5.20: an address of this box (10.0.5.20/32)",
- "10.1.0.9: an address of this box (10.1.0.0/24)",
+ "10.0.5.20: this box has an address in 10.0.5.20/32",
+ "10.1.0.9: this box has an address in 10.1.0.0/24",
}},
{name: "a host-bits entry is refused, never masked", allow: []string{"10.0.64.5/20"},
refused: []string{`"10.0.64.5/20" has host bits set. write it as 10.0.64.0/20`}},
diff --git a/internal/provision/testdata/plan14-root-reads-egress-allow-cidr-console.tsv b/internal/provision/testdata/plan14-root-reads-egress-allow-cidr-console.tsv
index fd67a0f33..2292b17bd 100644
--- a/internal/provision/testdata/plan14-root-reads-egress-allow-cidr-console.tsv
+++ b/internal/provision/testdata/plan14-root-reads-egress-allow-cidr-console.tsv
@@ -1,4 +1,6 @@
# Census overlay egress-allow-cidr-console, written by census-propose (#369). census-ruling-egress-allow-cidr-console, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-egress-allow-cidr-console.md.
-# 0 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
-@coverage . cdbb327b7c294a63068fb058a6056135dde0a871379b5043203ab9371546c6aa
+# 0 body, 0 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@coverage . 678ff93df9d4bba86e5fb3174b6e521c50a4a2b8e8da278eb7345f1dcc6b28ba
+@coverage internal/egressaddr f23f1c889694411f185a4e46acf541fd5e37320693c3cc5ce8d5f68fba1561ed
+@coverage internal/instancectl 4d36599760134ea7456756dba3fa02a90c7194454d355e8b1fab8f0bcc2a4bea
@coverage internal/release d5ad27f00e653c322b60826f5174354b6f2deae4f27f41bdd148aad959a35fd1