Skip to content
Cloud · Secret guide

Leaked Defined Networking API Token: what to do in the first hour

High severityDetected onlyLast verified · 4 min read

A Defined Networking API token gives scripted access to the Defined Networking control plane for a Nebula network. Whoever holds it can act within the permission scopes the token was created with. Scopes such as host creation and enrolment are the ones that matter most: they let a caller add machines that can join the private network and receive certificates. A token limited to read access is far less dangerous, which is why the first question after a leak is what the token was allowed to do.

Check your GitHub account for leaked secrets — free

Provider
Defined Networking
Severity
High
Impact
SaaS account access and billing
Checked live by LeakWatch
No

What a Defined Networking API Token looks like

Defined Networking API tokens carry a dnkey- prefix, followed by two blocks of letters, digits and symbols separated by a hyphen. The value is one string, with no spaces, and it is usually stored as the bearer token in an Authorization header:

dnkey-…-…   Defined Networking API token (masked)

The prefix is what lets a scanner find the value, but it is not enough on its own: the rule also looks for a label such as “dnkey” next to an assignment. The same token can be pasted into a request header, an environment file or a configuration object, and each of those places needs a check. Keep in mind that the exact format is taken from the detection rule. We could not confirm the full token layout from the vendor’s documentation, so treat the prefix as the reliable signal.

How Defined Networking API Tokens get leaked

  • Automation scripts. A script that creates hosts or rotates enrolment material, with the token written into the file that was then committed.
  • Infrastructure code. A deployment manifest that sets the token as a plain value rather than a secret reference.
  • CI logs. A pipeline step that prints the request headers of a failed API call, which includes the bearer token.
  • Shared runbooks. A wiki page or chat message where someone pasted a working command with the real token still inside.
  • Backups of a workstation. A shell history file or a configuration directory that was copied to a shared drive.

What to do in the first hour

  1. Revoke the token. Open the account settings for your Defined Networking organization and revoke the API key that leaked. Do this before reviewing anything, because a live key can keep changing hosts while you investigate.
  2. Create a replacement with only the scopes the automation needs. Store it in a secret manager, and run the automation once to confirm it works.
  3. Review the hosts. Look for hosts you do not recognize, especially any created or enrolled after the exposure date. A new host that joins the network is the most serious outcome, because it can reach internal services.
  4. Review the audit log. Filter the log to the period since the exposure and look for API calls you did not make. Pay particular attention to enrolment and host creation.
  5. Check the other keys. Look at the other API keys on the same organization and remove any you did not create or no longer use.
  6. Rotate what the host could reach. If an unknown host may have joined, treat the certificates and any services it could reach as exposed, and rotate them.
  7. Clean the repository. Remove the token from current files and read it from a secret store. For a wider search across older commits, see deep-scan your whole git history.

Not sure what else leaked? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Defined Networking

API keys are managed on the API keys page of the admin panel. Open account settings, find the key by its name, and revoke or delete it. When you create the replacement, give it a descriptive name and choose the smallest set of scopes it needs. The token is displayed only once after it is saved, so copy it into your secret store at that moment. We could not confirm the exact button labels from the current documentation, so follow what the page shows you.

How LeakWatch detects it

The rule is called Defined Networking API Token. It looks for a label that contains “dnkey”, a short distance before an assignment-style separator, followed by a value that begins with dnkey- and has two fixed-length blocks. The label is required, so a bare value with no assignment context is not reported. The severity is high, with the impact class for SaaS tools. This type is not checked live: LeakWatch does not send a request to Defined Networking with the value it found.

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 read-only token cause damage?

Much less. It can reveal host names and the shape of the network, which helps an attacker plan, but it cannot add a machine. Check the scopes before deciding how urgent the response is, and still revoke the token if you cannot confirm them.

Do I need to rebuild the network after a leak?

Not usually. Revoking the token stops further API changes. You only need to rotate certificates and review hosts if the audit log shows that something new joined the network.

Should each script have its own token?

Yes. A separate token per automation keeps one leak from breaking every integration, and it makes the audit log easier to read.

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

LeakWatch is not affiliated with Defined Networking.