Repository navigation
Open
Milestone
Description
Follow-ups deferred during the SBX0.2b user-scoped egress credentials work (#624 spec, #627, #630, #641, #646). The full ledger is in the rulings comment on #646: #646 (comment)
Test gaps that hide real checks (do first)
-
deploy/sbx/tests/smoke.test.sh:LOGS_KEPTis undefined, so the "PAT never in logs" assertion never runs. Also has a no-op|| trueassertion. (Test: revive two step-7 assertions in the sbx smoke that could not fail #655) - smoke step 7:
drop_branchreports success on a 404; a failedaddtriggers a spuriousdelete; the fixed credential namesmoke-ghcan collide between concurrent runs.
Spec / audit
- Spec §8/§11: say that an upstream
Set-Cookieminted from the injected token reaches the guest (a derived credential). This is inherent to any endpoint that derives a credential from the token. - Control plane: no audit line for the 500 outcomes (
credential_unsafe,destination_ambiguous) or a mid-flight delete. Only issued and none are logged today. - moca-egress:
leaf_unavailableis audited with status 502 although no HTTP response is sent. This is documented in doc.go; decide whether to keep it.
Deploy
- setup.sh: stale host tokens for hosts dropped while the feature is off persist until the next on-run.
- install-host.sh: CA manifest lines persist after
--uninstall-egress(re-logged "kept");wait_egress_readychecks only that the socket exists; credential paths are removed without a directory check; no re-run test with a new token. - install-host.sh: a mktemp leak on install failure;
remove_egressdrops unknownegress <kind>manifest lines. - build-snapshot.sh: the openssl-missing message is misleading.
Proxy
- CPCredentials: cache expiry is measured from fetch end, not request start, so an entry can live up to ~timeout longer than the server TTL.
MOCA_EGRESS_CREDENTIALS_URLaccepts userinfo, query and path. Eviction does a full scan under the mutex. - Interceptor:
refuse()'s drain write deadline is overridden by the idle touch. - Conformance:
redactEventis shallow; no assertion thatsubis absent on non-injection events.
Coverage
- control-plane: egress-config cases (non-numeric TTL, uppercase-hex token, multi-entry KEK ring); a test that the consumer-refusal message text matches; the vault-store array-binding round trip.
- mocactl:
add --jsonshape,--host a,bsplitting, non-preset basicfield=valuestdin.
Open (not deferred minors)
- Live acceptance item 3: a second user's sandbox gets a 401 on the first user's private repo and a public clone works. Not run yet; needs a second enrolled user.
- Vault-backed credential store (phase-1 follow-up to the file store).
Assisted-By: Claude Code
Metadata
Metadata
Assignees
Labels
No labels
Activity
test(sbx): revive two step-7 assertions that could not fail
fix(sbx): confirm step 7's cleanup instead of believing it
fix(egress): count a cached credential's TTL from the lookup's start
fix(egress): bound an intercepted refusal by drainTimeout, not the id…
test(conformance): redact nested audit values and check sub on every …
fix(build-snapshot): say openssl is missing instead of blaming the --…
feat(control-plane): audit an egress lookup's 500 refusals
fix(install-host): remove install_egress's temp file on every failure
fix(install-host): remove only this script's credential files
test(install-host): an --egress re-run with a new token replaces the …
test(control-plane): cover the egress settings' edge cases and the co…
test(mocactl): cover credentials add's --json, --host splitting and f…
fix(install-host): an empty credential name is kept and named, not lo…
evaline-ju commentedon Nov 18, 2026
Status after #655, #669 and #870 (checked on main):
Done: smoke step 7 (#669); the Set-Cookie note (spec, and accepted risk in
security-review.md); audit of the 500s (#870) and mid-flight delete; theinstall-host.shmktemp leak and unknown manifest lines; thebuild-snapshot.shopenssl message; the interceptor drain deadline;redactEventand thesubcheck; control-plane and mocactl coverage.Partly done: CPCredentials (expiry and URL rules done; the full scan on eviction remains, a design change);
install-host.sh(directory check and re-run test done).Need a decision:
leaf_unavailableaudited as 502;setup.shstale tokens while off (kept by design); the CA's manifest lines after uninstall (kept on purpose);wait_egress_readyonly checking the socket; and, new from #870,subon anupstream_unreachablerefusal that carried a token.Open: live acceptance item 3 (needs a second user). The Vault-backed store is on main (
vault-store.ts); standing Vault up is #823.Proposing to tick the done boxes.
evaline-ju commentedon Nov 19, 2026
CPCredentials eviction scan: proposing to keep it. It runs only when the cache is full and a
new key comes in, so at most once per control-plane call. Full means
maxCacheEntries= 4096,the cache's size limit; the scan's worst case grows with it.
Measured with a Go benchmark of
insertLockedalone, from a test file inremote-worker/internal/egress(cpcreds.goas of 94e6df5, unchanged on main), on anApple M1 Max with go1.26.0 (
go test ./internal/egress -run '^$' -bench BenchmarkTmp -benchtime 2s). One goroutine, no lock contention:The worst case needs 4096 distinct (sandbox, host) lookups within their TTL (60 s for "no
credential"). One way a guest gets there is a wildcard allowlist and a stream of new
subdomains. In that case each miss is also a control-plane call, which costs more than the
scan and which a heap would not change.
Benchmark
evaline-ju commentedon Nov 23, 2026
@pdettori here's the state of #653 and what needs your sign-off:
Decided and merged:
leaf_unavailableis now audited as 503, not 502 (#991). The upstream is already verified and the CONNECT answered 200 when the mint fails, so the refusal is the proxy's own. The contract text was corrected and a test added.Please confirm:
CPCredentialseviction scan. It runs at most once per control-plane call, costs about 93 µs in the worst case (benchmark above), and is cheaper than the control-plane call that triggers it.vault-store.ts), and standing Vault up is tracked there.If you agree, I'll tick the boxes and close this issue.
Assisted-By: Claude Code