Network Security Overview
Protect your clusters with:- IP Allowlisting: Restrict access to specific IP address ranges
- Private Connectivity: Connect via cloud provider private networks
- TLS Encryption: Encrypt all data in transit
- Network Isolation: Clusters run in isolated networks
IP Allowlisting
Control which IP addresses can connect to your cluster.How IP Allowlisting Works
By default:- Basic clusters: Open to all traffic (0.0.0.0/0)
- Standard/Advanced clusters: Locked down, no access until authorized
Add IP Allowlist Entry
Navigate to Networking
- Select your cluster
- Click Networking in the left navigation
- Go to IP Allowlist tab
Add Network
Click Add Network and choose:Current Network:
- Automatically detects your current public IP
- Quick setup for immediate access
- Enter IP address or CIDR range
- Example:
203.0.113.0/24
IP Allowlist Limits
| Cluster Type | Maximum Rules |
|---|---|
| Basic | 50 |
| Standard | 50 |
| Advanced (AWS) | 20 |
| Advanced (GCP) | 200 |
| Advanced (Azure) | 200 |
Need more allowlist rules? Contact Support to increase your limit.
CIDR Notation
Use CIDR notation to specify IP ranges: Examples:- Single IP:
203.0.113.5/32 - Subnet (256 IPs):
203.0.113.0/24 - Larger network:
203.0.0.0/16
| CIDR | Number of IPs | Use Case |
|---|---|---|
| /32 | 1 | Single machine |
| /28 | 16 | Small office |
| /24 | 256 | Office network |
| /16 | 65,536 | Large organization |
| /0 | All IPs | Development only |
Modify Allowlist Entry
Delete Allowlist Entry
Changes to IP allowlists take effect within a few seconds.
Private Connectivity
Connect to clusters without exposing them to the public internet.Benefits of Private Connectivity
- Enhanced Security: No public internet exposure
- Reduced Latency: Traffic stays on cloud provider network
- Compliance: Meet regulatory requirements
- Cost Savings: Potential reduction in data transfer costs
Available Options
- AWS PrivateLink
- GCP Private Service Connect
- GCP VPC Peering
- Azure Private Link
AWS PrivateLinkAvailable for Standard and Advanced clusters on AWS.Pricing: AWS charges for PrivateLink endpoints (~$0.01/hour + data transfer)
Get Service Name
- Navigate to Networking > Private endpoint
- Click Add a private endpoint
- Copy the Service Name
Create VPC Endpoint
In AWS Console:
- Go to VPC > Endpoints
- Click Create Endpoint
- Select Other endpoint services
- Enter the Service Name
- Select your VPC and subnets
- Choose security groups
- Create endpoint and copy Endpoint ID
Connect via Private Endpoint
Once configured, get private connection string:
Private Connection String Example:
Private Connectivity Best Practices
Recommendations
- DNS: Use private DNS for name resolution
- Security Groups: Restrict endpoint access
- Monitoring: Track private endpoint usage
- Documentation: Document endpoint configuration
- Testing: Verify private connectivity before production
TLS/SSL Encryption
All connections to CockroachDB Cloud are encrypted.TLS Configuration
Required Settings:- TLS 1.2 or higher
sslmode=verify-full(production)- Valid CA certificate
SSL Modes
| Mode | Encryption | Verification | Production Use |
|---|---|---|---|
disable | No | No | Never |
require | Yes | No | Testing only |
verify-ca | Yes | Partial | Not recommended |
verify-full | Yes | Yes | Required |
Network Isolation
Clusters run in isolated network environments.Cluster Network Architecture
Basic/Standard:- Clusters run in Cockroach Labs-managed VPCs
- Network isolation between customers
- No direct VPC peering
- Dedicated VPC per cluster (option)
- Customizable IP ranges
- Private connectivity available
- Network security group controls
Egress Control
For Advanced clusters, control outbound traffic: Egress Perimeter Controls:- Restrict outbound connections
- Allowlist external endpoints
- Control changefeed destinations
- Secure backup destinations
DB Console Access
Secure access to the DB Console (Advanced clusters only).Authorize DB Console Access
Add IP to Allowlist
- Go to Networking > IP Allowlist
- Click Add Network
- Select Current Network
- Check DB Console to monitor the cluster
- Click Apply
Security Monitoring
Monitor network security events and access.Audit Logs
Track network access attempts:- Organization Audit Logs: Track Console access
- SQL Audit Logs: Track database connections
- Connection Logs: Monitor successful/failed connections
Connection Monitoring
Track active connections:Compliance and Certifications
CockroachDB Cloud meets security compliance standards:- SOC 2 Type 2: All plans
- PCI DSS: Advanced with security add-on
- HIPAA: Advanced with security add-on
- ISO 27001/27017: All plans
Security Best Practices
Network Security Checklist
IP Allowlisting
- Remove 0.0.0.0/0 from production
- Use smallest necessary CIDR ranges
- Document all allowlist entries
- Review allowlist quarterly
Private Connectivity
- Use private endpoints for production
- Configure private DNS
- Restrict endpoint security groups
- Monitor private endpoint usage
Encryption
- Always use sslmode=verify-full
- Keep CA certificates updated
- Use TLS 1.2 or higher
- Verify certificate validity
Access Control
- Implement least privilege
- Use separate credentials per application
- Rotate passwords regularly
- Monitor connection logs
Defense in Depth
Implement multiple security layers:- Network Layer: IP allowlists + private connectivity
- Transport Layer: TLS encryption
- Authentication: Strong passwords + MFA
- Authorization: Role-based access control
- Application Layer: Prepared statements + parameterized queries
- Monitoring: Audit logs + alerts
Troubleshooting
Connection Blocked
Issue: Cannot connect to cluster Solutions:- Verify IP is in allowlist
- Check CIDR range is correct
- Confirm network type selected (SQL/DB Console)
- Wait a few seconds for changes to propagate
- Check firewall rules on client side
Private Endpoint Not Working
Issue: Cannot connect via private endpoint Solutions:- Verify endpoint status is “Available”
- Check VPC endpoint configuration
- Verify security group rules
- Test DNS resolution
- Check route tables
- Contact Support if issue persists
Certificate Errors
Issue: SSL/TLS certificate verification fails Solutions:- Download latest CA certificate
- Verify certificate path is correct
- Check sslmode setting
- Ensure certificate hasn’t expired
- Verify hostname matches certificate
Next Steps
Authentication
Configure authentication methods
Authorization
Manage roles and permissions
Compliance
Security compliance and certifications
Connect to Cluster
Connect applications securely