Skip to content
Cloud · Secret guide

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

High severityDetected onlyLast verified · 5 min read

An Elastic Cloud API key is an organization-level credential for managing Elastic Cloud deployments. It is not the key an application uses to write logs or search indexes. Whoever holds this one can work with deployments across the organization, depending on the roles it was given, and that can include changing deployment settings and resetting the built-in elastic user’s password. The key is therefore a control credential rather than a data credential, and it should be handled as one. Revoke it first, then check what changed on your deployments.

Check your GitHub account for leaked secrets — free

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

What an Elastic Cloud API Key looks like

Elastic Cloud API keys begin with essu_, followed by a long run of letters, digits, underscores and hyphens, and sometimes ending in padding characters. The prefix is specific enough to recognize in a file:

essu_…XXXX   Elastic Cloud API key (masked)

The key is sent in an Authorization header with the scheme name ApiKey, which is a different header format from the one used for the bearer tokens of other vendors. A key of this kind is also not the same as the API keys that Elasticsearch creates inside a cluster for a single user or a single integration. Those cluster keys are created in Kibana and are scoped to one deployment, while an Elastic Cloud key is scoped to the organization. If you find an essu_ value, check the organization it belongs to before deciding how urgent the response is.

How Elastic Cloud API Keys get leaked

  • Infrastructure-as-code repositories. A Terraform or script configuration that carries the key so that deployments can be created in automation.
  • CI pipelines. A workflow that sets the key as a plain variable, or a step that prints the environment or the request headers when it fails.
  • Local configuration. A file in a home directory or a dotfiles repository that holds the key for a command-line tool.
  • Support tickets and chat. A key pasted into a thread when a deployment call returned an authorization error.
  • Logs collected by the same platform. A key captured in a log line, then indexed and shared with a wider group of people than the key should reach.

What to do in the first hour

  1. Revoke the key. Open the account settings for your Elastic Cloud organization, go to the API keys list, find the key and revoke it. Revoking ends access at once, so do this before you clean up the files.
  2. Create a replacement only for the automation that needs it. Give it the narrowest role that the job requires, a name that says what it does, and an expiry date.
  3. Review deployments. List the deployments in the organization and check for changes made since the exposure, such as new deployments, changed security settings, or altered snapshot and restore configuration.
  4. Reset passwords. If the key could have been used to reset passwords, assume the built-in elastic user’s password may have changed. Reset it from a trusted session and update the applications that rely on it.
  5. Check snapshots and access. Look at snapshot repositories, network traffic filters and user accounts for changes you did not make. A change to where snapshots are stored is a common step after a leak.
  6. Check the rest of the file. Revoke any other credentials stored with the key, such as cloud storage keys used for snapshots.
  7. Clean the repository. Remove the value from current files, add the file to .gitignore, and rewrite history if the repository was public. See I accidentally pushed an API key to GitHub for the full order.

Not sure what else leaked from the same repository? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Elastic

Elastic Cloud API keys belong to the organization. They are listed on the API keys page under the organization’s settings in the Elastic Cloud console, and each one has a delete control in its row. Organization owners can see and revoke every key, while other roles may only see the keys they created, so the person handling the incident may need an owner to act. Keys can also expire automatically, and expiry is worth setting on every replacement, because a key that expires is one less that can be forgotten. Revocation is effective at once. Since this is a management key, check afterwards that the automation that needed it has moved to the replacement. We could not confirm the current menu wording from the live console, so verify the labels yourself before you act.

How LeakWatch detects it

The rule is called “Elastic Cloud API Key”. It looks for the prefix essu_, followed by between 60 and 200 letters, digits, underscores or hyphens, and then up to two equals signs, with a word boundary before the prefix and a quote, space, semicolon or line end after the value. Values shorter than the minimum length are not reported. The severity is high, with the infrastructure and cloud impact class, because the key can manage deployments and reset their passwords. This type is not checked live: LeakWatch does not send the value to Elastic, so a finding means the value has the right shape, not that it is still valid.

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

Does this key let someone read my logs?

It is a management credential, so the main risk is changes to deployments and passwords rather than reading indexed data. Reading data is a separate question that depends on the roles the key was given and on what the deployment exposes. Check the activity logs for the period since the exposure.

Is an Elastic Cloud key the same as a Kibana API key?

No. A Kibana or Elasticsearch API key is scoped to a single cluster, while an Elastic Cloud API key is scoped to the organization. Both are sensitive, but the response you need depends on which one leaked.

How long should a replacement key last?

As short as the automation allows, with a calendar reminder to rotate it. Expiry keeps old keys from quietly staying valid long after the job that needed them has changed.

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

LeakWatch is not affiliated with Elastic.