--- title: "Firewall Groups" description: "Build reusable firewall groups at the project level and attach them to machines, with the default policies and lock-out risks explained." category: "Deployment" language: en source: https://cubepath.com/docs/products/deployment/firewall-groups updated: 2026-11-17 --- # Firewall Groups Create and manage firewall groups from the **Firewall Groups** page in [my.cubepath.com](https://my.cubepath.com). A group is a reusable set of inbound and outbound rules you attach to one or more Virtual Machines or Bare Metal (dedicated) servers. Groups live at the **project level**, so any machine in the project can use one. Write the rules once, apply them everywhere, and edit them in one place when something changes. That's the whole point compared with configuring iptables on each box. ## Create a group ```steps ### Open the create flow On the **Firewall Groups** page, click **+ Firewall Group** and give it a name. ### Add rules Each rule sets a **direction** (incoming/outgoing), **protocol** (TCP/UDP/ICMP/GRE), **port(s)** and a **source/destination** IP range in CIDR notation, such as `203.0.113.0/24` (empty = any). ![Create Firewall Group dialog with two incoming rules](https://cdn.cubepath.com/img/docs/products/b1922481-a02e-4c41-a7db-3b2d461eca2b.png) ### Save Review the rules and save the group. ``` Ports accept a single value (`443`), a list, or a range (`8000-9000`). ## Default policies The defaults are the part that matters, and they are not symmetric: - **Incoming: DROP.** Anything you don't explicitly allow is blocked. With no incoming rules at all, *all* inbound traffic is blocked. - **Outgoing: ACCEPT.** Anything you don't explicitly restrict is allowed. So the practical work is one incoming rule per service you expose: TCP 22 for SSH, TCP 80 and 443 for a website, and so on. > Warning: Always include an inbound rule for SSH (TCP 22) or RDP (TCP 3389) before applying a group, or you'll lock yourself out. If it happens on a VPS, the machine's browser console still works because it doesn't go through the firewall. On a Bare Metal server, remove the groups or add the missing rule from the dashboard. ## Attach it to machines Open a machine's Firewall tab ([VPS](/docs/products/deployment/vps-firewall) or Bare Metal), click **Groups**, tick the group and click **Apply changes**. Rules take effect live, with no reboot. Click a group on the **Firewall Groups** page to see its rules. The group shows how many machines are using it, so you know what an edit will affect before you make it. Changing a rule affects **every** attached machine at once, VPS and Bare Metal alike. > Note: A group in use by any server, VPS or Bare Metal, can't be deleted. Unassign it everywhere first. ## Bare Metal servers Bare Metal servers use the same firewall groups as VPS. Assign them from the server's **Firewall** tab in the dashboard (`/baremetal/{id}/firewall`), exactly as you would on a VPS, or through the API: ```bash curl -X PUT https://api.cubepath.com/firewall/baremetal/{id}/groups \ -H "Authorization: Bearer $CUBEPATH_TOKEN" \ -H "X-Requested-With: XMLHttpRequest" \ -H "Content-Type: application/json" \ -d '{"firewall_group_ids": [12, 34]}' ``` A `GET` on the same path returns the groups assigned to the server and the status of the last sync. How it differs from a VPS: - **Enforced on the network, not on the server.** Rules are applied on the network switch in front of the server, so filtering uses none of the server's CPU or RAM, you don't need UFW or iptables, and it survives OS reinstalls. Changes take effect within seconds. - **Inbound only.** Only incoming rules apply; outbound traffic is not filtered. Inbound traffic to the server's public IPv4 and IPv6 addresses is denied unless a rule allows it. - **Stateless.** The switch does not track connections. Replies to connections the server opens are allowed for TCP, and for UDP from ports 53 (DNS) and 123 (NTP). ICMP is always allowed. Other UDP replies, for example QUIC (UDP 443), need an inbound rule. - **Private networks are not filtered.** Traffic between your servers over a private network bypasses the groups. - **Reinstall and rescue keep working** with groups attached. To turn the firewall off on a Bare Metal server, remove all its groups. ## Designing groups that stay manageable - **One group per role**, not per machine: *web*, *database*, *bastion*. A machine can have more than one group applied. - **Restrict the source wherever you can.** `0.0.0.0/0` on port 22 invites the entire internet's brute-force traffic into your logs; limiting it to your office or VPN range removes almost all of it. - **Keep a bastion pattern for admin ports.** Allow SSH only from one hardened machine's address, and reach everything else through it. ## What it doesn't do > Important: This firewall filters packets **at the machine** (or at the switch right in front of a Bare Metal server). It cannot stop a volumetric **DDoS attack**: by the time traffic arrives, the bandwidth is already spent. For attack traffic you need filtering upstream: see [DDoS Mitigation](/docs/products/security/ddos-mitigation) for Edge ACL rules that drop traffic at the network edge.