The Dynatrace platform provides a comprehensive permission model for Grail. This model applies to all telemetry data, including metrics, events, spans, and logs.
We recommend setting up permissions along organizational lines and deployment scopes. Suitable concepts include host groups, Kubernetes clusters, and Kubernetes namespaces. These attributes are typically available for all telemetry data ingested via Dynatrace collection methods, such as OneAgent, OpenTelemetry, or Kubernetes operator. Hence, you can use these attributes to enable record-level permissions.
For Kubernetes-based deployments, make sure Dynatrace Operator has metadata enrichment activated.
If you only require a basic permission concept, setting up bucket-level permissions is the best option. You can then route your data to the correct bucket in OpenPipeline by matching one of the deployment-relevant primary Grail fields, such as host groups, namespaces, or clusters.
For more control in Dynatrace, you can set up policy boundaries with more granular restrictions on a data level. By default, you can use the following attributes:
dt.host_group.idk8s.cluster.namek8s.namespace.nameIf the permissions on deployment-level attributes or the bucket level are insufficient, you can set up fine-grained permissions by adding a dt.security_context attribute to your data. This context can represent your security architecture, and you can make the context hierarchical by encoding the hierarchy in a string, such as department-A/department-AB/team-C.
To use dt.security_context and other attributes for permissions, make sure these attributes are present in your telemetry data.
You can define the security context at the source via OneAgent, OpenTelemetry, or Kubernetes labels or annotations. This allows you to use your existing labels and tags to facilitate permissions in Dynatrace.
You can define a security context based on existing resource attributes from your span data within OpenPipeline.
Go to
Settings > Process and contextualize > OpenPipeline > Spans > Pipelines.
Configure your pipeline as needed.
Expand the Permission section and select Set security context.
Specify the processor name, and enter the required matching condition to filter span records and assign the security context, for example:
matchesPhrase(deployment.release_stage, "prod-")
Make sure Set security context is turned on, and select Save.
Add dt.security_context for those span records. The value of this attribute can be a literal value or a value copied from another field present on the span record.
After setting up dt.security_context, verify that your security context is set correctly.
When new span data arrives, the OpenPipeline security context processors add a dt.security_context attribute to the matching span records. To confirm that your security context processors handled the span records, go to
Notebooks and run a DQL query, for example:
fetch spans | filter isNotNull(dt.security_context) | fields dt.service.name, dt.security_context
Based on the created attribute, you can enforce security-related user and group policies.
Once dt.security_context is set, you can use it to filter and group service data in DQL queries.
To query service metrics by security context, use the timeseries command and group by dt.security_context and dt.smartscape.service:
timeseries median(dt.service.request.response_time), by:{dt.security_context, dt.smartscape.service}| filter isNotNull(dt.security_context) and isNotNull(dt.smartscape.service)
To query service entities with an assigned security context, use smartscapeNodes. See Explore the service entity in Smartscape on Grail to learn more about querying entities from Smartscape.
smartscapeNodes "SERVICE"| filter dt.security_context != array()
The query returns all service entities where dt.security_context is set, allowing you to verify which services are covered by your security context configuration.
The value of dt.security_context on a service entity can change between observations. For example, one service may show cluster-a as dt.security_context at one time and cluster-b at another. This behavior is expected: a service can run in multiple environments (clusters), each with a different security context.
The value of dt.security_context comes from the resource level, so from each deployed instance. A single service entity can aggregate instances with different dt.security_context values, which is why the value on the service entity can change between observations, for example, team-a at one point and team-b at another.
dt.security_context can also hold an array of values. You can assign the security context to both team-a and team-b, but check the monitoring source data (spans) and verify that the value of dt.security_context is stable and doesn't toggle.
You can also adjust your service detection rules to maintain a stable security context, or normalize dt.security_context in OpenPipeline.
Create policies and policy boundaries that use dt.security_context to control who can access your service data. For details, see Permissions in Grail.
To explore your services further, see Explore the service entity in Smartscape on Grail.
Services