Skip to content

fix(apps): require network egress protection by default for hosted containers - #393

Open
ralyodio wants to merge 4 commits into
masterfrom
fix/apps-default-egress-guard
Open

ralyodio wants to merge 4 commits into
masterfrom
fix/apps-default-egress-guard

Conversation

@ralyodio

Copy link
Copy Markdown
Collaborator

Distributed container hosting: default-deny unguarded egress

c0mpute already has distributed container hosting with c0mpute apps (DIP-0031, docs/apps.md): signed app records, Docker images, three-replica placement, primary/standby failover, snapshots, custom domains, CLI, and MCP tools. This PR hardens an existing default that makes those capabilities risky on unprivileged Docker workers.

Problem

[apps] require_egress_guard currently defaults to false. If the iptables-based egress guard cannot be installed, the container can run on Docker's default bridge and potentially reach the node host, LAN and cloud metadata endpoints. The documentation explicitly acknowledges this exposure.

Change

  • Default require_egress_guard = true. Existing Apps::start already refuses to run on an unprotected non-root host, and runtime::network_for errors rather than selecting Docker's default bridge when required.
  • The egress_guard default remains true.
  • Existing explicit require_egress_guard = false configurations remain opt-outs (with security consequences).
  • Add serialization/default regression tests for omitted settings, guarded default, and explicit opt-out.
  • Document the default and warn about IPv6 limitations and the fact that app operators can access running memory/secrets.

Test

cargo test -p c0mpute-core --locked and full workspace Rust/security CI.

Operator notice / availability change

This is a security-sensitive behavior change: non-root hosts without an installed guard may no longer run containers, reducing capacity. Operators must provision protected nodes rather than silently weakening isolation. The guard remains IPv4-only; comprehensive IPv6, tenant isolation, adversarial failover and production container-hardening tests remain open.

Scope

This hardens existing hosting; it does not launch a new hosting marketplace, establish production multi-host failover, or complete the Scallion VPN. Do not merge if tests fail. Tracks distributed hosting readiness and Scallion issue #386.

@github-actions

Copy link
Copy Markdown

ThreatCrush Security Scan

14 finding(s)

HIGH/CRITICAL: 2 | MEDIUM: 8 | LOW: 4

Severity Rule Location
HIGH js-ssrf-outbound-request apps/web/public/sw.js:24
HIGH sh-remote-script-execution scripts/install.sh:611
MEDIUM js-unescaped-html-sink apps/web/src/app/blog/[slug]/page.tsx:53
MEDIUM js-unescaped-html-sink apps/web/src/app/layout.tsx:109
MEDIUM sql-template-interpolation apps/web/src/lib/chat/convo-store.ts:116
MEDIUM sql-template-interpolation apps/web/src/lib/chat/convo-store.ts:117
MEDIUM sql-template-interpolation apps/web/src/lib/chat/push.ts:476
MEDIUM js-dynamic-code-execution apps/web/src/lib/router/verify.ts:91
MEDIUM sh-remote-script-execution scripts/dev-setup.sh:25
MEDIUM sh-eval-expansion scripts/dev-setup.sh:35
LOW py-ssrf-outbound-request examples/business-strategist-agent/chat.py:37
LOW py-ssrf-outbound-request examples/business-strategist-agent/train.py:54
LOW secret-generic-credential node/crates/c0mpute-core/src/webhook.rs:1171
LOW py-path-traversal node/crates/c0mpute-core/tests/fixtures/fake-infernet-text:29

Snippets are redacted; ThreatCrush never prints matched credential material.

This branch has not been deployed

No deployments
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.

1 participant