exec, files, the terminal, the desktop, and
published ports into the machine work as before.
Block all outbound connections
Pass--block-outbound when a machine needs no internet access. The machine then connects to
nothing, and no name resolves in it.
apt or npm, fails under this
policy. Install what you need first, save a snapshot, and create the sealed
machine from that snapshot.
Allow only listed domains
Pass--allow-domain once for each name. The machine then connects only to those names, over any
protocol and port, so HTTPS and git clone git@github.com:... over SSH both work.
Quote a name with
* so that your shell does not expand it. A name that you did not list does not
resolve in the machine, so a program gets “could not resolve host” at once and does not wait for a
timeout.
Allow address ranges
Pass--allow-cidr for a destination that you know by address, such as a database with a fixed IP.
You can combine ranges with domains.
Change the policy on a running machine
instabox network shows a machine’s policy, and with a flag it replaces the policy as a whole.
--open-outbound.
Keep the policy across pause, stop, and fork
A machine keeps its policy when you pause and resume it, and when you stop and start it. A fork starts with its source’s policy. To give the forks their own policy, pass the same flags toinstabox fork.
create.
Set a policy with the API
SendnetworkPolicy when you create a machine. outbound: "restricted" with both lists empty blocks
everything.
PATCH /v1/machines/{id} with networkPolicy replaces the policy, and outbound: "open" removes
it. A machine without a policy has no networkPolicy field. The fields are in the
API reference.
How a domain allowlist works
Every machine resolves names through InstaBox’s resolver. Under a policy, the resolver answers only the names that you listed. When it answers one, it opens the machine’s firewall for the addresses in the answer, for as long as the DNS record is valid (at least 60 seconds, at most 1 hour) and 30 seconds more. Every other address stays closed. This works for any protocol, because the rule is on the address and not on the port. It also means that the policy follows a name when its addresses change.What a domain allowlist does not guarantee
- Shared addresses. Many sites share one address behind a CDN or a cloud load balancer. While an allowed name’s address is open, the machine can reach every other site on that address too. InstaBox does not check the name inside the TLS handshake (SNI).
- An address stays allowed until its entry expires. After a name’s DNS record changes, the old address stays reachable until the entry for it runs out, at most 1 hour and 30 seconds later.
- An allowed service can relay anything. If you allow
github.com, the machine can push to any repository there. - Only InstaBox’s resolver opens the firewall. A program must look names up with ordinary DNS, which InstaBox answers. A program that uses DNS over HTTPS or DNS over TLS gets no answer that opens the firewall, so its connections are refused.
- Everything inside a listed range is reachable, under any name.
Limits
How many domains and ranges
How many domains and ranges
A policy takes up to 100 domains and up to 50 address ranges. A machine can have up to 4096
resolved IPv4 addresses and 4096 resolved IPv6 addresses open at one time. When that set is full,
a new name does not resolve until older entries expire.
Names and ranges that are refused
Names and ranges that are refused
- A domain is a name of at least two labels, such as
example.com, in lower case. A scheme, a port, a path, or an IP address in--allow-domainis refused. - A range cannot be the whole address space (
0.0.0.0/0). To allow everything, remove the policy. - A range inside private, loopback, link-local, or reserved space, such as
10.0.0.0/8, is refused. A machine cannot reach those addresses with or without a policy. - A range with bits set beyond its length, such as
140.82.112.9/20, is refused, and the error names the range that you probably meant.
Which machines can have a policy
Which machines can have a policy
Linux machines on every plan. A macOS, Windows, or GPU machine is refused with
400, and nothing
is created or changed.A policy is set for one machine. There is no default for a workspace or a template.What still applies under a policy
What still applies under a policy
A policy only narrows what a machine can reach. A destination that InstaBox blocks for every
machine stays blocked when your policy lists it. The connection and bandwidth limits on
Limits apply to allowed traffic.With Org Secrets, the outbound proxy adds credentials only to connections
that the policy allows.
Errors
Errors
400 bad_request: a name or a range is not valid. The message names it.409 operation_conflict: the machine has an operation in progress. Change the policy when it is done.503 host_unavailable: the machine’s host did not take the policy. The earlier policy stays in force. Try again.
Org Secrets
Keep API keys out of the machine and add them to allowed requests.
CLI reference
Every flag of
instabox network.