-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Match all unchanged findings on reimport #11505
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
Conversation
DryRun Security SummaryThe code change in the Expand for full summarySummary: The code change in the
This change ensures that when multiple existing findings match a new finding, the endpoint status is updated for all the matched findings, not just the first one. This is an important change, as it helps to ensure that the re-import process accurately updates the existing findings in the system. From an application security perspective, this change is relevant because it improves the accuracy and completeness of the re-import process. Ensuring that all matched findings are properly updated, including their associated endpoints, helps to maintain an accurate and up-to-date view of the application's security posture. Overall, this change appears to be a bug fix or an enhancement to the re-import functionality in the DefectDojo application, which is an important component of an application security management system. Files Changed:
Code AnalysisWe ran
Overall Riskiness🔴 Risk threshold exceeded. We've notified @mtesauro, @grendel513. |
Thank you for the PR. One complication of this approach is that the endpoints are no longer updated for the first finding. This makes sense as we don't know which endpoints belong to which finding. Would there be something smart we can do here? Like maybe look at the endpoints (or other field(s)) to see if we can deduce an exact match? Unsure about if we would need to inform the user of not being able to process the endpoints. We also need to find out what the maintainers think of this proposed adjustment in behaciour. |
Not sure to be honest. I assumed it was random before (the first finding was taken), so now I just changed it to the last one. But I don't use endpoints, so it's not obvious for me what is the expected behaviour here. |
The endpoints are what make this exceptionally tricky. This problem will likely require a very involved and thought out solution. Closing this one for now |
Do you think that someone would review the PR if I would figure out the way to handle the endpoints? We want to use the tool in our company, but Trivy sends us a lot of duplicates in reports. It makes tracking those vulnerabilities impossible because they got closed on second reimport. |
This is a proposed fix of #3958
Currently when reimporting, only the first matching vulnerability is added to the list of unchanged items. So if there are 2 or more vulnerabilities with the same hash, only the first one will be considered unchanged. Rest of them will get mitigated. With this change all the matching vulnerabilities will be considered unchanged.
I tested several scenarios:
I think this is how it should work, but I may miss some edge case.
About the dynamic finding - I wrote it to update only from the last one, I'm not sure what is it updating exactly but I suspect it shouldn't be called 2 times, the last one is enough.