Authentication Overview
Authentication in CockroachDB Cloud works at different levels:- Organization Level: Access to Cloud Console, API, and
ccloudCLI - Cluster Level: SQL user authentication for database operations
Organization Authentication
Authenticate to manage your CockroachDB Cloud organization through three interfaces.Cloud Console Authentication
Access the Cloud Console at cockroachlabs.cloud. Authentication Methods:- Email and Password
- Single Sign-On (SSO)
- GitHub
Standard Login:
Navigate to Login
Go to cockroachlabs.cloud
ccloud CLI Authentication
Authenticate the ccloud command-line tool to your organization.
Headless Authentication:
For servers without a browser:
Cloud API Authentication
Service accounts authenticate to the Cloud API using API keys.Create Service Account
- Go to Access Management in Cloud Console
- Click Service Accounts tab
- Click Create Service Account
- Name the account and assign roles
Generate API Key
- Select the service account
- Click Create API Key
- Copy the API key (shown only once)
- Store securely
SQL User Authentication
Authenticate to CockroachDB clusters to execute SQL statements.Create SQL Users
Add User
- Click Add User
- Enter username (lowercase, alphanumeric, hyphens)
- Generate or enter a strong password
- Click Create
SQL Authentication Methods
- Username and Password
- Client Certificates
- SSO for SQL
Standard SQL Authentication:Connect using username and password in the connection string:Or provide credentials interactively:
Connection Security
CockroachDB Cloud enforces secure connections: SSL/TLS Requirements:- Connections must use TLS encryption
sslmode=verify-fullrequired for production- CA certificate validates server identity
| Mode | Encryption | Verification | Use Case |
|---|---|---|---|
require | Yes | No | Testing only (not recommended) |
verify-full | Yes | Yes | Production (required) |
Manage SQL Users
Perform common SQL user management tasks.Reset Password
Only Organization Admins and Cluster Admins can reset passwords:Reset Password
- Click the user’s action menu (•••)
- Select Reset password
- Generate or enter new password
- Click Update
Grant SQL Privileges
Control what SQL users can do:Delete SQL User
Multi-Factor Authentication
Enable MFA for enhanced organization account security.Enable MFA
- Go to Security tab
- Click Enable MFA
- Scan QR code with authenticator app
- Enter verification code
- Save recovery codes
- Google Authenticator
- Microsoft Authenticator
- Authy
- 1Password
- Other TOTP-compatible apps
Configure Organization SSO
Organization Admins can configure SSO for all users.Configure Identity Provider
- Select your IdP type (SAML 2.0)
- Enter IdP metadata URL or upload metadata XML
- Configure attribute mappings
- Centralized user management
- Automated provisioning/deprovisioning
- Enhanced security with IdP policies
- Simplified user experience
Security Best Practices
Organization Authentication
Recommendations
- Enable SSO: Centralize authentication
- Require MFA: Add extra security layer
- Use Service Accounts: For API access, not personal accounts
- Rotate API Keys: Regularly update service account keys
- Review Access: Audit user access quarterly
SQL User Security
Best Practices
- Strong Passwords: Minimum 12 characters, complex
- Least Privilege: Grant only necessary permissions
- Separate Users: Different users for different applications
- Regular Audits: Review user list and privileges
- Use Certificates: For Advanced clusters when possible
Connection Security
Secure Connections
- Always use TLS: Never disable SSL/TLS
- Verify Server: Use
sslmode=verify-full - Secure Credentials: Use environment variables, not hard-coded
- Rotate Passwords: Change passwords regularly
- Monitor Connections: Track unusual access patterns
Troubleshooting Authentication
Cannot Log into Cloud Console
Issue: Login fails or times out Solutions:- Verify email and password are correct
- Check if SSO is enforced for your organization
- Clear browser cache and cookies
- Try different browser
- Reset password if forgotten
- Contact Organization Admin
SQL Connection Refused
Issue: Cannot connect to cluster Solutions:- Check IP allowlist includes your IP
- Verify SQL username and password
- Confirm
sslmode=verify-fullis set - Download CA certificate
- Check network connectivity
- Verify cluster is running
Certificate Verification Failed
Issue: SSL/TLS verification fails Solutions:- Download latest CA certificate
- Verify certificate path in connection string
- Check certificate hasn’t expired
- Ensure
sslmode=verify-fullis used - Verify hostname matches certificate
API Authentication Failed
Issue: API key not working Solutions:- Verify API key is correct (no extra spaces)
- Check service account hasn’t been deleted
- Confirm service account has necessary roles
- Regenerate API key if compromised
- Check API key hasn’t been revoked
Next Steps
Authorization
Learn about roles and permissions
Connect to Cluster
Connect your applications
Network Security
Configure network authorization
Compliance
Security compliance and certifications