feat(msb): neutral ACQ_NETWORK_TIER egress selector + deprecate ACQ_MSB_BALANCED_EGRESS - #310
Open
wz-gsa wants to merge 2 commits into
Open
feat(msb): neutral ACQ_NETWORK_TIER egress selector + deprecate ACQ_MSB_BALANCED_EGRESS#310wz-gsa wants to merge 2 commits into
wz-gsa wants to merge 2 commits into
Conversation
… -u)
acq secret set -g <builtin-service> aborted on macOS bash 3.2 with
`builtin_scope_args[@]: unbound variable`. For the global scope the array
stays empty (no --sandbox), and `"${arr[@]}"` on an empty array is fatal
under set -u on bash 3.2 (the macOS system bash). The failure hit AFTER the
value was written to the acq store but BEFORE it reached sbx, leaving the
sbx-side secret unset while acq reported success. Guard the expansion with
the ${arr[@]+"${arr[@]}"} idiom (bash 4+ on Linux CI never errored, so CI
stayed green — this only bit macOS users).
Fixes #308
AI-assisted (OpenCode).
…B_BALANCED_EGRESS
Adds the neutral network-egress tier selector ACQ_NETWORK_TIER
(strict|balanced|open, default balanced) to the msb adapter, implementing the
agentic-coding-patterns network-tiers contract (its ADR-0002) for msb. Each
tier maps to msb's native egress primitive at provision time; all tiers are
deny-by-default except open:
- strict -> --net-default-egress deny + gateway DNS + the kits' own
caps.network.allow hosts ONLY (no curated baseline). Recommended
for GFE / high-assurance.
- balanced -> deny-default + the curated sbx-"balanced" baseline (ADR-0018)
unioned with the kit hosts. The default.
- open -> no deny-default (unrestricted egress). Testing only, never GFE;
refused unless ACQ_NETWORK_TIER_CONFIRM_OPEN=1 (fail-closed).
ACQ_MSB_BALANCED_EGRESS becomes a deprecated alias, mapped fail-safe (tighter,
never looser): 1/on -> balanced; 0/off/empty -> strict (deny-by-default with
kit hosts only, NOT the former permissive no-deny-default behavior — an upgrade
never silently loosens egress). ACQ_NETWORK_TIER wins when both are set; a
one-time deprecation notice points at the neutral selector. Invalid tier values
fail closed to balanced.
The curated baseline emitter _acq_msb_balanced_rules_into is unchanged; only the
caller in acq_backend_provision branches three ways. Driving sbx policy from the
tier is documented but deferred to a follow-up (this PR maps + documents only).
Tests: 10 new test-acq cases (alias mapping, one-time notice, tier precedence,
explicit strict/balanced, open fail-closed + confirmed, invalid->balanced,
mixed-case). Updated 8n4 and verify-net-default-egress to the tier vocabulary.
Docs: BACKEND_GUIDE tiers section + env-var table; ADR-0018/0019/0020 banners.
Refs #294
AI-assisted (OpenCode).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR1 of the network-tiers epic (#294). Bret pre-approved this design ("Go for it") on the issue; it went through 7/7 higher-order consensus twice (alias mapping + 3-tier caller) and a 7/7 pre-open review.
What
Adds the neutral egress selector
ACQ_NETWORK_TIER(strict|balanced|open, defaultbalanced) to the msb adapter, implementing the agentic-coding-patterns network-tiers contract (its ADR-0002) for the msb backend. Each tier maps to msb's native egress primitive at provision time; all tiers are deny-by-default exceptopen:strict--net-default-egress deny+ gateway DNS + the kits' owncaps.network.allowhosts ONLY (no curated baseline). GFE / high-assurance.balanced(default)balancedbaseline (ADR-0018) unioned with the kit hosts.openACQ_NETWORK_TIER_CONFIRM_OPEN=1(fail-closed).ACQ_MSB_BALANCED_EGRESSbecomes a deprecated alias, mapped fail-safe (tighter, never looser):1/on →balanced;0/off/empty →strict(deny-by-default with kit hosts only — NOT the former permissive no-deny-default behavior; an upgrade never silently loosens egress).ACQ_NETWORK_TIERwins when both are set; a one-time deprecation notice points at the neutral selector. Invalid tier values fail closed tobalanced.Design notes
_acq_msb_balanced_rules_intois unchanged; only the caller inacq_backend_provisionbranches three ways (per the approved design — "translate, don't rename").opengate is validated inacq_backend_provision(not at module load), so a stale env var never aborts an unrelatedacqinvocation — only an actual provision.sbx policyfrom the tier is documented but deferred to a follow-up (PR maps + documents the sbx mapping only). Renaming the msb emitter/ACQ_MSB_BALANCED_EGRESSinternals is PR2, coordinated with @mogul.Testing
test-acqcases (10b1j..10b1j10): alias=0→strict, one-time notice,=1→balanced, tier-wins-over-alias, explicit strict, explicit balanced, open-no-confirm fails closed (rc!=0) + names the confirm token, open-confirmed emits no deny-default + warns UNRESTRICTED, invalid→balanced, mixed-case lowercasing. Updated8n4andscripts/verify-net-default-egressto the tier vocabulary (onlyopenis now vacuous for the live egress check).scripts/test-acq: 868 passed / 0 failed on macOS bash 3.2 (with fix(sbx): make global secret-set bash-3.2-safe (empty-array under set -u) #309's fix in the base).shellcheck --severity=warningclean per-file;markdownlint-cli2clean.Docs
docs/BACKEND_GUIDE.md: new "Network egress tiers (ACQ_NETWORK_TIER)" section + tier table + env-var rows (incl. the deprecated alias and the confirm token).=0now maps tostrict.Refs #294
AI-assisted (OpenCode).