Skip to content

[MOCA SBX] Per-VM connection cap and per-session request cap (429) #1485

Closed

Description

@pdettori

Priority: P2 · Part of the Cortex × MOCA SBX epic · Not in #905's breakdown · MOCA contract: MI1 §8.5 item 2

Problem

One sandbox, whether buggy or hostile, must not be able to exhaust the shared host's egress or descriptors.

What Cortex does today

  • No per-connection or per-listener cap was found.
  • session-budget enforces budgets keyed on pctx.Session.ID (sessionbudget/plugin.go:782), which comes from client headers today. It becomes usable once issue 1 fills pctx.Session from the connection.

What MOCA needs

  • A per-VM concurrent-connection cap (MOCA_EGRESS_MAX_CONNS_PER_VM) → 429 conn_cap, decided before any request is read.
  • A hard per-session request cap (MOCA_EGRESS_MAX_REQUESTS_PER_SESSION) → 429 request_cap.

Design questions

Can session-budget carry the request cap once identity is trusted, or is the cap a listener concern? The connection cap has to be a listener concern.

Done when

Conformance cases per_vm_conn_cap_429 and per_session_request_cap_429 pass.

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions