-
Notifications
You must be signed in to change notification settings - Fork 35
Allow calculation of CVSS3 score using SQL functions, like a madman. #399
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
Provide enough escape-hatches around filterin/sorting to do my evil deeds. Do some evil deeds in SQL to allow sorting/filtering by synthetic `average_score` on advisories. Do even more evil, by writing entirely too many SQL functions. Lay in appropriate DOWN migration for cvss3 scoring functions.
|
@carlosthe19916 this should allow sorting by Relates to #383 |
jcrossley3
left a comment
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.
I feel a little dirty approving this. But I don't have any better ideas.
| // To be able to ORDER or WHERE using a synthetic column, we must first | ||
| // SELECT col, extra_col FROM (SELECT col, random as extra_col FROM...) | ||
| // which involves mucking about inside the Select<E> to re-target from | ||
| // the original underlying table it expects the entity to live in. |
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.
This is a little terrifying.
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.
Apparently it's normal! We so similar for SELECT COUNT(*) FROM ( <original select> ) on the limiter stuff.
|
So we are doing all this work just to avoid having an intermediate search model? |
|
Just a comment after having seen the PLSQL code. |
|
Marco: yes we should probably just store the computer score. Will still need the extra magic to sort and filter by the AVG() but it would reduce the work of the DB by some. I'll enhance. |
Provide enough escape-hatches around filterin/sorting to do my evil deeds. Do some evil deeds in SQL to allow sorting/filtering by synthetic
average_scoreon advisories. Do even more evil, by writing entirely too many SQL functions. Lay in appropriate DOWN migration for cvss3 scoring functions.