Skip to main content
A CockroachDB account stores the credentials for one CockroachDB SQL user. Members connect to the database in the browser or through the Infisical CLI, and Infisical records every query they run.

Prerequisites

Create the account

1
Go to Privileged Access Management > Accounts and select Add Account.
2
Select the Folder and a CockroachDB Account Template, then select Next.
3
Enter a Name and the connection details:By default, CockroachDB only accepts passwords over TLS, so leave SSL Enabled on. If a private certificate authority (CA) signed the cluster’s node certificates, paste the CA certificate into SSL Certificate. For a cluster you set up with cockroach cert, the CA certificate is the ca.crt file in the cluster’s certificates directory.If you have a connection string, such as postgresql://user:password@host:26257/defaultdb?sslmode=verify-full, paste it into Host. Infisical fills in the other fields from the connection string, including the credentials and the SSL settings.
4
Enter the Username and Password of the CockroachDB user.
5
Select Create.

Credential rotation

Credential rotation changes the account’s password on a schedule or on demand. The rotation account needs permission to change that password:
  • The account itself: The account needs the CREATEROLE and CREATELOGIN role options, unless you run SET CLUSTER SETTING sql.auth.change_own_password.enabled = true
  • A different account: The rotation account needs the CREATEROLE and CREATELOGIN role options, or the admin role
If the account you rotate has the admin role, the rotation account needs the admin role too. For example, to create a rotation user and a user for it to rotate:
Add both users to Infisical PAM as CockroachDB accounts with the same host and port, then select infisical_rotator as the rotation account on the app_user account’s Rotation tab.

Connect

To open a session, follow Connect to an account.
The browser session has a table browser, where you can view, filter, edit, and export rows, and a SQL editor for running queries.

Next steps

Credential rotation

Change the passwords of your PAM accounts on a schedule.

Sessions

Review and end the connections that people and agents make to your accounts.