-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Integrate vulnerability policy evaluation into scan result processing #474
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
nscuro
force-pushed
the
issue-940
branch
3 times, most recently
from
December 10, 2023 22:19
257fda3
to
7c9361f
Compare
2 tasks
nscuro
force-pushed
the
issue-940
branch
2 times, most recently
from
December 13, 2023 10:23
fd778af
to
e4748ae
Compare
mehab
reviewed
Dec 14, 2023
src/main/java/org/dependencytrack/event/kafka/processor/VulnerabilityScanResultProcessor.java
Show resolved
Hide resolved
mehab
reviewed
Dec 14, 2023
src/main/java/org/dependencytrack/event/kafka/processor/VulnerabilityScanResultProcessor.java
Outdated
Show resolved
Hide resolved
mehab
previously approved these changes
Dec 14, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This was referenced Dec 14, 2023
Merged
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Not sure why this changed as I didn't change the vulnerability sync logic. But the new values are in fact correct, according to https://owasp-risk-rating.com/?vector=(SL:1/M:4/O:4/S:9/ED:7/EE:3/A:4/ID:3/LC:9/LI:1/LAV:5/LAC:1/FD:3/RD:4/NC:7/PV:9). Signed-off-by: nscuro <nscuro@protonmail.com>
…otos Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
... and record respective changes in the audit log. Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
Signed-off-by: nscuro <nscuro@protonmail.com>
mehab
approved these changes
Dec 15, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR integrates the evaluation and application of vulnerability policies into the vulnerability scan result processing logic. The application includes both analyses and custom ratings, as well as according population of the audit trail.
In order to reduce the performance hit for doing this, the code has been slightly refactored to utilize batched SQL statements wherever possible. The majority of the logic has been migrated to use JDBI instead of DataNucleus, which again results in performance gains due to less ORM overhead.
Addressed Issue
Closes DependencyTrack/hyades#940
Additional Details
VulnerabilityScanResultProcessor
that could theoretically be moved to separate classes. I left it there for now, as it is kind of specific to what the processor needs. It may not be applicable to other areas of the codebase.PROJECT_AUDIT_CHANGE
notifications are currently not sent for analyses applied via policy. I addedTODO
s in the code and raised SendPROJECT_AUDIT_CHANGE
notifications for analyses applied via policy hyades#968 to implement that.NEW_VULNERABILITY
andNEW_VULNERABLE_DEPENDENCY
notifications do not currently reflect the rating overwrites applied via policy. I addedFIXME
s in the code and raised Rating overrides should reflect in notifications hyades#967 to address that.Checklist
This PR fixes a defect, and I have provided tests to verify that the fix is effectiveThis PR introduces new or alters existing behavior, and I have updated the documentation accordingly