-
Notifications
You must be signed in to change notification settings - Fork 201
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 CWE support in all importers #1137
Conversation
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.
@ziadhany thanks++, some nits for your consideration
vulnerabilities/importers/github.py
Outdated
@@ -227,10 +233,18 @@ def process_response(resp: dict, package_type: str) -> Iterable[AdvisoryData]: | |||
else: | |||
logger.error(f"Unknown identifier type {identifier_type!r} and value {value!r}") | |||
|
|||
weaknesses = [] |
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.
Please make a separate function get_cwes_from_github_advisory
and add docstring and tests for that.
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.
Done
84e191d
to
c7c4f76
Compare
try: | ||
db.get(cwe_id) | ||
weaknesses.append(cwe_id) | ||
except Exception: |
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.
we should change this general exception and replace it with ( InvalidCWEError ) after we merge this aboutcode-org/cwe2#10
Add get_cwes_from_github_advisory function and a test Add CWE support for github importer Add CWE support for osv Add CWE support for gitlab and redhat Signed-off-by: ziadhany <[email protected]>
c7c4f76
to
6158b2a
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.
LGTM!
issues: #1093