Skip to main content
boat has no API setting for network rules. You have root in the sandbox, so you add rules with ufw or iptables. For the full security picture, read Security and isolation.
Snapshots do not keep firewall rules. Apply your rules again after each resume and fork. For example, run them from your setup script or from a systemd service.

What boat needs

boat reaches the sandbox in two ways. A rule that blocks either one marks the sandbox degraded. Linux tags a tunnel packet with the process that sent the data inside it. So a rule on the user account also blocks the tunnel. Do not block all outbound traffic for user.

Block outbound internet for untrusted code

Run the untrusted code as a separate Linux account. Block that account only. boat keeps working.
  • The runner account can still reach services in the sandbox on localhost.
  • Insert the rules at the top (-I OUTPUT 1). Rules added at the end come after boat’s own ufw rules, which accept new connections.
  • Do not give runner sudo. With root, it can delete the rules.

Block outgoing UDP for user

To block outgoing UDP for user and keep boat working, allow the tunnel endpoint first.

Open an inbound port

The firewall refuses inbound connections by default. host <port> opens what a public URL needs. For a raw port, read Raw TCP or UDP ports.

What happens to a blocked sandbox

boat never stops a sandbox for this, or marks it error, if it answers on any route. Instead:
  • The sandbox shows "health": "degraded" with a reason.
  • boat sends a sandbox.degraded webhook.
Remove the rule. The sandbox becomes healthy again, and boat sends sandbox.recovered.