Skip to main content

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

  1. Whitelist only necessary IPs
  2. Use CIDR for networks (/24, /16)
  3. Document all rules with descriptions
  4. Review regularly and remove unused IPs
  5. Never use 0.0.0.0/0 (open to internet)