microsoft / microsoft/mxc

[SDK] Node SDK rejects network.proxy on LXC, which the backend has supported since #798

Open
#1,074 1 comment 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

Area-SDK-Api Issue-Bug OS-Linux Priority2
Dominant language
Rust
Stars
1.3k
Forks
79
Avg merge
2d 7h
Merged PRs (30d)
117

Description

### Relevant area(s)

Linux

### Brief description of your issue

The Node SDK rejects `network.proxy` on Linux for `containment: 'lxc'`, but LXC has supported it since #798 (iptables deny-all-except-proxy + `HTTP_PROXY` injection + `/etc/hosts` pin). The SDK gate predates that work and was never revisited, so LXC callers can't use a proxy from the SDK at all.

Gate: `sdk/node/src/sandbox.ts:350-358` allows only `bubblewrap` and `process`.
Native: `src/core/wxc_common/src/config_parser.rs:962-972` accepts `lxc`.

Two things need deciding together, since lifting the gate alone isn't enough:

1. LXC additionally requires `network.enforcementMode: 'firewall'` or `'both'` with a proxy (`config_parser.rs:1123-1137`) — native rejects `capabilities` rather than auto-promoting.
2. `SandboxPolicy.network` (`sdk/node/src/types.ts:428-445`) exposes no `enforcementMode`, so there is no way for a caller to supply it. Either the SDK promotes an unset mode to `firewall` for LXC, or `SandboxPolicy` gains the field.

The JSDoc on `SandboxPolicy.network.proxy` (`types.ts:437`) also lists only "Windows ProcessContainer, Linux Bubblewrap, and macOS Seatbelt" and needs updating either way.

### Steps to reproduce

1. On Linux, call `createConfigFromPolicy({ version: '0.6.0-alpha', network: { proxy: { url: 'http://proxy.example:8080' } } }, 'lxc')`.
2. Observe the throw.

### Expected behavior

The config is produced (with whatever `enforcementMode` the chosen fix implies), and the same policy runs on LXC with the proxy enforced.

### Actual behavior

Throws `Proxy configuration is not supported on Linux containment='lxc'. Use containment 'bubblewrap' (or the abstract 'process') for proxy-based host filtering.` - even though the executor would have accepted it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.