Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dtapac sets Analysis in wrong project #279

Closed
rerkcp opened this issue Jan 9, 2025 · 1 comment · Fixed by DependencyTrack/client-go#35 · May be fixed by #280
Closed

Dtapac sets Analysis in wrong project #279

rerkcp opened this issue Jan 9, 2025 · 1 comment · Fixed by DependencyTrack/client-go#35 · May be fixed by #280

Comments

@rerkcp
Copy link

rerkcp commented Jan 9, 2025

Hello,

I have a scenario where there are several projects (p1.uuid, p2.uuid) with the same vulnerability (vuln.uuid), where p1.uuid yields a filled analysis result and p2.uuid yields an empty result. The affected component in p1 is comp1.uuid, and for p2 comp2.uuid.

Now I realized that an analysis were also set in dtrack for p2, even though OPA would return an empty result for this project/vulnerability.

While debugging this, I noticed that dtapac is querying both
p1.uuid, comp2.uuid, vuln.uuid and
p2.uuid, comp2.uuid, vuln.uuid
from OPA, event tho the combination p1.uuid, comp2.uuid, vuln.uuid does not make sense since comp2.project is p2.

This yields an empty result for the second query, and a filled analysis for the first, whereupon dtapac submits a

PUT api/v1/analysis with p1.uuid, comp2.uuid, vuln.uuid

to dtrack. This api call verifies that p1.uuid exists, but sets the analysis on comp2.project instead of using the p1.uuid from the request, which is the correct behavior, although it can be argued it should probably reject the request when the given project uuid does not match component.project.

Anyway, this leads to the unwanted behavior of p2 having an Analysis set while OPA did not return a result for p2.

@rerkcp
Copy link
Author

rerkcp commented Feb 10, 2025

Please note that the bug is not fixed with DependencyTrack/client-go#35 alone, the new information also has to be used in dtapac :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant