- block all outbound traffic
- allow only specific public domains
- restrict egress to specific CIDR ranges
Modes
The SDK type is:
Create a box with a policy
PassnetworkPolicy when creating a box:
networkPolicy is also supported in Box.fromSnapshot() and EphemeralBox.
Read the current policy
Use thenetworkPolicy getter:
Update a running box
Update the policy after creation:Matching rules
allowedDomainssupports exact matches such asapi.github.com- wildcard domains must use
*.suffixform, for example*.githubusercontent.com allowedCidrsanddeniedCidrsuse standard CIDR notation- in
custommode,deniedCidrstakes precedence over allowed CIDRs - private IP ranges are always blocked even if you try to allow them explicitly