Dynatrace access tokens, platform tokens and tenant tokens are non-human identities that can read configuration, export data and push telemetry, so they need the same lifecycle discipline as any other privileged credential. This guide explains how each token type works, how to scope and rotate it, how to catch leaked tokens, and how to use Dynatrace masking settings so that sensitive data never leaves the monitored host in the first place.
This is an independent guide from NHI Mgmt Group, based on Dynatrace's public documentation as of November 2026. It is not sponsored or reviewed by Dynatrace. Product features change, so confirm settings against Dynatrace's current documentation.
Key takeaways
- Dynatrace uses several credential types: access tokens and personal access tokens for the API and installer downloads, tenant tokens for OneAgent data reporting, platform tokens for platform services, and OAuth clients. Inventory all of them, not just the ones in the Access Tokens page.
- Every token secret is shown once at creation and cannot be revealed later, so store it straight into a secrets manager or password manager and never in a ticket or chat.
- Scopes are fine grained and most API v2 scopes come in read and write pairs. Grant only the scopes an integration needs, and treat write, export and settings scopes as privileged.
- Platform tokens can be set to never expire and are capped per user. Set an expiry, assign automation tokens to service users, and restrict who can create tokens against those service users with the
iam:service-users:usepermission. - The token format has a public identifier and a secret portion. Log the identifier, never the secret, and use pre-commit hooks, log masking and secret scanning to catch leaks.
- Mask on the OneAgent side wherever possible. Dynatrace states that data masked by OneAgent never reaches Dynatrace servers, whereas masking during log processing happens after the data has left your environment.
Dynatrace credential types and why they are NHIs
The Dynatrace documentation explains that external access requires an environment ID and an access token, and it describes several kinds of token with different jobs. Access tokens and personal access tokens grant access to the Dynatrace API and to OneAgent and ActiveGate installer downloads. Personal access tokens grant access to some API endpoints. Tenant tokens are used by OneAgent to report data. Platform tokens, covered later in this guide, give programmatic access to Dynatrace platform services, and OAuth clients are an alternative for the same purpose.
Each of these is a non-human identity in the sense NHI Mgmt Group uses the term: a credential that a script, pipeline, agent or integration presents to prove who it is, with no person typing a password at the time of use. The practical consequences follow from that. Nobody notices when such a credential is copied, nobody is prompted to rotate it, and it often outlives the engineer who created it. The API Key Management Guide covers the general lifecycle; this page applies it to Dynatrace specifically.
Start with an inventory. For each environment, record every access token, every platform token, every OAuth client and the tenant token in use, together with an owner, the integration that uses it, the scopes it holds and when it was last rotated. Tokens with no identifiable owner or consumer are candidates for deletion.
Understanding the token format
Dynatrace documents a token format with three dot separated components: a prefix that identifies the token type, a 24 character public portion and a 64 character secret portion. The prefix and public portion together form the token identifier, which Dynatrace describes as safe to show in the user interface and to use in logs. The secret portion is the part that must be protected.
The documentation lists a number of prefixes, including:
dt0s01for the API token used for SCIM, which is generated once and stays in effect until the customer invalidates it.dt0s02for OAuth2 clients created through Account Management for the Account Management API.dt0s03anddt0s08for OAuth2 clients for internal and external services.dt0s06for OAuth2 refresh tokens, which Dynatrace says change roughly every 5 to 15 minutes.
The documentation states that this format has been enabled by default since version 1.210, that older tokens remain valid, and that the format can be temporarily opted out of under Settings > Integration > Token settings. From a security standpoint, leave the format on. The fixed prefix is what makes reliable secret scanning possible, and the split between identifier and secret is what lets you log token usage safely.
Creating and scoping access tokens
Dynatrace describes token creation as a short flow: open Access Tokens, select Generate new token, enter a name, select scopes and select Generate token. Two details in that flow matter for security.
First, token names do not have to be unique. Dynatrace recommends giving each token a meaningful name so it can be managed later. A naming convention that includes the consuming system, the owning team and the creation date makes reviews and incident response much faster than a list of tokens called "test" or "api".
Second, the documentation states plainly that you can only access the token once upon creation and cannot reveal it afterwards. Have the destination ready before you click generate: a secrets manager entry, a pipeline secret or a password manager record, as Dynatrace suggests.
Scopes are where most of the risk sits. Dynatrace describes scopes as fine grained, limiting access to specific functionality, and notes that most API v2 scopes come in read and write pairs, with read scopes covering GET requests and write scopes covering POST, PUT and DELETE requests depending on the API. Examples in the documentation include:
| Group | Example scopes named in Dynatrace documentation |
|---|---|
| API v2 | metrics.read, metrics.write, settings.read, problems.read, logs.ingest |
| API v1 | ReadConfig, WriteConfig, DataExport, LogExport |
| PaaS | InstallerDownload, SupportAlert |
| Other | PluginUpload |
NHI Mgmt Group recommends sorting scopes into three tiers when you review tokens. Ingest only scopes such as logs.ingest let a caller push data but not read it back. Read scopes expose monitoring data and configuration. Write, export and upload scopes such as WriteConfig, DataExport, LogExport, settings.write and PluginUpload can change what Dynatrace captures, extract data in bulk or introduce code, and deserve the same scrutiny as an administrator account. A token that ingests logs from a pipeline has no reason to hold any of the third group.
Dynatrace's own best practice list says to use only the scopes each integration requires. In practice that means one token per integration, never a shared "automation" token with every scope ticked.
Platform tokens and service users
Dynatrace describes platform tokens as long lived access tokens for programmatic access to platform services. They are sent as a bearer token in the Authorization header, they work within the permissions of the user they are assigned to, and they are offered as an alternative to OAuth clients. The documentation lists the services that accept them, including app-engine, automation, document, iam, openpipeline, settings, storage and others; the Dynatrace API explorer shows which endpoints each scope maps to.
Three properties of platform tokens are worth building controls around.
Scope is capped by the user
Dynatrace states that a scope only grants access if the assigned user has the matching permissions. A platform token is therefore never more powerful than the identity behind it, but it is also exactly as powerful as that identity for the scopes selected. Assigning an automation token to a human administrator gives the automation administrator reach. Assign automation tokens to a service user whose permissions match the job instead.
Who can create tokens for a service user
Regular users can create platform tokens in any account they belong to, and a token can be assigned to the creator or to a service user the creator has access to. To allow users to generate tokens against service users, an account admin must grant iam:service-users:use, and Dynatrace documents that this can be narrowed with the iam:service-user-email condition. The documentation gives this example policy:
ALLOW iam:service-users:use WHERE iam:service-user-email IN ("[email protected]", "[email protected]");
Use the condition. An unconditioned grant lets anyone holding it mint tokens for every service user they can see, which quietly turns each service user's permissions into a shared resource.
Expiry, limits and admin controls
Platform tokens can expire after a set period or never expire. Dynatrace notes that an expired token returns HTTP 403 and that expired tokens stay in the list until someone deletes them. The documented limits are up to 50 tokens per user per account, or 100 for a service user; each token is scoped to one account and can be restricted to specific environments. Account admins can turn off new token creation for an account and can disable or delete existing tokens, and Dynatrace notes that changes can take up to five minutes to take effect.
NHI Mgmt Group recommends setting an expiry on every platform token, restricting each one to the environments it actually needs, and using the disable action rather than deletion when you suspect misuse, so you can investigate before deciding. If your organisation does not use platform tokens yet, consider whether the account level switch to turn off new token creation should stay on until a process exists.
Dynatrace also publishes an upgrade path for moving Classic access token integrations to platform tokens and decommissioning unused Classic tokens. Treat that migration as a chance to re-scope: do not copy a broad Classic token's scopes onto its replacement by default.
Rotation and revocation
The platform tokens documentation calls regular rotation a security best practice and describes how to do it with overlap: create the new token, then set the old one to expire immediately or later so that consumers can move across. Dynatrace suggests adding the date to rotated token names so that old and new are easy to tell apart, and reminds you to update every place that uses the old token after rotation.
For access tokens, the documented guidance is to delete tokens that are no longer needed and, for a dt0s01 token, to rotate immediately if it leaks. Tenant tokens, which OneAgent uses to report data, are rotated through the Tenant tokens API, which requires the tenantTokenRotation.write scope. Because that scope controls the credential every OneAgent in the environment depends on, hold it in a dedicated, short lived token used only for the rotation job.
A workable rotation pattern for Dynatrace is:
- Identify every consumer of the token from your inventory, not from memory.
- Create the replacement with the same or narrower scopes and a dated name.
- Update consumers through your secrets manager or deployment tooling.
- Set the old token to expire, or disable it, and watch for 403 errors from consumers you missed.
- Delete the old token once nothing depends on it.
The API Key Leak Response Playbook covers the decision of when to revoke first and fix consumers afterwards.
Detecting leaked tokens
Dynatrace documents several leak detection measures, all of which work because of the fixed token prefix:
- Use Git pre-commit hooks, such as git-secrets, to stop tokens being committed.
- Define log masking rules so that the secret portion is hidden if a token appears in logs.
- Scan internal files and communications for tokens using the regular expression published on the access tokens page.
- Rely on GitHub secret scanning, which can flag Dynatrace tokens pushed to public repositories.
The same documentation tells you never to display, log or reveal the secret portion. Combine these measures with detection on the Dynatrace side. Dynatrace documents audit logs available on Grail and through an Audit logs API; feed those into your security monitoring and watch for token creation, scope changes and use from unexpected sources. Where your detection stack maps activity to MITRE ATT&CK, token theft falls under T1528 Steal Application Access Token and tokens found in repositories or configuration files under T1552.001 Credentials In Files. The Detection Engineering for Non-Human Identities Guide covers building those detections.
Masking data at capture with OneAgent
Tokens are one half of Dynatrace security. The other half is what the platform collects. Dynatrace documents global privacy settings under Settings > Collect and capture > Data privacy, and several of them decide whether personal or sensitive data ever leaves the monitored process.
| Setting | Documented default | Effect |
|---|---|---|
| Mask end-user IP addresses and GPS coordinates | Enabled | Zeroes the last IPv4 octet and the last 80 bits of IPv6 addresses and rounds GPS coordinates to one decimal place, before data leaves the monitored application or process. |
| Mask all IP addresses | Enabled for new environments | Extends IP masking to all IP addresses. |
| Mask personal data in URIs | Disabled | Masks personal data in URIs, headers and exception messages at storage, replacing it with <masked>. |
| Mask user actions (web applications only) | Disabled | Replaces specific HTML element names and values in user action names with generic ones. |
| Data-collection and opt-in mode | Disabled | Stops OneAgent and RUM JavaScript setting cookies or capturing data until the application calls dtrum.enable(). |
Older environments may not have the newer defaults, so check each environment rather than assuming. Note in particular that Mask personal data in URIs is disabled by default; if your applications put identifiers, email addresses or tokens in URLs or headers, turn it on.
OneAgent side masking
Under OneAgent side masking, Dynatrace lets you create custom masking rules and enable built-in rules for email addresses in URLs, query values, IBANs and payment card numbers, and IDs or consecutive numbers. The documentation states that masked data is removed on the OneAgent side and never reaches Dynatrace servers. It also notes that this feature is disabled by default and that built-in rules are deactivated in paid environments, so a production environment will not have them on unless someone has enabled them. Rules can be set per process group or environment wide.
Dynatrace also documents masking at display: users without the View sensitive request data permission see asterisks in place of data such as client IPs, exception messages and query parameters, and the Manage capturing of sensitive request data permission is required to mark request attributes as confidential. Both permissions should be limited to the people who need them. Display masking is a useful extra layer, but it does not stop the data being stored, so it should not be the only control for genuinely sensitive values.
Masking sensitive data in logs
Logs are where tokens, passwords and personal data most often appear by accident. Dynatrace documents three places to mask log content: at the source with OneAgent, during ingest through Log Processing, or before forwarding with the OpenTelemetry Collector. Its own guidance is that masking inside your environment keeps data protected before it leaves your infrastructure, while masking during Log Processing happens on the Dynatrace side after the data has already left. Prefer OneAgent masking for anything you would not want held by a third party.
OneAgent log masking rules are created under Settings > Collect and capture > Log monitoring > Configure log module > Sensitive data masking. Each rule has a name, a masking type (replacement with a string, or SHA-256, with SHA-1 documented as deprecated), a replacement string, a search expression in RE2 format and one or more matchers. Matchers target attributes such as process group, log source, host tag, Kubernetes namespace or workload, and Docker container name.
Several documented behaviours affect how well rules work:
- Built-in rules for payment card numbers and email addresses exist but are deactivated by default in paid environments.
- Rules can be set at host, host group or environment level, and run in that order, each applied to the output of the previous one.
- Only one capturing group is supported, and greedy quantifiers are not; use lazy forms.
- All matching rules for a log source share a 10 second execution limit. If it is exceeded, the log source is disabled until the log agent restarts or the configuration changes, and the file shows "File not monitored - incorrect sensitive data masking rule".
- There is a maximum of 256 masked objects per scope.
The execution limit has a security consequence that is easy to miss: an inefficient rule does not fail open by sending unmasked data, it stops monitoring the log source. That protects the data but creates a monitoring blind spot. Test rules on a non-production host group before applying them environment wide, and alert on the "File not monitored" status.
A good first rule set masks Dynatrace's own token secrets, using the published token pattern, alongside any other credential formats your applications might log. If you use the Settings API to manage rules, the token you use needs settings read and write permissions, which places it firmly in the privileged tier described earlier.
Common failure patterns
- One token for everything. A single broad token shared by several integrations means one leak exposes every scope and rotation breaks everything at once.
- Never expiring platform tokens. The option exists, and tokens created with it tend to outlive their purpose and their owner.
- Automation tokens on human accounts. A platform token assigned to an administrator inherits that administrator's reach, and stops working when the person leaves.
- Unconditioned service user access. Granting
iam:service-users:usewithout theiam:service-user-emailcondition lets users mint tokens for any service user they can see. - Assuming built-in masking is on. Built-in OneAgent side and log masking rules are deactivated in paid environments by default.
- Relying on display masking. Hiding data from some users does not stop it being stored.
- Slow masking rules. Rules that hit the 10 second limit disable the log source and create a blind spot.
- Secrets in the inventory. Tracking tokens in a spreadsheet that holds the full secret rather than the identifier.
Practitioner checklist
- Build an inventory of access tokens, personal access tokens, platform tokens, OAuth clients and tenant tokens per environment, using token identifiers only.
- Give every token a descriptive name with consumer, owner and date, and delete tokens with no owner or consumer.
- Issue one token per integration with the minimum scopes, and review any token holding write, export, settings or upload scopes.
- Assign automation platform tokens to service users, set an expiry and restrict them to the environments they need.
- Grant
iam:service-users:useonly with aniam:service-user-emailcondition. - Rotate tokens on a schedule with overlap, and rotate tenant tokens through the Tenant tokens API using a dedicated token.
- Deploy pre-commit hooks and secret scanning for the Dynatrace token pattern, and forward Dynatrace audit logs to security monitoring.
- Check IP masking, URI masking and opt-in mode settings in every environment, and enable OneAgent side masking rules where needed.
- Create OneAgent log masking rules for credentials and personal data, test them on a small host group, and alert on unmonitored log sources.
- Limit the View sensitive request data and Manage capturing of sensitive request data permissions.
Standards and references
- Dynatrace documentation: Access tokens
- Dynatrace documentation: Platform tokens
- Dynatrace documentation: Configure global privacy settings
- Dynatrace documentation: Sensitive data masking in OneAgent log ingestion
- Dynatrace documentation: Data privacy and security
- NIST SP 800-53 Rev. 5 (AC-6 Least Privilege)
- OWASP Secrets Management Cheat Sheet
- OWASP Logging Cheat Sheet
Related NHI Mgmt Group resources: API Key Management Guide · API Key Leak Response Playbook · Detection Engineering for Non-Human Identities Guide