Default firewall
Every workspace has a built-indefault firewall with two ingress rules:
- Allow SSH (TCP port 22) from anywhere
- Allow ICMP (ping) from anywhere
default firewall is auto-managed: it cannot be modified or deleted.
Firewall rules control traffic between instances and the public internet. Instances in the same
subnet communicate freely on all ports. Instances in different subnets are isolated and cannot
communicate.
Firewalls only apply to instances with a public IP (created with --public-ipv4). When creating an
instance with a public IP, you may specify a firewall. If unspecified, the default firewall will
be assigned. Firewalls cannot be attached to an instance without a public IP.
Password authentication is disabled on all SFC base images, so open SSH is safe by default. Only key holders can connect.
Creating a firewall
Create a firewall from a TOML file that defines the rules.API
Rule format
Each rule specifies a direction, protocol, port (or port range), and source CIDR. Onlyingress
rules are supported. The protocol is tcp, udp, or icmp; ICMP rules take no port.
10.0.0.0/8, 192.168.0.0/16) are rejected; the wildcard 0.0.0.0/0 (allow from anywhere) is the
only exception.
Restricting access
Restrict SSH to a specific network.Port ranges
Allow a range of ports.Attaching a firewall to an instance
Specify the firewall when creating an instance.Changing the firewall on an instance
Swap the attached firewall on an existing instance. The instance must have been created with--public-ipv4. The new rules take effect without a reboot.
Listing firewalls
Getting firewall details
--toml to output the rule set as TOML, which round-trips with sf firewall set:
Updating a firewall
Replace a firewall’s rule set from a TOML file. The replacement is atomic.API
PUT /v2/firewalls/{id} replaces the full rule set.
Deleting a firewall
Limits
- 100 rules per firewall
- 100 firewalls per workspace, including the built-in
default