Skip to main content

Dynatrace Token

A Dynatrace token is a credential used to authenticate and authorize access to the Dynatrace platform, which provides application performance management and monitoring services. These tokens are critical for integrating Dynatrace with other systems, automating tasks, and accessing the Dynatrace API. Exposure of a Dynatrace token can lead to unauthorized access to monitoring data, configuration settings, and potentially sensitive information about the infrastructure and applications being monitored.


How Does It Look

Dynatrace tokens can appear in various contexts, such as:

  • Environment variables:

    export DYNATRACE_API_TOKEN="dt0c01.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  • Configuration files (YAML):

    dynatrace:
    apiToken: "dt0c01.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
  • Code snippets:

    headers = {
    "Authorization": "Api-Token dt0c01.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  • Connection strings:

    https://[HOST]/api/v1/someEndpoint?apiToken=dt0c01.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Severity

  • 🟠 High

The severity of a Dynatrace token exposure is high because it grants access to the Dynatrace API, which can be used to retrieve monitoring data, modify configurations, and potentially disrupt monitoring operations. The blast radius includes unauthorized access to application performance data and the ability to alter monitoring settings, which can impact the visibility and reliability of monitored systems.


What Can an Attacker Do?

With immediate access to a Dynatrace token, an attacker can perform several actions:

  • Retrieve monitoring data: Access detailed performance metrics and logs (if the token has read permissions).
  • Modify configurations: Change monitoring settings or disable alerts (if the token has write permissions).
  • Access sensitive information: Extract details about the infrastructure and applications (depending on permission scope).
  • Disrupt monitoring operations: Disable or manipulate monitoring to hide malicious activities (if not restricted by IP allowlist).

An attacker could potentially escalate their access by using the information obtained to target other systems or services monitored by Dynatrace, leading to further compromise.


Real-World Impact

The exposure of a Dynatrace token poses significant business risks:

  • Data Exposure: Unauthorized access to performance metrics and logs (if the credential has read access to sensitive data).
  • Financial Loss: Costs associated with unauthorized changes to monitoring configurations or service disruptions (if billing/resource creation is permitted).
  • Operational Disruption: Loss of monitoring visibility, leading to undetected performance issues (if the attacker has delete/modify permissions).
  • Reputational Damage: Loss of trust from clients and stakeholders due to compromised monitoring integrity.

In worst-case scenarios, attackers could leverage the exposed token to disable monitoring, allowing them to conduct further malicious activities undetected.


Prerequisites for Exploitation

To exploit a Dynatrace token, an attacker needs:

  • Network access: Ability to reach the Dynatrace API endpoint.
  • Additional context: Knowledge of the specific Dynatrace environment or account details.
  • No rate limits: Exploitation is easier if there are no strict rate limits or IP restrictions in place.

How to Verify If It's Active

To verify if a Dynatrace token is active, use the following command:

curl -X GET "https://[HOST]/api/v1/entity/infrastructure/hosts" -H "Authorization: Api-Token [TOKEN]"

Valid credential response: A successful response will return a list of monitored hosts in JSON format.

Invalid/expired credential response: An error message indicating unauthorized access or token expiration.


Detection Patterns

Common Variable Names:

  • DYNATRACE_API_TOKEN
  • DT_API_TOKEN
  • DYNATRACE_TOKEN
  • API_TOKEN
  • DT_TOKEN
  • DYNATRACE_AUTH

File Locations:

  • config.yaml
  • .env
  • settings.json
  • dynatrace-config.yml
  • application.properties

Regex Pattern:

dt0c01\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{64}

Remediation Steps

  1. Revoke immediately - Go to Dynatrace > Settings > Integration > API tokens and delete the compromised token.
  2. Audit access logs - Review Dynatrace audit logs for unauthorized API calls or configuration changes during the exposure window.
  3. Assess blast radius - Identify all systems, applications, and environments that used the exposed token.
  4. Rotate credential - Create a new API token in Dynatrace with least-privilege permissions.
  5. Update dependent systems - Deploy the new token to all applications and update CI/CD pipelines securely.
  6. Harden access controls - Enable IP allowlisting in Dynatrace and require TLS connections.
  7. Implement secrets management - Migrate credentials to a secrets manager (HashiCorp Vault, AWS Secrets Manager) to prevent hardcoding.
  8. Add detection controls - Set up pre-commit hooks and repository scanning to catch credential leaks before they reach production.

Credential exposures often go undetected for extended periods, increasing the window for exploitation. As a long-term strategy, plan to establish an internal process or engage an external vendor for continuous external exposure monitoring. This helps identify leaked secrets across public repositories, paste sites, dark web forums, and other external sources before attackers can leverage them. Proactive detection and rapid response are essential to minimizing the impact of credential leaks.


References