Authenticating to CockroachDB Cloud

Users may connect with CockroachDB Cloud in two ways:

CockroachDB Cloud authentication

You may login to the CockroachDB Cloud Console with a username and password, or using Single Sign-On (SSO) for Cockroach Cloud.

Note:
We recommend that CockroachDB Cloud Console users log in with Single Sign-On (SSO), with two-factor authentication (2FA) enabled for the SSO provider. This prevents potential attackers from using stolen credentials to accesss or tamper with your critical data.

CockroachDB Cloud currently supports SSO with GitHub, Google, and Microsoft.

Visit your CockroachDB Cloud Console's account settings page and switch to SSO to improve the security of your cluster.

SQL authentication

TLS

CockroachDB Cloud uses TLS 1.3 for inter-node communication and TLS 1.2 or 1.3 for client-node communication, digital certificates for inter-node authentication, SSL modes for node identity verification, and password authentication for client identity verification.

Node identity verification

The connection string generated to connect to your application uses the verify-full SSL mode by default to verify a node’s identity. This mode encrypts the data in-flight as well as verifies the identity of the CockroachDB node, thus ensuring a secure connection to your cluster. Using this mode prevents MITM (Machine in the Middle) attacks, impersonation attacks, and eavesdropping.

To connect securely to your cluster using the verify-full mode:

  1. Download the CA certificate and place it in the certs directory. The Certificate Authority (CA) certificate is the file that the client uses to verify the identity of the CockroachDB node.
  2. When connecting to the cluster, specify the path to the certs directory in the connection string. See Connect to your cluster for more details.

You can also use the require SSL mode, although we do not recommend using it since it can make the cluster susceptible to MITM and impersonation attacks. For more information, see the "Protection Provided in Different Modes" section in PostgreSQL's SSL Support document.

Client identity verification

CockroachDB Cloud uses password authentication for verifying a client’s identity. If no password has been set up for a user, password authentication will always fail for that user and you won’t be able to connect to the cluster.

For more information about creating SQL users and passwords, see User Authorization.

SSL mode settings

The table below lists the sslmode settings you can use to connect to your cluster and their associated security risks. Other settings are not recommended.

sslmode Eavesdropping protection MITM protection Description
require Yes No Force a secure connection. An error occurs if the secure connection cannot be established. This is less secure than using a CA certificate and is only recommended for testing or unimportant data.
verify-full Yes Yes Force a secure connection, verify that the server certificate is signed by a known CA, and verify that the server address matches that specified in the certificate.

See also

YesYes NoNo