dependency-track icon indicating copy to clipboard operation
dependency-track copied to clipboard

Queue status API

Open mvanini opened this issue 5 years ago • 5 comments

I searched for already open enhancement request but I didn't find anything related to queue of uploaded bom.

Our problem is that sometimes DependencyTrack slowing down and we esperiencing wrong results from our CI: developers updates dependencies in their projects but DT still address vulnerabilities of "previous version". It would be nice to have an API to establish queue status of processing bom.

Current Behavior:

  • Parse log for token for each bom upload
  • Call /v1/bom/token/{token} and checks it content (processing true/false)

Proposed Behavior:

An API with status of queue: number of bom in queue and upload timestamp at least.

mvanini avatar Apr 06 '21 11:04 mvanini

I'm facing the same issue on our Dependency Track installation (DT version 4.2.0, 800 projects, several projects with 1500+ dependencies). I therefore support this enhancement. Some ideas:

  • The BOM-upload event should be written to the logs. The event "BOM processing finished" is already written. If you had both events, you would be able to analyze the delta (time between upload and processing)
  • In relation to #1001 : The content of the event queue should be part of the monitoring. Maybe Prometheus formatted.

bugbouncer avatar Apr 20 '21 08:04 bugbouncer

Did some testing with Dependency Track 4.3.6 (integrating with Tekton as CI) and I experience a similar behaviour. Neither api/v1/bom/token/ nor the bom import time can be reliably used to determine whether the inherited risk score is from the latest SBOM import as you can see from attached test run where I update a dependency in the CI pipeline and poll for lastBomImport, processing state and risk score.

[{"name":"project-name","uuid":"5ad7dc7f-2bd1-xyz","lastBomImport":1639490151313,"lastBomImportFormat":"CycloneDX 1.3","lastInheritedRiskScore":3.0,"active":true}]{"processing":false}

[{"name":"project-name","uuid":"5ad7dc7f-2bd1-xyz","lastBomImport":1639490151313,"lastBomImportFormat":"CycloneDX 1.3","lastInheritedRiskScore":9.0,"active":true}]{"processing":false}

gerdwatmann avatar Dec 14 '21 14:12 gerdwatmann

Agreed. This needs work. PR's are welcome ;-)

stevespringett avatar Dec 14 '21 14:12 stevespringett

@stevespringett - if you give me a reliable processing state and risk score after the SBOM upload I will contribute a Tekton task for Dependency Track CI/CD integration ;-) . It seems you already give me the processing state if we properly pass the job submit token instead of the uuid :-).

gerdwatmann avatar Dec 14 '21 14:12 gerdwatmann

Adding thoughts to this:

  • It'd be great to see what tasks have been completed on the given BOM upload (i.e. so I can answer the question of "has the BomUploadProcessingTask completed yet?"). I may need to wait on certain tasks to complete before performing other tasks, but I don't need to wait for the policy checks to run before I do my work.
  • It'd also be great to see which task is currently being processed, i.e. what step am I on currently?
  • Agree that timestamps are always a bonus and should be included

kbolander avatar Mar 08 '22 21:03 kbolander