-
-
Notifications
You must be signed in to change notification settings - Fork 233
add support for calculating CVSS score from the CVSS vector #747
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
add support for calculating CVSS score from the CVSS vector #747
Conversation
4d3ae93
to
2890329
Compare
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.
Looking good... Can you add some tests?
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! 👍
@ziadhany do you mind to rebase on the latest code and also regen the migration on the latest code?
Also there is a need for a data migrations to mig
8000
rate the current CVSS vector to this new approach
f0f7f67
to
171c831
Compare
re:
CVSSV31, say we have two rows with these data:
After the migration(s) I would like to see only one record:
This is best done in three steps:
|
ffc6c72
to
9563a61
Compare
vulnerabilities/migrations/0030_vulnerabilityseverity _rm_extra_records_swap.py
Outdated
Show resolved
Hide resolved
e0a8e81
to
df1ea13
Compare
Signed-off-by: ziadhany <ziadhany2016@gmail.com> Change the max length of scoring_elements Signed-off-by: ziadhany <ziadhany2016@gmail.com> Fix typo in swap function and fix migration test Signed-off-by: ziadhany <ziadhany2016@gmail.com> Add a migration test Signed-off-by: ziadhany <ziadhany2016@gmail.com> Rename migration variable model Signed-off-by: ziadhany <ziadhany2016@gmail.com> Fix test Signed-off-by: ziadhany <ziadhany2016@gmail.com> Remove duplicate rows for CVSS Signed-off-by: ziadhany <ziadhany2016@gmail.com>
b85064c
to
f779900
Compare
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.
Thanks for the update! please see some comments inline.
vulnerabilities/migrations/0030_vulnerabilityserverity_compute_score.py
Outdated
Show resolved
Hide resolved
vulnerabilities/migrations/0030_vulnerabilityserverity_compute_score.py
Outdated
Show resolved
Hide resolved
To avoid merge conflicts Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Use a subclass of the related scoring systems Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
- Conflate migration 32 and 33 in a single one - Use subclasses for CVSS ScoringSystem with their score computation - Update tests Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
* Track the CVSS vector as scoring elements and not a separate score * Also add and use scoring elements everywhere we use VulnerabilitySeverity * Update api, importers, improvers and tests Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Otherwise we had some test_migrations files skipped and not formatted Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Also fix tests to use a regen env variable consistently Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@ziadhany I pushed these updates:
The new migration(s) handle all possible duplicates cases this way:
I need to test run it on the whole DB to validate this is correct |
@ziadhany This is essentially the same approach as yours, but folded in a single migration with bulk updates |
This is to avoid any integrity violations in migration Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
LGTM , I tested it with my local database |
@ziadhany please add CHANGEOLG for this PR |
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!
Reference: #713
Signed-off-by: Ziad ziadhany2016@gmail.com