Policy Fields
boolean
default:true
Controls outbound internet access for destinations not covered by
allowOut or denyOut. Set it to false for a default-deny policy.string[]
Outbound destinations to allow. Entries can be IPv4 addresses, IPv4 CIDR
ranges, exact domains, or wildcard domains such as
*.example.com.string[]
Outbound destinations to deny. Entries can be IPv4 addresses or IPv4 CIDR
ranges. Domain entries are not supported in
denyOut.Rule Precedence
WhenallowOut and denyOut both match the same destination, allowOut takes
precedence.
For example:
203.0.113.10is allowed because it matches both rules andallowOutwins.- Other addresses in
203.0.113.0/24are blocked. - Destinations outside that range are allowed because
allowInternetAccessistrue.
IPv4 addresses are normalized to
/32 CIDRs, CIDRs are normalized to their
network address, domains are lowercased, and duplicate entries are removed.
IPv4 and CIDR rules match the destination across all ports and protocols.
IPv6 policy targets are not currently supported.Create With a Network Policy
The following policy blocks outbound internet access except for the exact domainapi.github.com and the IPv4 address 1.1.1.1.
allowInternetAccess as true and add IPv4 or CIDR entries to denyOut.
Update a Running Sandbox
Update the policy without restarting the sandbox:- Omitted fields keep their current values.
- A supplied
allowOutordenyOutarray replaces that entire list. - Supply an empty array to clear one list.
hx vm network set.
Clear a Network Policy
Restore the default outbound policy and remove all allow and deny entries.network field.
Domain Rules
Domain entries are supported only inallowOut, and a policy containing one
must have a default-deny boundary. Set allowInternetAccess to false or add
0.0.0.0/0 to denyOut.
example.commatches onlyexample.com, not its subdomains.*.example.commatches subdomains such asapi.example.com, but not the apexexample.com. Add both entries when you need both forms.- Domain rules apply to HTTP on port
80and HTTPS on port443. HTTPS matching uses the TLS server name. For other ports or protocols, allow the destination with an IPv4 or CIDR entry. - While domain rules are active, DNS permits
A,AAAA,SVCB, andHTTPSlookups for allowed names and refuses lookups for other names. - Domain-based connections reject hostnames that resolve to loopback, private, carrier-grade NAT, or link-local addresses.
Domain rules require the application to send a hostname in the HTTP
Host
header or HTTPS TLS server name. Connections that do not expose a matching
hostname need an IPv4 or CIDR allow entry.