Skip to content

[Brev shadecloud][Onboard] preflight should optionally auto-apply UFW rule for sandbox→gateway under --yes #4265

@cjagwani

Description

@cjagwani

Description

On Brev shadecloud Ubuntu 22.04, UFW ships with INPUT policy DROP. The OpenShell gateway compatibility container binds to 0.0.0.0:8080, and sandbox containers (on the docker bridge, 172.18.0.0/16) must reach it at 172.18.0.1:8080. Out of the box, that traffic hits the default-deny INPUT chain and is dropped.

NemoClaw's onboard preflight correctly detects this and prints an actionable hint:

✗ Sandbox containers cannot reach the gateway at host.openshell.internal:8080 (172.18.0.1:8080).
  A host firewall may be blocking traffic from the OpenShell Docker bridge.
  To allow it:
    sudo ufw allow from 172.18.0.0/16 to 172.18.0.1 port 8080 proto tcp
  Then re-run `nemoclaw onboard`.

The rule itself is narrow and safe (docker-bridge → host gateway port only). On --yes / --non-interactive, onboard could just apply it, avoiding a manual re-run.

Proposed Behaviour

  • Interactive: prompt "Apply the suggested ufw rule and continue? [Y/n]", then apply on consent.
  • --non-interactive + --yes-i-accept-third-party-software (or a more specific --yes-firewall-changes opt-in): apply automatically without prompting, exit cleanly without forcing a manual re-run.
  • Without consent: keep the current behaviour (print the rule, exit, ask user to re-run).

Why

Notes

  • The rule is environment-bound (172.18.0.0/16 is the docker bridge subnet; could be derived programmatically rather than hard-coded).
  • If ufw is inactive or absent, the auto-apply path should no-op silently.
  • Consider also generalising for iptables or firewalld users — same idea, different syntax.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: sandboxOpenShell sandbox lifecycle, runtime, config, or recoveryplatform: brevAffects Brev hosted development environmentsplatform: ubuntuAffects Ubuntu Linux environments
    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions