sbx policy allow network
| Description | Allow network access to specified hosts |
|---|---|
| Usage | sbx policy allow network [-g | SANDBOX] RESOURCES [flags] |
Description
Allow sandbox network access to the specified hosts.
RESOURCES is a comma-separated list of hostnames, domains, or IP addresses. Supports exact domains (example.com), wildcard subdomains (*.example.com), and optional port suffixes (example.com:443). Use "**" to allow all hosts.
Use -g/--global to apply the rule globally to all sandboxes, or provide SANDBOX before RESOURCES to add the rule to policy "local" scoped to that sandbox.
Options
| Option | Default | Description |
|---|---|---|
-g, --global | Apply the rule globally to all sandboxes |
Global options
| Option | Default | Description |
|---|---|---|
-D, --debug | Enable debug logging |
Examples
# Allow access to a single host globally
sbx policy allow network -g api.example.com
# Allow access to multiple hosts globally
sbx policy allow network -g "api.example.com,cdn.example.com"
# Allow a host only for a specific sandbox
sbx policy allow network my-sandbox api.example.com
# Allow all subdomains of a host
sbx policy allow network -g "*.npmjs.org"
# Allow all outbound traffic globally
sbx policy allow network -g "**"