Loading...
Loading...
Configures and hardens IP allowlists for CockroachDB Cloud clusters to restrict network access to authorized CIDR ranges. Use when tightening network security, removing overly permissive allowlist entries like 0.0.0.0/0, or setting up allowlists for a new cluster.
npx skill4agent add cockroachlabs/cockroachdb-skills configuring-ip-allowlists0.0.0.0/00.0.0.0/0ccloud auth loginccloud cluster listccloud auth whoami
ccloud cluster list# List all IP allowlist entries for the cluster
ccloud cluster networking allowlist list <cluster-id> -o json0.0.0.0/0/8/16/32/24| Source | CIDR | SQL Access | UI Access |
|---|---|---|---|
| Office network | | Yes | Yes |
| VPN egress | | Yes | Yes |
| CI/CD runners | | Yes | No |
| Monitoring | | Yes | No |
# Add a specific CIDR range (CIDR is a positional argument)
ccloud cluster networking allowlist create <cluster-name> <cidr> \
--sql \
--ui \
--name "<description>"# Office network — SQL and UI access
ccloud cluster networking allowlist create <cluster-name> 203.0.113.0/24 \
--sql \
--ui \
--name "Office network"
# CI/CD runners — SQL only
ccloud cluster networking allowlist create <cluster-name> 192.0.2.0/28 \
--sql \
--name "CI/CD runners"
# Single IP — /32 for maximum specificity
ccloud cluster networking allowlist create <cluster-name> 198.51.100.42/32 \
--sql \
--ui \
--name "Developer workstation"# Delete the 0.0.0.0/0 entry (or other overly broad entries)
ccloud cluster networking allowlist delete <cluster-name> 0.0.0.0/00.0.0.0/0# Confirm the final allowlist
ccloud cluster networking allowlist list <cluster-id> -o json# Test SQL connection from an allowed IP
cockroach sql --url "<connection-string>" -e "SELECT 1;"
# Test from a non-allowed IP (should fail)
# Attempt connection from an IP not in the allowlist — expect connection refused0.0.0.0/0curl -s https://checkip.amazonaws.com/320.0.0.0/00.0.0.0/0/320.0.0.0/0# Emergency: re-add 0.0.0.0/0 via ccloud (if you still have ccloud access)
ccloud cluster networking allowlist create <cluster-name> 0.0.0.0/0 \
--sql \
--ui \
--name "Emergency - temporary open access"