dtrack

by KvalitetsIT

Helm chartv0.12.1App 0.12.1Verified publisher

OWASP Dependency-Track with optional bootstrap and Trivy services

About this chart

DependencyTrack Helm Chart

This chart deploys OWASP Dependency-Track (backend API server and frontend UI), optional manual bootstrap resources for initial provisioning, and an optional Trivy vulnerability scanning service.

Routing can be configured with either standard Kubernetes Ingress resources or Gateway API resources via the KvalitetsIT gateway-routes library chart.

Prerequisites

Required:

  • Kubernetes 1.25+
  • PostgreSQL reachable from the backend
  • Dependency-Track v5 images (this chart is v5-only; see Upgrading from v4 to v5)
  • A Secret holding the KEK used by Dependency-Track's database secret-management provider

Optional, depending on enabled features:

  • Istio with Gateway API support when using gateway-routes
  • An existing Gateway resource when using Gateway API
  • cert-manager with a ClusterIssuer when using Gateway API TLS automation

Required configuration

Secret management (KEK)

This chart only supports Dependency-Track's database secret-management provider: DT v5 encrypts credentials (repository passwords, integration tokens, and other secrets written through the API) into PostgreSQL using a key-encryption key (KEK). The chart hardcodes DT_SECRET_MANAGEMENT_PROVIDER=database and does not expose a provider option, because DT's env provider is read-only after startup and the bootstrap job writes credentials through the API, which the env provider cannot accept.

The chart never generates or inlines the KEK. Create a Secret yourself and reference it from backend.secretManagement.kek.existingSecret.name:

backend:
  secretManagement:
    kek:
      mode: config
      existingSecret:
        name: dtrack-backend-kek

Two KEK modes are supported:

  • config (default): a base64-encoded 32-byte AES key, stored under the Secret key kek. Generate one with:

    kubectl create secret generic dtrack-backend-kek \
      --from-literal=kek="$(openssl rand -base64 32)"
    
  • keyset: a Tink JSON keyset, stored under the Secret key kek-keyset.json. This is the only mode that supports in-place KEK rotation, so it is recommended for long-lived production installs. Generate one with tinkey:

    tinkey create-keyset --key-template AES256_GCM --out kek-keyset.json
    kubectl create secret generic dtrack-backend-kek \
      --from-file=kek-keyset.json
    

If you manage Secrets with SealedSecrets, seal the generated value under the same suggested name (dtrack-backend-kek) and commit the sealed resource; the chart only references the Secret name and key, it never creates the Secret.

[!WARNING] Losing the KEK makes every secret Dependency-Track has encrypted into PostgreSQL unrecoverable, including repository passwords and integration tokens. Back up the KEK Secret (or the sealed source of truth) with the same care as the database itself.

PostgreSQL

[!NOTE] This chart configures Dependency-Track to connect to PostgreSQL, but it does not install PostgreSQL. We recommend installing PostgreSQL separately with the KvalitetsIT cnpg-cluster chart, then pointing backend.database at that service and credentials. backend.database.serviceName is required.

backend:
  database:
    serviceName: postgresql
    port: 5432
    name: dtrack
    usernameSecret:
      name: dtrack-postgres-credentials
      key: username
    passwordSecret:
      name: dtrack-postgres-credentials
      key: password

Size the server's max_connections against the pools this chart opens. Dependency-Track 5 runs two HikariCP pools per backend replica (a transactional one and a read-only one), so:

max_connections >= backend.replicas * backend.pool.maxSize * 2 + headroom

Leave headroom for CNPG's own connections, backup jobs and admin sessions - 20 to 30 is enough.

Backend file storage

Choose a file-storage provider explicitly with backend.fileStorage.provider.

For local storage, either let the chart create a PVC or reference an existing PVC:

backend:
  fileStorage:
    provider: local
    local:
      persistence:
        create: true
        accessModes:
          - ReadWriteOnce

Multiple backend replicas using local storage require ReadWriteMany. Helm rejects multi-replica local configurations without RWX. Alternatively, use S3-compatible storage, which does not create a backend PVC:

backend:
  replicas: 2
  fileStorage:
    provider: s3
    s3:
      endpoint: https://s3.example.com
      bucket: dependency-track
      region: eu-west-1
      credentialsSecret:
        name: dtrack-s3-credentials
        accessKeyKey: access-key
        secretKeyKey: secret-key

Suggested Secret names

For new installations, use purpose-oriented Secret names and keep the existing split between the KEK, bootstrap-only credentials, shared integration tokens, and database credentials:

  • dtrack-backend-kek: contains only the KEK (kek for config mode, kek-keyset.json for keyset mode)
  • dtrack-bootstrap-secrets: admin password and bootstrap-only credentials such as NVD/Sonatype/repository credentials
  • dtrack-integration-secrets: tokens shared by multiple integrations, for example Trivy and GitHub tokens used by both bootstrap configuration and the Trivy service
  • dtrack-postgres-credentials: PostgreSQL username and password

When migrating an existing installation, do not blindly rename Secrets. Many deployments use SealedSecrets or externally managed Secrets, so renaming may require re-sealing/recreating the Secret or keeping the old name in values.

Upgrading from v4 to v5

[!IMPORTANT] This chart is v5-only starting with 0.7.0: rendering fails when backend.image.tag or frontend.image.tag has the 4. prefix. Installations still running Dependency-Track v4 must stay on chart <= 0.6.x until they complete the cutover below.

Migration from v4 to v5 is a one-time, out-of-band operation and lives in a separate chart, dtrack-migration, not in this chart. This chart has no migration.* values: installing dtrack-migration is itself the intent to migrate, and its migration Job always renders (no toggle). This is a human-driven runbook, not a Git/ArgoCD-driven cutover with Helm hooks.

  1. Provision the v5 target. Provision a fresh v5 PostgreSQL database (for example with the cnpg-cluster chart), and create the KEK Secret and v5 database credentials Secret described above.

  2. Scale everything down. Scale the running v4 dtrack release's backend and frontend to zero replicas. If a v5 dtrack backend already exists pointed at the target database, scale it down too. Nothing should write to either database while the migration runs.

  3. Install the migration chart, pointing source at the v4 database, target at the v5 database, and offlineGuard.url at the draining v4 backend:

    helm install dtrack-migration ./charts/dtrack-migration -f my-migration-values.yaml
    

    The chart's offline guard confirms the v4 backend is actually offline before it lets anything touch the databases, then bootstraps the v5 schema and migrates the data. See the dtrack-migration README for the full runbook and value reference.

  4. Verify the migration Job before proceeding:

    kubectl logs job/dtrack-migration -c migration-bootstrap
    kubectl logs job/dtrack-migration -c migration
    
  5. Upgrade the dtrack release to v5: bump the chart to 0.7.x, migrate values, point backend.database at the v5 database, set backend.image.tag/frontend.image.tag to 5.x, and set backend.secretManagement.kek.existingSecret. The v5 backend starts, runs its init tasks in-pod, and becomes ready via /health/started.

  6. Remove the migration chart:

    helm uninstall dtrack-migration
    
  7. Re-run bootstrap after cutover. The v4-migrator nulls out DB-encrypted secret values as part of the migration, so repository passwords and integration tokens are gone until bootstrap re-seeds them. Trigger the bootstrap CronJob manually (see Manual bootstrap); this re-writes those credentials through the API, and v5 KEK-encrypts them under the fresh KEK.

Rollback: before cutover, revert to chart <= 0.6.x; the v4 database is untouched. After the migration Job has written to the v5 database, roll back by restoring the v5 target from backup and re-running the Job.

v5 startup and init tasks

Dependency-Track v5 runs its schema and data init tasks in-pod on every backend startup rather than via a separate initializer Job; a Postgres advisory lock serializes these tasks across replicas, so concurrent startups are safe. Because init tasks can take longer than a plain readiness check tolerates, the chart exposes backend.startupProbe (periodSeconds/failureThreshold/timeoutSeconds, defaults 15/40/5) as the operator knob: raise failureThreshold to widen the budget for large post-migration init-task runs. Health endpoints (/health/started, /health/live, /health/ready) are served on the management port (8000, DT_MANAGEMENT_PORT), which liveness and readiness probes also default to, so probes no longer depend on the Jetty port (8080) being ready during init tasks.

Manual bootstrap

When bootstrap.enabled=true, the chart installs a Secret and suspended CronJob. It never runs bootstrap as an install or upgrade side effect. Trigger it explicitly when Dependency-Track is healthy:

kubectl create job --from=cronjob/dtrack-bootstrap dtrack-bootstrap-$(date +%s)

For local development, mise run dev:v5:up brings up the kind cluster, database, and chart (including a smoke test) but does not trigger bootstrap. Run mise run dev:bootstrap afterwards to trigger the job from the suspended CronJob; bootstrap is never automatic.

Routing

This chart supports two routing options that can be used independently or together:

  • Gateway API: configured through the gateway-routes dependency.
  • Ingress: configured with backend.ingress and frontend.ingress.

Gateway API

gateway-routes:
  defaults:
    gateway:
      name: ingressgateway
      namespace: istio-ingress
    clusterIssuer: letsencrypt-prod-istio

  routes:
    backend:
      httpRoute:
        hostnames:
          - dtrack-api.example.com
    frontend:
      httpRoute:
        hostnames:
          - dtrack.example.com

The frontend API_BASE_URL environment variable is derived automatically from gateway-routes.routes.backend.httpRoute.hostnames[0]. Set frontend.apiBaseUrl only when you need to override it.

If you set nameOverride and also use custom gateway-routes.routes.*.httpRoute.rules, make sure your backendRefs point at the rendered backend/frontend Service names.

Ingress

backend:
  ingress:
    enabled: true
    host: dtrack-api.example.com

frontend:
  ingress:
    enabled: true
    host: dtrack.example.com

Exposure mode

The chart derives a single exposureMode from the routing configuration above and uses it to configure three things that would otherwise have to be kept in sync by hand.

exposureModeDetected whenCORS allowed originIngress network policiesWaypoint Service labels
istiogateway-routes.routes.backend or .frontend has hostnameshttps://<frontend route hostname>backend-waypoint, frontend-waypointapplied
ingressotherwise, if backend.ingress.enabled or frontend.ingress.enabledhttps://<frontend.ingress.host>backend-ingress, frontend-ingressnot applied
noneneitherempty, so no Access-Control-Allow-Origin headerneither pairnot applied

Derived origins are always https://. There is no switch to set the mode by hand: it follows whichever routing block you configured. Set backend.cors.allowOrigin to override just the origin.

The ingress policies select the RKE2-bundled rke2-ingress-nginx in kube-system. On a cluster whose controller differs, override the backend-ingress and frontend-ingress entries in networkPolicies and ciliumNetworkPolicies with the right selector.

Authentication (OIDC / Keycloak)

Both backend and frontend share OIDC configuration through global.auth. The clientId is shared: the frontend authenticates with it, and the backend validates tokens issued to that same client.

global:
  auth:
    enabled: true
    baseUrl: https://keycloak.example.com
    realm: dependency-track
    clientId: dtrack

Images and private registries

To pull all images from a private registry mirror, set global.image.registry. It overrides the per-component fallback registries, so all chart-managed images use the same registry prefix unless you leave it empty.

global:
  image:
    registry: mirror.example.com
  imagePullSecrets:
    - name: regcred

Network policies

The chart renders Kubernetes NetworkPolicy and CiliumNetworkPolicy resources from the networkPolicies and ciliumNetworkPolicies value maps.

Entries carrying an exposure key render only when it matches the resolved exposureMode (see Exposure mode). Every other entry renders unconditionally. Each map entry also supports enabled: false to suppress it; prefer that over an empty-map override, which ArgoCD cannot apply without `ServerSideApply=

Deploy dtrack with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has dtrack on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartdtrack is pinned at v0.12.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply