ufw or iptables. For the full security picture, read Security and isolation.
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
runneraccount can still reach services in the sandbox onlocalhost. - Insert the rules at the top (
-I OUTPUT 1). Rules added at the end come after boat’s ownufwrules, which accept new connections. - Do not give
runnersudo. 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 iterror, if it answers on any route. Instead:
- The sandbox shows
"health": "degraded"with a reason. - boat sends a
sandbox.degradedwebhook.
sandbox.recovered.