Skip to content

Harden sandbox networking and installer - #24

Merged
mkagenius merged 2 commits into
mainfrom
harden-sandbox-and-installer
Aug 12, 2026
Merged

Harden sandbox networking and installer#24
mkagenius merged 2 commits into
mainfrom
harden-sandbox-and-installer

Conversation

@abhishek-anand

Copy link
Copy Markdown
Collaborator

Summary

  • pin Apple container 1.2.2 and update the 1.x DNS configuration path
  • add a host-only network mode with fail-closed resume checks
  • bind Jupyter and Playwright to loopback and validate REST Host/Origin headers
  • block skill path traversal and unsafe ZIP extraction
  • install the Claude Desktop proxy in a pinned virtualenv and add readiness checks

Testing

  • default network: 10 end-to-end checks passed
  • host-only network: 11 end-to-end checks passed, including root container exec egress denial
  • installer default/offline resume paths and network-mode mismatch behavior verified on macOS 26.5.1 with Apple container 1.2.2

Copilot AI lite review requested due to automatic review settings August 11, 2026 23:48
@cursor

cursor Bot commented Aug 11, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens the CodeRunner sandbox by tightening network exposure, adding Host/Origin validation for REST routes, and improving installer behavior for offline/host-only operation while pinning key dependencies.

Changes:

  • Add a host-only/offline network mode in the installer with resume-time network-mode checks and readiness probing via a new /health endpoint.
  • Bind internal services (Jupyter, Playwright) to loopback and add Host/Origin allowlisting middleware for non-MCP REST routes.
  • Harden skill handling by blocking path traversal and adding ZIP extraction safety checks; pin fastmcp in examples and the proxy venv.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test-e2e.sh Adds E2E smoke tests covering new security/network behaviors and skill traversal protections.
server.py Adds extra allowed hostnames, skill ZIP/path traversal hardening, /health, and REST Host/Origin validation middleware.
README.md Documents offline/host-only network mode and clarifies proxy venv usage.
install.sh Pins Apple container to 1.2.2, updates DNS config path behavior, adds network-mode logic and readiness checks, and creates a pinned proxy venv.
examples/requirements.txt Pins fastmcp version for reproducibility.
examples/claude_desktop/mcpproxy.py Improves failure messaging and exits when DNS resolution fails.
entrypoint.sh Restricts Jupyter/Playwright to loopback and removes permissive Jupyter settings.
docker-compose.yml Updates healthcheck to use the new /health endpoint.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread server.py
Comment thread server.py
Comment thread install.sh
Comment thread test-e2e.sh
macOS ships bash 3.2, where expanding an empty array under 'set -u' is a
fatal 'unbound variable' error. NETWORK_ARGS is empty in the default
network mode, so install.sh aborted before starting the container.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
mkagenius added a commit that referenced this pull request Aug 12, 2026
macOS ships bash 3.2, where expanding an empty array under 'set -u' is a
fatal 'unbound variable' error. MOUNT_SPECS, NORMALIZED_MOUNTS and
VOLUME_ARGS are all empty when no --mount is passed, which breaks once
this branch is combined with the 'set -u' added in #24.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@mkagenius mkagenius left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on my mac via copilot .. set -u is not supported i guess, fixed it.

@mkagenius
mkagenius merged commit aa1a805 into main Aug 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants