-
-
Notifications
You must be signed in to change notification settings - Fork 440
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
added nvd_cve analyzer closes (#2245) #2560
Conversation
@mlodic I've updated the Usage.md with the NIST CVE analyzer details. |
api_app/analyzers_manager/migrations/0128_analyzer_config_nvd_cve.py
Outdated
Show resolved
Hide resolved
api_app/analyzers_manager/migrations/0128_analyzer_config_nvd_cve.py
Outdated
Show resolved
Hide resolved
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.
considering that only CVE numbers are accepted, I would add a check in the code about the correctness of the CVE (a regex). Could you add it?
Sure, why not. I'll add it promptly. |
c4e1a70
to
c7d88e7
Compare
@mlodic should I add a testcase of valid CVE since for generic analyzers observable_name is set to [email protected] or should I create a validate_cve_format() function and monkeypatch it? what do you suggest |
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.
can you please pull from develop and update the migration numbers. This can happen while other people are working on the project and their PR are merged earlier.
About your question: it would be great if you could add a new test for this analyzer only and with the correct and incorrect input + yes, use a validate_cve_format function and patch it to have the "classic" test working
Could you let me know if there is any information on where to add the tests, how the tests function. I'd gone through the documentation but there was little info regarding this. This would help me in creating the tests for this analyzer. |
to create a new specific test you can copy how was done for the recent file analyzers tests that were added here. You can create a new folder About the "classic" tests: in |
Though skipping the check would reduce my work but I think I should go with adding the tests since that will be helpful in future as well. |
@mlodic hope this is sufficient, let me know in case you want any changes to be made. :) |
great! merged! |
closes #2245
Description
Added NIST CVE analyzer which fetches the details of supplied CVE id.
Type of change
Please delete options that are not relevant.
Checklist
develop
dumpplugin
command and added it in the project as a data migration. ("How to share a plugin with the community")test_files.zip
and you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERS
playbook by following this guide.url
that contains this information. This is required for Health Checks._monkeypatch()
was used in its class to apply the necessary decorators.MockUpResponse
of the_monkeypatch()
method. This serves us to provide a valid sample for testing.Black
,Flake
,Isort
) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.tests
folder). All the tests (new and old ones) gave 0 errors.DeepSource
,Django Doctors
or other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.Important Rules
Screenshot
JSON Report
job#16_report.json