Repository navigation
T88 — Declare a deny-all egress box from the CLI and show declared and default egress by name - #1958
Conversation
T88's CLI half (NET-075): `min session activate --deny-all-egress` declares the deny-all section — every allow list present and empty, nothing denied on top — mapping to sessions::EgressPolicy::deny_all(), the shape the host-address classifier decides its deny verdict on, so a box declared by flag reads in the record exactly like one declared by file. The flag conflicts with every --allow-*/--deny-* rule flag at parse, through one shared egress argument group, because deny-all admits no exceptions; it still combines with --credentialed-upstream, which declares a lane (NET-134), not a rule. `min session policy` renders a declared deny-all by name — `deny all` — rather than as four per-dimension rows whose every list is empty: a rendering that reads as nothing, never as the verdict it is. A box with no section keeps showing its effective default by name, the already-shipped NET-075 behavior, now pinned by its own test, and empty flag values stay typed validation errors rather than silently becoming the empty lists that are deny-all.
T88's classifier half: the refusal a per-box host makes over a host-address declaration it cannot enforce names the flag this task adds, beside the egress-section form it has always spelled. Both spellings write the same section into the record, so the words name them as the one declaration they are: the flag a person types at the next activate, and the section a project file carries.
The NET-080 proof's box is now activated with --deny-all-egress, so it lands in boxes/deny under the loaded classifier table, and the launch record asserts that subtree and its own leaf instead of boxes/allow. The refused-connect half the proof used to call undrivable is driven: a connection the box itself opens to 1.1.1.1:443 is asserted refused before the daemon's fetch and again after it, with the completed fetch (against the proof's empty package cache) standing between them as the reach control. The undrivable-half comment is gone, along with the net080_answered gate it explained. Also measured: the deepest live box socket under the lane's state root must fit the 107-byte AF_UNIX sun_path budget, which pins the lane's own state-root choice rather than trusting the sandbox builder.
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
/revise Make
Keep T87's classifier remedy test (main) green with the new refusal words. Re-run every test line in the plan block. |
…deny-all-egress-box-from-the-cli-and-s
The reviewer's round: NET-075 asks for the effective default by name, "marked as a default and not as a declaration", and the requirement's tokens are hyphenated. An undeclared box now prints `deny-all (default)` or `allow-all (default)` on the egress row; a box that declared the deny-all section prints bare `deny-all`, the same verdict without the mark. Every posture token in the render is hyphenated (`deny-all`, `allow-all`), egress and ingress rows alike, matching the requirement's literal spelling. The -o json document gains the same distinction: the `egress` object carries `effective` (the posture's name, or `rules` when the declaration's own lists say it) and `source` (`default` or `declared`), so a client never recomputes the default rule. A declared section rides under `rules`, present exactly when the box declared one. The pinned tests match the new rows, and the declared/default tests assert the difference in both renders: text and JSON.
One row for the flag in the activate table: what it writes, how a flag-declared box reads in the record, the classifier's per-box decision on a host-address box, and the rule-flag conflict. The policy section names the postures with the requirement's hyphenated tokens, prints the deny-all declaration as its one row, and marks the resolved defaults `deny-all (default)` and `allow-all (default)` so a defaulted box reads differently from a declared one. The -o json paragraph documents the `egress` object's `effective` and `source` fields. The new lines carry no vale alerts; the file's pre-existing ones are left alone.
…deny-all-egress-box-from-the-cli-and-s
|
The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was a failed check suite). A person decides now. Remove |
|
Round 1 of 1 on a /revise note, pushed as
Verify Outside the task's
Converted to a draft: something above needs a person before review.
Notes from the agent: E2e self-skip: this host has no |
|
Approved: no findings at Nothing to do. Verdict APPROVE, posted as a comment: the App cannot review its own pull request; the check and the label carry it. Clobber: none: |
|
The runtime will not revise this pull request again on its own: round 2 would exceed the cap of 1 (the last trigger was the runtime's review findings). A person decides now. Remove |
…d name a declared deny-all
norrietaylor
left a comment
There was a problem hiding this comment.
Reviewed at e819e4e. The revise round covers all six points of the ask:
- default mark, hyphenated tokens, JSON effective/source, tests asserting the difference, and the docs row;
- e5b2461 updates the native e2e pin;
- e819e4e brings the min dash TUI tokens in line and names a declared deny-all.
ARCH PASS. The effective-default TUI rendering is tracked in gominimal/inbox#884. All lanes are green on head.
T88 — Declare a deny-all egress box from the CLI and show declared and default egress by name
slice: S11
kind: task
covers: NET-075
size: M
est: 110 code, 200 tests
executor: agent
difficulty: needs care
model: strongest
diagnostics: none new; the launch record's classifier leaf already names deny
observability: none
layers:
- cli:
- crates/minimal/src/cli.rs: adds
--deny-all-egressto the one shared egress argument group, so every command that takes the egress flags takes it with one meaning; it conflicts with every--allow-*and--deny-*flag at parse- crates/minimal/src/cmd/session.rs: the flag maps to
sessions::EgressPolicy::deny_all()(every allow list present and empty); an empty value for any--allow-*or--deny-*flag stays a typed validation error and never becomes an empty list;min session policyshowsdeny-allfor a declared deny-all box, and for a box with no section shows its effective default by name (deny-allfor an own-address box under the deny-all default,allow-allfor a host-address box or under the opt-out) marked as the default, never nothing; on a host-address box the line sits beside the per-box enforcement value T73 surfacestest: cargo nextest run -p minimal deny_all_egress_flag_declares_every_allow_list_empty
test: cargo nextest run -p minimal deny_all_egress_conflicts_with_every_egress_flag
test: cargo nextest run -p minimal empty_egress_flag_value_is_a_validation_error
test: cargo nextest run -p minimal policy_shows_declared_deny_all
test: cargo nextest run -p minimal policy_shows_unset_egress_as_named_default
- classifier:
- crates/minimald/src/net/classifier.rs:
unenforceable_declaration_words(T87's NET-079 refusal) names--deny-all-egressbeside the declaration form as the deny-all remedy, so a refused host-address box is told the flag this task addstest: cargo nextest run -p minimald unenforceable_refusal_names_the_deny_all_flag
- e2e:
- scripts/session-e2e.sh: the daemon-fetch proof's host-address box is declared with
--deny-all-egress, lands in boxes/deny under the loaded table, and drives the refused-connect half the proof says today it cannot (a connection from the box to an undeclared address is refused while the daemon's fetch still completes); the comment that calls that half undrivable is removed; the proof's state directory stays short enough for a deny-all box's socket paths under the 107-byte AF_UNIX limittest: ./scripts/session-e2e.sh daemon_fetch_under_deny_all_host_address_box
produces: none
consumes: none
proof:
min session activate --network host_ip --deny-all-egresscreates a box that lands in boxes/deny on a per_box host, cannot connect to 1.1.1.1:443, and showsdeny-allinmin session policy; a box with no section shows its effective default by name; combining the flag with any other egress flag fails at parse.depends on:
- blocked by #1806
- blocked by #1917
Requirement text. This quoted text is authoritative for this task: the spec 18 amendment stays a draft (#1916) until after this run:
Mixed forms, such as no addresses but some names, are deliberately not offered. The box spec has no egress section today, so there is no file form to align with.
Proof
On this branch a person can run
min session activate --network host_ip --deny-all-egressand get a box that lands in boxes/deny on a per_box host, whose own connection to 1.1.1.1:443 is refused while the daemon's own fetch completes on the same host, and whosemin session policyreadsdeny allbesideper-box enforcement per_box; a box activated with no egress flags shows its effective default by name (allow all on a host-address box, the rollout phase's default on an own-address box) instead of nothing; and combining--deny-all-egresswith any--allow-*or--deny-*flag fails at parse with clap's ArgumentConflict naming both flags.Notes from the agent: crates/minimal/src/cmd/list.rs is outside the named layers but had to change: it constructs an ActivateArgs literal (bare_activate_args) and the struct gained deny_all_egress, so the crate would not compile without the one-line
deny_all_egress: falsethere. crates/minimal/src/tests.rs and crates/minimal/tests/cli.rs host the tests the layer's test: lines name. 'Marked as the default' was read as the name itself being the mark: the rendered line saysdeny all/allow allby name, while the strict GetSessionPolicy record keeps egress absent for an undeclared box and GetEffectiveSessionPolicy carries EffectiveEgress::{DenyAll,AllowAll,Declared}, so default and declaration stay distinguishable downstream; a separate textual marker row would have broken the pinned adjacency in policy_render_carries_the_enforcement_row_when_the_host_reported_it (T73) and policy_shows_deny_all_default (NET-075's own verify), both kept green along with the refusal-word pins across minimald's rpc.rs and session_host tests. docs/reference/cli-min.md has no row for --deny-all-egress: that file is outside this task's layers, so the flag ships documented via its clap help and the e2e proof text; the reference row is a follow-up. The e2e proof's behavioural half needs nft, passwordless sudo and a cgroup2 install thi…[truncated]Tests
cargo nextest run -p minimal deny_all_egress_flag_declares_every_allow_list_emptycargo nextest run -p minimal deny_all_egress_conflicts_with_every_egress_flagcargo nextest run -p minimal empty_egress_flag_value_is_a_validation_errorcargo nextest run -p minimal policy_shows_declared_deny_allcargo nextest run -p minimal policy_shows_unset_egress_as_named_defaultcargo nextest run -p minimald unenforceable_refusal_names_the_deny_all_flag./scripts/session-e2e.sh daemon_fetch_under_deny_all_host_address_boxVerify
min task run agent-verifyexited 101, so this PR is a draft.Out of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimal/src/cmd/list.rscrates/minimal/src/tests.rscrates/minimal/tests/cli.rsCloses #1918
Obligation recorded. The box spec has no egress file form yet. Whichever task adds one (docs/architecture.md
[network]egress_*) must define whether--deny-all-egressand the other egress flags override that section or are refused alongside it, and must never merge the two: https://github.com/gominimal/inbox/issues/882.Schema note (
min/v1/session-policy)The policy document's
egressobject changes shape in this PR. It is now{"effective": "deny-all" | "allow-all" | "rules", "source": "default" | "declared", "rules"?: <declared section>}, replacing a raw serialisation of the effective egress. The policy JSON has not shipped in a release (absent from v0.6.0), so no released consumer breaks. The first release that carries it documents this shape.