An image scanner reports 400 CVEs a week. The security team asks which ones to fix first, and nobody can say which vulnerable libraries are actually loaded in production. Dynatrace Application Security answers that question from what OneAgent sees at runtime, not from a manifest. This is what people usually mean by AppSec Dynatrace or Dynatrace vulnerability scanning: no scheduled scan of an image, but continuous analysis of the code that actually runs.
For an SRE, the stake is not only compliance. An exploited vulnerability becomes an incident, with its MTTR and its impact on the error budget. Sorting by real exposure also cuts toil: you stop rushing patches for components that run nowhere.
Goal of this tutorial: enable runtime detection of third-party vulnerabilities (Runtime Vulnerability Analytics), target the right processes, read the results in DQL and through the API, then wire up a notification. The content targets Dynatrace SaaS; differences with Dynatrace Managed are flagged.
What Dynatrace Application Security detects at runtime
Runtime Vulnerability Analytics relies on OneAgent: it knows the libraries each process actually loads (Java, .NET, Node.js, Go, PHP depending on supported versions). Dynatrace matches them against public vulnerability databases and adds context:
- exposure: is the process reachable from the internet?
- vulnerable functions: is the vulnerable code actually called, where the technology allows it?
- sensitive data: does the service touch a database?
- scope: how many entities are affected, in which namespaces or zones.
This context produces a Dynatrace-specific assessment (the « Davis Security Score » in the classic interface) that complements the CVSS score. A critical CVE on an internal, unexposed batch job drops down the list; a medium CVE on a public API moves up.
Keep three things apart: third-party vulnerability detection (libraries), code-level vulnerability detection (SQL injection, for example) and runtime protection (Runtime Application Protection), which blocks attacks. This tutorial covers the first one.
Prerequisites
- A Dynatrace SaaS environment with OneAgent in Full-Stack mode on the relevant hosts or Kubernetes nodes. On Kubernetes, deployment goes through Dynatrace Operator (see connecting Dynatrace Operator to a cluster).
- Rights on the Application Security settings and, licence-wise, the Runtime Vulnerability Analytics capability (it is consumed and visible in billing events).
- An API token with
securityProblems.readfor the API, andsettings.read/settings.writeto automate rules. For 401 or 403 errors, follow the API token troubleshooting guide. - On Managed: the
securityProblemsAPI also exists (through the cluster or a Cluster ActiveGate), but DQL queries onsecurity.eventsassume Grail, so SaaS.
Step 1: enable third-party vulnerability detection
- Open Settings, then Application Security > Vulnerability Analytics.
- Enable third-party vulnerability detection and pick the default control mode per technology.
- Restart the monitored processes if your version’s documentation requires it for that technology: OneAgent has to see the libraries being loaded.
Exact screen labels change between versions; rely on the settings search and type « vulnerability ».
Step 2: target processes with monitoring rules
Enabling everywhere costs licence and adds noise. Monitoring rules let you force MONITORING_ON or MONITORING_OFF based on resource attributes or Kubernetes labels. Two schemas exist: builtin:appsec.third-party-vulnerability-rule-settings and builtin:appsec.third-party-vulnerability-kubernetes-label-rule-settings.
Start by reading the existing rules:
export DT_ENV="https://abc12345.live.dynatrace.com"
curl -s -H "Authorization: Api-Token $DT_TOKEN" \
"$DT_ENV/api/v2/settings/objects?schemaIds=builtin:appsec.third-party-vulnerability-rule-settings&scopes=tenant" \
| jq '.items[] | {objectId, value}'
Then describe a rule that excludes a test environment. The body below follows the schema structure (vulnerabilityDetectionControl, resourceAttributeConditions, metadata):
[
{
"schemaId": "builtin:appsec.third-party-vulnerability-rule-settings",
"scope": "tenant",
"value": {
"enabled": true,
"vulnerabilityDetectionControl": { "monitoringMode": "MONITORING_OFF" },
"resourceAttributeConditions": [
{
"resourceAttributeKey": "deployment.environment",
"matcher": "EQUALS",
"resourceAttributeValue": "sandbox"
}
],
"metadata": { "comment": "No analysis on the sandbox" }
}
}
]
curl -s -X POST -H "Authorization: Api-Token $DT_TOKEN" \
-H "Content-Type: application/json" \
-d @rule-sandbox.json \
"$DT_ENV/api/v2/settings/objects"
Critical line: resourceAttributeKey must match an attribute the process actually carries. Check it first, otherwise the rule applies to nothing and returns no error. Add ?validateOnly=true to the URL to test without writing.
Step 3: read vulnerabilities in DQL
On SaaS, results land in the security.events table. To see the latest state reports per vulnerability:
fetch security.events
| filter event.provider == "Dynatrace"
| filter event.category == "VULNERABILITY_MANAGEMENT"
| filter event.type == "VULNERABILITY_STATE_REPORT_EVENT"
| filter event.level == "VULNERABILITY"
| sort timestamp desc
Replace "VULNERABILITY" with "ENTITY" to get the per-affected-entity view: that is the one that tells you which service or process carries the library. For join examples with entities, see the operational DQL queries.
Step 4: query the securityProblems API
API v2 works on SaaS and Managed alike and easily feeds a report or a ticket:
curl -s -H "Authorization: Api-Token $DT_TOKEN" \
"$DT_ENV/api/v2/securityProblems?pageSize=100" \
| jq '.securityProblems[] | {displayId, title, status, riskAssessment}'
The maximum page size is 500; beyond that, follow nextPageKey with no other parameter. On Managed, the URL looks like https://{your-domain}/e/{environment-id}/api/v2/securityProblems. Exact response field names may vary: inspect a raw response before writing your jq filter.
Step 5: notify the owning team
A vulnerability without an owner never gets fixed. Route new critical vulnerabilities to the team that owns the service, through an event-triggered workflow or the existing ticketing integration. The pattern described in the Dynatrace workflow to Jira and ServiceNow applies as is: only the trigger query changes.
How to check that Dynatrace vulnerability scanning works
- In a test environment allowed by your rules, deliberately deploy an application that loads an old, known-vulnerable version of a common library.
- Wait a few minutes, then run the step 3 query: an event should appear for that process.
- Check consumption with:
fetch dt.system.events
| filter event.kind == "BILLING_USAGE_EVENT" and event.type == "Runtime Vulnerability Analytics"
| dedup event.id
If nothing appears: OneAgent is not in Full-Stack mode, the technology is not enabled, a MONITORING_OFF rule covers the process, or the process has not been restarted.
Best practices
- Sort by exposure, not by CVSS alone: handle first what is publicly exposed and reaches data.
- Explicit rules: document each exclusion in
metadata.comment; a silent exclusion becomes a blind spot. - Limited access: vulnerability details are sensitive; restrict them through groups and permissions (see the access model).
- Complementarity: keep scanning in CI; runtime analysis checks what really runs, it does not replace pre-deployment checks.
- Reference: rule syntax is described in the monitoring rules documentation.
- Remediation SLO: set a target delay per risk level and track it like an internal SLO.
Frequently asked questions
Does Dynatrace Application Security replace an image scanner?
No. The scanner sees everything that is packaged, including what never loads. Runtime analysis sees what runs. The two views complement each other; the gap between them is often instructive.
Do applications need a restart?
For some technologies, OneAgent must observe libraries being loaded, which means restarting the process after enabling. Check the support matrix for your version.
Is it available on Dynatrace Managed?
Vulnerability detection and the securityProblems API exist on Managed. Queries on security.events, the dedicated app and workflows rely on the SaaS platform. Check your licence and version before planning.
Conclusion
Enable detection, narrow it with rules, read results in DQL or through the API, then route to the right owner: five steps are enough to go from an unmanageable CVE list to a short queue prioritised by real exposure. The gain shows up as incidents avoided and pointless patching hours saved.
span.observer is an independent community blog, not affiliated with Dynatrace LLC. Dynatrace is a trademark of its owner. Screen, schema and field names change: check them in the official documentation for your version.
Originally published on span.observer. French version: https://span.observer/fr/dynatrace-application-security-vulnerabilites/.
Top comments (0)