Firewall
O Studio Next permite configurar regras de firewall (security groups) para controlar o tráfego de entrada e saída das suas VMs.Conceitos básicos
Regras de firewall
Cada regra define:- Direction: inbound (entrada) ou outbound (saída)
- Protocol: TCP, UDP, ICMP
- Port: porta ou range (ex: 80, 443, 3000-4000)
- Source/Destination: IP, CIDR, ou security group
- Action: allow ou deny
Regras são stateful. Se você permite inbound na porta 80, o retorno é
automaticamente permitido.
Ordem de aplicação
Regras são aplicadas em ordem:- Regras específicas primeiro
- Regras gerais depois
- Default: deny all
Templates de firewall
O Studio Next oferece templates pré-configurados:Web Server
Para apps web:| Direction | Port | Protocol | Source | Description |
|---|---|---|---|---|
| Inbound | 22 | TCP | Anywhere | SSH |
| Inbound | 80 | TCP | Anywhere | HTTP |
| Inbound | 443 | TCP | Anywhere | HTTPS |
| Outbound | All | All | Anywhere | All outbound |
Ideal para Next.js, React, APIs REST. Ajuste a porta SSH para IPs específicos
em produção.
Database
Para bancos de dados:| Direction | Port | Protocol | Source | Description |
|---|---|---|---|---|
| Inbound | 22 | TCP | Your IP | SSH |
| Inbound | 5432 | TCP | App VM IP | PostgreSQL |
| Outbound | All | All | Anywhere | All outbound |
Custom
Crie suas próprias regras:| Direction | Port | Protocol | Source | Description |
|---|---|---|---|---|
| Inbound | 22 | TCP | 192.168.1.0/24 | SSH from office |
| Inbound | 3000 | TCP | Anywhere | App port |
| Inbound | 5432 | TCP | 10.0.0.5/32 | Database from app |
Aplicando template
Customizar (opcional)
Ajuste regras conforme necessário: - Adicione regras custom - Edite source
IPs - Reordene regras
Criando regras custom
Configurar
- Direction: Inbound ou Outbound - Protocol: TCP, UDP, ICMP - Port: ex: 22, 80, 443, 3000-4000 - Source: IP, CIDR, ou 0.0.0.0/0 (anywhere) - Description: ex: “SSH from office”
Para múltiplas portas, crie uma regra por porta ou use range (ex: 3000-4000).
Whitelist de IPs
Para restringir acesso a IPs específicos:Identificar IPs
Liste os IPs que devem ter acesso: - Seu IP:
whatismyip.com - Office IP: pergunte ao IT -
CI/CD IP: documentação do provider
Criar regra
Em vez de
0.0.0.0/0, use: - Single IP: 192.168.1.100/32 - CIDR
range: 192.168.1.0/24 (256 IPs)
Regras comuns
SSH (porta 22)
Opção 1: Anywhere (não recomendado para produção)HTTP/HTTPS (portas 80, 443)
App port (3000, 8080, etc)
Opção 1: Expôr diretamente (dev only)Apps Node.js, Python, etc não devem ser expostas diretamente. Use reverse
proxy para SSL, caching, rate limiting.
Database ports
PostgreSQL (5432)Debugging de firewall
Se a conexão falhar:Próximos passos
- Managing VMs: acesse via SSH
- Monitoring: monitore conexões
- Providers: configure security groups no provedor