Skip to content

[MOCA SBX] Verify MOCA's sandbox grant and pass the moca-egress conformance suite #1489

Open

Description

@pdettori

Priority: final gate · Part of the Cortex × MOCA SBX epic · #905 breakdown step 5 · MOCA contract: MI1 §12.2-12.3

Problem

Cortex replaces moca-egress only when it passes the same black-box suite. This issue is the integration gate for the epic.

What it involves

  • Grant verification. A control-plane-signed Ed25519 JWS:
    • aud=moca-sandbox, with exp and sid;
    • verified on Register and Rebind;
    • MOCA distributes public keys as kid:base64-DER, not JWKS;
    • cross-language golden vectors are checked in on the MOCA side (§12.2).
  • The suite lives at remote-worker/egress/conformance (public package) with a runnable cmd/moca-egress-conformance (rossoctl/moca#583). It drives the implementation only through:
    • MOCA_EGRESS_* and MOCA_TENANCY environment variables;
    • the control socket;
    • per-VM proxy sockets;
    • named refusals (the X-Moca-Egress-Error header plus a <code>: <host> body);
    • JSON audit events on stdout.
  • The transport-slice cases today (13):
    • identity_from_connection, forged_session_header_ignored;
    • off_allowlist_named_403, private_address_403, metadata_address_403_even_if_permitted, dns_rebinding_resolved_once;
    • per_vm_conn_cap_429, per_session_request_cap_429;
    • unregister_aborts_inflight, connect_tunnel_opaque, plain_http_strips_proxy_and_moca_headers;
    • audit_query_removed, grant_refused_under_single.
  • The interception-slice cases (credential injection, 421, 502, plaintext refusal, one audit event per injection) land with MI1 slice S2.

Design questions

Run the suite in Cortex CI against a Cortex build with the MOCA profile? The suite needs Unix sockets with SCM_RIGHTS, so Linux or macOS runners only.

Done when

moca-egress-conformance passes against Cortex in CI, for both the transport-slice and the interception-slice cases.

Activity

  1. added
    enhancement
    on Oct 22, 2026
  2. huang195 commented on Nov 23, 2026

    @huang195
    Member

    Grounding review on 2026-11-23 (moca main e464dd6, Cortex main 7f3eec7). It changes what this gate needs:

    • moca's suite has 30 cases: 13 transport, 2 timeout, and 15 interception cases. The interception cases came from the sandbox service and are already in the suite (remote-worker/egress/conformance/conformance.go:80-111).
    • The runner (moca-egress-conformance -bin) starts the binary with only the case's environment: no arguments and no config file. It waits up to 10 s for the control socket. So the hostegress build must start from the environment alone (feat: Add a host-egress build and keep moca's vmcontrol driver out of every other build #2085).
    • grant_refused_under_single also requires that MOCA_TENANCY=multi fails to start (cases.go:908-921). A Cortex that serves multi fails that case as written. moca must split it before this gate can pass under multi (moca draft, not posted).
    • Cortex fails the destination_private cases today: the suite expects moca's refusal shape, and Cortex answers in JSON (cases.go:254, 297, 309, 321, Cortex forwardproxy/server.go:885). feat: Answer egress refusals in Cortex's own shape and move moca's format and MOCA_EGRESS_ALLOW into the moca driver #2086 fixes it.

    Order and details: #2042.

    Assisted-By: Claude (Anthropic AI) [email protected]

  3. huang195 commented on Nov 23, 2026

    @huang195
    Member

    Plan update (2026-11-23, #2042 revised): this gate is now the end state of a CI job, not a separate last step.

    Assisted-By: Claude (Anthropic AI) [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions