allow_internet_access and network, and replace
them later on a running sandbox. The rules are enforced outside the sandbox, so nothing inside it can change them.
Rules on create
A bare address means that one address. A host name needs at least two labels (
api.example.com). Any other field, or a
misspelled network field, answers 400 that names it, so a rule is never dropped in silence.
How the rules combine
- The more specific rule wins, and an allow wins a tie.
denyOut: ["10.1.0.0/16"]withallowOut: ["10.0.0.0/8"]keeps10.1.0.0/16closed and the rest of10.0.0.0/8open. The same entry in both lists is allowed. - Allowlist.
denyOut: ["0.0.0.0/0"]withallowOuthost names reaches those hosts and nothing else over IPv4, and the sandbox can still resolve names. IPv6 stays open when only0.0.0.0/0is denied; add::/0to close it too.allow_internet_access: falsewithallowOutgives the same allowlist and closes IPv6 as well. - With internet on (the default), the sandbox reaches everything that
denyOutdoes not close. - With internet off, the sandbox reaches only what
allowOutlists. - Host names stand for the addresses they resolve to. The node resolves each name through its own resolver and renews the
addresses when the answer’s time to live runs out, so a name that moves to a new address follows. Another name that shares one of
those addresses is reachable too. With internet off, the sandbox reaches a resolver only when
allowOutlists a host name, so a sandbox with no names has no DNS. - Mail ports (25, 465, 587), common mining ports, the node’s own management addresses and the addresses of other sandboxes are closed for every sandbox, whatever the rules say.
Create a sandbox with rules
create:
Change the rules of a running sandbox
204. The call replaces allowOut, denyOut and allowInternetAccess together: a field you leave out goes back to
its default (nothing listed, internet on). The lists may sit at the top of the body or inside a network object as on create; when
both are given they must be the same list. Other fields, such as dnsServers, answer 400. The new rules apply to the running
sandbox at once. A sandbox that is paused deeply must be resumed first (see pause tiers).
Related
- Ports and preview URLs for
allowPublicTraffic. - AI credentials proxy for model keys that never enter the sandbox.