-
Notifications
You must be signed in to change notification settings - Fork 36
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
Initial experimental CVE checker (port of TingPing's script) #6
Conversation
def _get_module_data_from_json(json_data): | ||
external_data = [] | ||
for module in json_data.get('modules', []): | ||
if type(module) is str: |
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.
FIXME: remove when #3 lands
libraries = [] | ||
|
||
for module in json_data.get('modules', []): | ||
if type(module) is str: |
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.
Need to actually parse these files at some point.
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.
Yup, I'll create an issue so we don't forget.
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.
@ahayzen Thanks for doing this. Here are a couple of thoughts about the approach though.
-
There are a lot of changes that don't belong to this PR, such as moving classes out of modules and into the package directly. This should be done in a different PR if there's a good reason for doing this. I'd prefer to keep things more contained for now though.
-
I don't understand why you changed the core of the project instead of simply implementing a checker (a plugin) just like we have for debs and other tarballs. You can even add the metadata you want to the sources, in case you need additional metadata to help your checker. Also, if what's missing is a way to print more debug information about each module that has a CVE then you can add a new state to the
ExternalData
+ extra info whereCheckers
can add text to inform the user about what's up.
Does this make sense?
@@ -18,7 +20,7 @@ | |||
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |||
|
|||
from collections import OrderedDict | |||
from lib.externaldata import CheckerRegistry, ExternalData | |||
from lib import CheckerRegistry, CVEData, ExternalData |
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 think this change is out of scope. I don't know how this project will evolve so I prefer to keep things separated like I did.
@joaquimrocha Hey 1 - sure, happy to split things up into smaller PRs when the direction is clear and we know what (if anything) needs to moved. This makes sense, I'll see how far I can get, thanks for the pointers ! |
@joaquimrocha I have a new version here #8 therefore I'm going to close this pull. |
This is a very rough hack to get @TingPing 's awesome script into the project. I have put it behind a flag at the moment
--experimental-cve-checker
. (note it only checks archives). And I started moving some common things into common places.An example of the output is here