Skip to content

Isolate the enclave delegation control listener from executor networks #59268

Description

@lpcox

Summary

Make mcpg's dynamic-enclave delegation control listener unreachable from the primary agent and single-use enclave executor networks.

The controller bootstrap added by #59045 / PR #59046 publishes the control port on host loopback and documents that this prevents the enclave executor network from routing to it. That claim is incorrect when mcpg listens on 0.0.0.0 inside its container: Docker's -p 127.0.0.1:<host>:<container> limits access through the host-published port, but a peer sharing a Docker network with mcpg can address the container IP and control port directly without traversing host loopback.

The control API still requires the AWF-only 256-bit capability, so this is not an unauthenticated authorization bypass. It is a missing defense-in-depth/topology guarantee and conflicts with github/gh-aw-firewall#8195, which requires the dynamic executor to stay off the control listener.

Scope

  • Separate the delegation control transport from the mcpg data-plane transport at the container/network boundary.
  • Ensure the primary agent, enclave executor, model sidecar, and general MCP data-plane peers have no route to the control listener.
  • Preserve host-side AWF access to the control API and keep the existing capability authentication on every request.
  • Do not rely solely on -p 127.0.0.1:... publication scope when the same in-container listener is reachable through a shared bridge network.
  • Correct the inaccurate reachability comment in pkg/workflow/enclaves.go and related documentation/tests.
  • Add a topology test that attempts a TCP connection to the control port from the primary and enclave executor network namespaces and proves both fail, while an authenticated AWF host request succeeds.
  • Preserve the executor-facing mcpg data plane and its invocation-scoped bearer behavior.
  • Fail closed if the isolated control transport cannot be established; do not fall back to a shared listener reachable by executors.

Possible implementations

  • Run the control plane in a separate sidecar/network namespace reachable only through an AWF-owned Unix socket or host-private network.
  • Bind the control listener to an interface/address not attached to the executor-visible bridge while keeping the data listener on the existing mcpg container network.
  • Use a host-owned authenticated relay with no executor-visible listener.

The implementation must demonstrate network separation rather than assuming host publication rules apply to container-to-container traffic.

Acceptance criteria

  • From the enclave executor network namespace, connecting directly to mcpg's control port fails at the network layer.
  • From the primary agent network namespace, connecting to the control port also fails.
  • AWF can still perform authenticated create/status/reconcile/revoke operations.
  • Possession of an executor bearer does not provide a route or credential for the control API.
  • The control capability remains excluded from all agent environments, mounts, logs, and summaries.
  • Automated tests verify both authorization and network isolation.

Dependencies and consumers

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions