Skip to content

Dynatrace Application Security Executor

Category: Vulnerability Scanners Script: dynatrace_security.py Integration: REST API Faraday Plugin: Raw JSON Website: https://www.dynatrace.com/platform/application-security/

Description

Imports security problems (vulnerabilities) from Dynatrace Application Security into Faraday. Each affected Dynatrace host becomes a host and each problem becomes a vulnerability on it.

Prerequisites

  • A Dynatrace tenant with Application Security enabled
  • An API token with the entities.read and securityProblems.read scopes
  • Network access to your Dynatrace environment URL

Configuration

Environment Variables (Setup)

Variable Required Description
DT_HOST Yes Dynatrace environment URL (e.g., https://abc12345.live.dynatrace.com). https:// is added if missing.
DT_API_TOKEN Yes API token, sent as Api-Token

These variables are also accepted as execution arguments, so a single run can override them.

Execution Arguments

Parameter Type Mandatory Description
DT_RISK_LEVEL string No Comma-separated risk levels to import: CRITICAL, HIGH, MEDIUM, LOW (case-insensitive). Leave blank to import all levels.
DT_TIMEFRAME string No Start of the period to import. Use a relative value such as now-24h, now-7d or now-90d, or an ISO 8601 timestamp (default: now-30d).

YAML Configuration Example

executors:
  dynatrace_security:
    repo_executor: dynatrace_security.py
    max_size: 65536
    varenvs:
      DT_HOST: "https://abc12345.live.dynatrace.com"
      DT_API_TOKEN: "<api_token>"
    params:
      DT_RISK_LEVEL:
        mandatory: false
        type: string
        base: string
      DT_TIMEFRAME:
        mandatory: false
        type: string
        base: string

How It Works

  1. Sends the token as Authorization: Api-Token <DT_API_TOKEN> with every request
  2. Reads the HOST entities from GET /api/v2/entities to get each host's IP, hostname and operating system
  3. Reads security problems from GET /api/v2/securityProblems (filtered by risk level and timeframe) and the details of each one from GET /api/v2/securityProblems/{id}
  4. Creates one host per Dynatrace host referenced by a problem, and adds the problem as a vulnerability with its vulnerable components and references
  5. Maps the risk level to severity (or the risk score when there is no level). RESOLVED and CLOSED problems are closed, MUTED problems are risk-accepted and the rest are open.

Notes

  • Problems that do not reference any host (for example only process groups or Kubernetes clusters) are placed on a host with IP 0.0.0.0.
  • Only hosts with at least one problem are imported.
  • TLS certificate verification is disabled for the API calls.
  • A 401 response stops the run.
  • The shared agent parameters (AGENT_CONFIG_* tags and severity filters) are not applied by this executor.