Skip to content

Conversation

@ziadhany
Copy link
Collaborator

issues: #1093

@ziadhany ziadhany changed the title Add CWE support for gitlab and redhat Add CWE support in all importers Mar 7, 2023
@TG1999
Copy link
Contributor

TG1999 commented Aug 22, 2023

@ziadhany Thanks++, before associating any vulnerability with CWE please check if it exists in cwe2 DB or not like this #1256, and also please do this for NVD importer too.

Copy link
Contributor

@TG1999 TG1999 left a 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

else:
logger.error(f"Unknown identifier type {identifier_type!r} and value {value!r}")

weaknesses = []
Copy link
Contributor

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

try:
db.get(cwe_id)
weaknesses.append(cwe_id)
except Exception:
Copy link
Collaborator Author

@ziadhany ziadhany Nov 14, 2023

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 <ziadhany2016@gmail.com>
Copy link
Contributor

@TG1999 TG1999 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@TG1999 TG1999 merged commit a114deb into aboutcode-org:main Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants