Skip to content
Cloud · Secret guide

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

High severityDetected onlyLast verified · 5 min read

A Temporal Cloud API key lets a program manage a Temporal Cloud account: namespaces, users, service accounts and the other settings of the managed workflow service. It is different from the credentials that workers use to run workflows inside a namespace, although a leak of the management key can be used to change who can reach those namespaces. Temporal is used to run durable workflows for payments, onboarding and other business processes, so an attacker who controls the account can disrupt or observe that work. Delete the key first, then check the namespaces it could touch.

Check your GitHub account for leaked secrets — free

Provider
Temporal
Severity
High
Impact
Cloud infrastructure access
Checked live by LeakWatch
No

What a Temporal Cloud API key looks like

A Temporal Cloud API key is a signed token of the JSON Web Token kind. Its three parts are separated by dots, and the middle part, once decoded, contains readable claims that name the account, the key and the Temporal issuer. Because of this structure, the value is long and begins with the usual token header, which makes it recognizable even though the body is random:

eyJ…<payload>.<signature>   (Temporal Cloud API key, masked)

The rule for this page looks for the encoded form of those claims, which is why a generic token from another service is not reported. Keys are created per user or per service account, and they can be given a limited lifetime when they are created. Temporal’s documentation says that a key can be disabled or deleted, and that a key you have deleted cannot be used again.

How Temporal Cloud keys get leaked

  • Worker configuration. A worker process that connects to a namespace, with the key in its configuration file, committed to a repository.
  • Infrastructure code. A deployment definition that sets the key as a plain value rather than a reference to a secret store.
  • CI logs. A pipeline that prints its environment, or that runs the management command with the key on the command line, where it appears in the log.
  • Shared scripts. A helper script copied between teams with the key still inside.
  • Container images. A build that copies the configuration file into the image, which is then pushed to a registry.

What to do in the first hour

  1. Delete the key. In Temporal Cloud, open your profile’s API keys page, find the key that leaked, open its menu and choose Delete. Temporal describes deletion as permanent, and a deleted key stops authenticating straight away. Do this before you clean the repository. If the key belongs to a service account, you may need a Global Administrator or Account Owner to delete it.
  2. Create a replacement for each service that needs one, and store it in a secret manager. Give each worker or pipeline its own key, so one removal does not stop everything.
  3. Redeploy the services that used the old key, and confirm that the workers reconnect to their namespaces.
  4. Review the account activity. Check the users, service accounts and namespaces for changes made since the key may have been exposed. Look for new users, changed access settings and namespaces that you did not create.
  5. Check the workflows. Review the running and recently completed workflows in the namespaces the key could reach. Look for unexpected starts, cancellations and signals.
  6. Clean the repository after the rotation: remove the value from the files, add the file to .gitignore and decide whether to rewrite history. The order of steps is in I accidentally pushed an API key to GitHub.

Not sure what else leaked? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Temporal

Sign in to Temporal Cloud and open the account settings for API keys. Temporal’s documentation covers creating, disabling and deleting keys from the interface, from its command-line tool and through its command reference. Deleting is permanent, while disabling is reversible, so choose deletion for a key that leaked. The command-line equivalent exists, and it is useful when you rotate many keys from a script. Our review used Temporal’s documentation for these details, but the interface may have changed since, so check the labels when you act.

How LeakWatch detects it

The rule is called Temporal Cloud API Key. It looks for a value that begins with the usual token header, followed by the encoded form of the Temporal claims, the Temporal issuer name and the key identifier, and then the signature part, followed by a delimiter such as a quote, a space, a semicolon or the end of the line. An ordinary token from another service does not contain these claims and is not reported. The severity is high, with the impact class for infrastructure and cloud services. This type is not checked live: LeakWatch does not send the key to Temporal.

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

Is a Temporal Cloud key the same as a worker certificate?

No. Workers may connect with a certificate or a key, depending on how the namespace was set up. The management key described here manages the account. Check the worker configuration as well, because a leaked worker credential has its own removal steps.

Can I disable the key instead of deleting it?

You can, and disabling is reversible. For a leaked key, deletion is the better choice, because it ends access for good and leaves nothing to re-enable by mistake.

Will my workflows stop running?

Running workflows keep their state in Temporal, but workers that cannot authenticate will stop picking up tasks until they receive the new key. Plan the replacement so that the workers restart quickly.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with Temporal.