Firewall Rules
Control which IP addresses can access your databases.
Allow IP
POST /v1/firewall/allow
{
"db_type": "postgresql",
"db_name": "my_db",
"ip_address": "203.0.113.42",
"description": "Office IP"
}
curl -X POST "https://api.wayscloud.services/v1/firewall/allow" \
-H "Authorization: Bearer $WAYSCLOUD_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"db_type": "postgresql",
"db_name": "my_db",
"ip_address": "203.0.113.42",
"description": "Office IP"
}'
List Rules
GET /v1/firewall/list
curl -X GET "https://api.wayscloud.services/v1/firewall/list?db_type=postgresql&db_name=my_db" \
-H "Authorization: Bearer $WAYSCLOUD_API_KEY"
Remove IP
DELETE /v1/firewall/remove
{
"db_type": "postgresql",
"db_name": "my_db",
"ip_address": "203.0.113.42"
}
CIDR Notation
Allow entire IP ranges:
{
"db_type": "postgresql",
"db_name": "my_db",
"ip_address": "203.0.113.0/24",
"description": "Office network"
}
Security Best Practices
- Whitelist only necessary IPs
- Use CIDR for networks (/24, /16)
- Document all rules with descriptions
- Review regularly and remove unused IPs
- Never use 0.0.0.0/0 (open to internet)