# Leaked CockroachDB Cloud API Key? Revoke It Now

> CockroachDB Cloud API key exposed in code or logs? Delete it, then review clusters, SQL users and allowlists. Step-by-step guide for database teams.

Source: https://leakwatch.net/secrets/cockroachdb-cloud-api-key

---

[LeakWatch](/)

[Product](/product)[Live feed](/leaks)[Guides](/secrets)[Blog](/blog)[Free scan](/)

1.  [Home](/)
2.  [Secrets](/secrets)
3.  CockroachDB Cloud API Key

Databases & keys · Secret guide

# Leaked CockroachDB Cloud API Key: what to do in the first hour

Critical severityDetected onlyLast verified November 5, 2026 · 5 min read

A CockroachDB Cloud API key is a credential for the Cockroach Cloud management API. It is issued to a service account, not to a person, and it lets whoever holds it act on the clusters that account can reach: list and change clusters, create or delete SQL users, and edit network allowlists. The database rows themselves are not automatically exposed, but an attacker with a management key can create a new SQL user, open the network to their own address and then connect directly. That is why a leaked cloud API key is treated as urgent even when no data has been read yet. Delete the key first, then check what it was used for.

[Check your GitHub account for leaked secrets — free](/)

Provider

Cockroach Labs

Severity

Critical

Impact

Cloud infrastructure access

Checked live by LeakWatch

No

## What a CockroachDB Cloud API Key looks like

Cockroach Cloud API keys start with `CCDB1_`, followed by an underscore, a second block of letters and digits, another underscore and a longer final block. The whole value is a single token with no spaces:

```text
CCDB1_…_…   CockroachDB Cloud API key (masked)
```

The `CCDB1_` prefix is the part that identifies the credential. Other Cockroach Labs secrets, such as a SQL connection string with a password, look different and carry the database username and password in the URL. A management key is only useful against the Cloud API, but it is still a full credential for every cluster the service account can manage, so it should be handled as carefully as a database password.

## How CockroachDB Cloud API Keys get leaked

-   **A `.env` file committed to a repository.** A variable such as `COCKROACH_API_KEY` set to the real value in a file that was not ignored by git.
-   **Infrastructure-as-code.** A Terraform or deployment script that writes the key into a variables file, a state file or a generated configuration that is then pushed.
-   **CI logs.** A pipeline step that prints its environment, or a command that echoes the value passed to a provider block.
-   **Shared scripts.** A snippet pasted into a support thread or an issue to show how to list clusters, with the real key left in place.
-   **Local copies.** A key saved in a shell history file or a backup of a home directory that is later synced to a shared drive.

## What to do in the first hour

1.  **Delete the key.** Open the account settings for the service account that owns it, find the key in the API access list and delete it. Do this before you clean the code, so the value stops working right away.
2.  **Create a replacement** for the service that needs it, and store it in a secret manager or a CI variable. Give each application its own service account and key, so the next rotation affects one system.
3.  **Review the clusters.** Look at the cluster list for changes you did not make: new clusters, deleted clusters, scaled or moved regions, and backups that were disabled.
4.  **Check SQL users.** List the SQL users on each cluster and remove any you do not recognize. An attacker who gets a management key often adds a user so they can keep access after the key is revoked.
5.  **Check the network allowlist.** Look for IP ranges you do not know. A new allowlist entry is the most common way an attacker turns a management key into a direct database connection.
6.  **Look for other secrets** in the same file, especially database passwords and connection strings. Rotate them too. See [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github) for the order of steps.
7.  **Clean the repository.** Remove the value from the current files and add the file to `.gitignore`. A deleted commit still exists in every clone, so the revocation is the real fix.

Not sure what else leaked? [Run a free scan](/).

[Not sure what else leaked? Run a free scan.](/)

## Revoke it at CockroachDB

Keys are created and removed from the service account. Open account settings in the Cockroach Cloud console, go to the access management area, and open the service account that the key belongs to. In its API access table, use the action menu next to the key, choose Delete and confirm by typing the service account name. If the whole service account is no longer needed, delete it instead, which removes every key attached to it. Keys inherit the permissions of their service account, so check which account a key belongs to before you delete it. The exact menu wording can change between console releases, so follow what you see on the page. If you cannot find the key, it may sit in another organization you belong to.

## How LeakWatch detects it

The rule is called CockroachDB Cloud API Key. It looks for the `CCDB1_` prefix followed by two blocks of letters and digits separated by underscores, with word boundaries on both sides. A value that is only part of a longer string, or that uses a different prefix, is not reported by this rule. The severity is **critical**, with the impact class for infrastructure and cloud access. **This type is not checked live**: LeakWatch does not send a request to Cockroach Cloud with the value it found, so you must confirm the key’s state yourself in the console.

LeakWatch detects this format but does **not** check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

## FAQ

Can a management key read my database rows?

Not directly. It manages clusters and users rather than running queries. The risk comes from what it can change: an attacker can create a SQL user or open a network range, then connect with those new credentials.

Is it enough to rotate the database password?

No. The API key is a separate credential that can still create users and change networking. Revoke the key, then review users and the allowlist, and rotate database passwords too.

Should I keep one key for all my tools?

No. A separate service account and key per application means a leak only forces you to replace one integration, and it limits what each key can change.

## Related

-   [ClickHouse Cloud API Key](/secrets/clickhouse-cloud-api-key)
-   [Database Connection String](/secrets/database-connection-string)
-   [PlanetScale API Token](/secrets/planetscale-api-token)
-   [I accidentally pushed an API key to GitHub](/blog/i-accidentally-pushed-an-api-key-to-github)
-   [Which vendors leak most this week](/leaks/trends)
-   [All secret guides](/secrets)

[Get alerted next time a secret leaks — create a free account](/)

LeakWatch is not affiliated with Cockroach Labs.

![Gabriel Diyan, founder of LeakWatch](/brand/Photo-Gabriel-Diyan.webp)

Gabriel Diyan (0xCr0c0)

Cybersecurity student, founder of LeakWatch. I built and run the scanner described here — the detection patterns, the false-positive classifier and the provider validators are mine. [More about who I am](/about).

[GitHub](https://github.com/Leakwatch-Scan) · [X](https://x.com/LeakwatchScan) · [LinkedIn](https://www.linkedin.com/in/gabriel-diyan-80a378375) · [GitHub (personal)](https://github.com/crocogab)

LeakWatch

Secrets leak into public commits every minute. This watches the forges for yours. Built and run by [Gabriel Diyan](/about), a cybersecurity student — [why LeakWatch exists](/about).

Scan

-   [Product](/product)
-   [Live feed](/leaks)
-   [Trends](/leaks/trends)
-   [API docs](/docs)
-   [CI/CD](/docs?tab=ci)

Read

-   [Blog](/blog)
-   [Secret guides](/secrets)
-   [Changelog](/changelog)
-   [About](/about)

Verify

-   [Security](/security)
-   [Privacy](/privacy)
-   [Terms](/terms)
-   [Legal](/legal)
-   [Contact](/contact)
-   [Status](https://status.leakwatch.net)

© 2026 LeakWatch

[GitHub](https://github.com/Leakwatch-Scan)[X](https://x.com/LeakwatchScan)
