-
-
Notifications
You must be signed in to change notification settings - Fork 234
Migrate Xen, Curl, Istio and OSS-Fuzz importer #1946
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
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
Signed-off-by: Tushar Goel <[email protected]>
6d6626e
to
3479b49
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.
Thanks @TG1999, see some feedback.
@@ -307,6 +312,8 @@ def to_advisory(self, data): | |||
weaknesses=weaknesses, | |||
url=reference.url, | |||
severities=severities, | |||
original_advisory_text=json.dumps(data, indent=2, ensure_ascii=False), |
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 don't think we need indent.
weaknesses = get_cwe_from_curl_advisory(raw_data) | ||
|
||
aliases = raw_data.get("aliases", []) | ||
advisory_id = raw_data.get("id") or "" |
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.
Instead of returning an advisory data with no advisory_id
, we should log error and continue.
@@ -129,4 +136,5 @@ def process_file(self, file, base_path) -> Iterable[AdvisoryData]: | |||
affected_packages=affected_packages, | |||
url=advisory_url, | |||
date_published=date_published, | |||
original_advisory_text=advisory_text or str(yaml_file), |
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.
Wouldn't it be more appropriate to do yaml dump instead of str(yaml_file)
?
] | ||
) | ||
|
||
title = data.get("title") or "" |
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.
Since we are using it as an advisory_id
, if there is no title
we should log error and continue, instead for returning a AdvisoryData with empty advisory_id
.
@@ -130,6 +134,7 @@ def to_advisory_data(self, file: Path) -> Iterable[AdvisoryData]: | |||
references_v2=references, | |||
severities=severities, | |||
url=f"https://github.com/nodejs/security-wg/blob/main/vuln/npm/{id}.json", | |||
original_advisory_text=advisory_text or json.dumps(data, indent=2, ensure_ascii=False), |
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.
Isn't advisory_text
already a JSON dump?
advisory_text or json.dumps(data, indent=2, ensure_ascii=False)
This seems redundant, if we don't have an advisory_text
how can we have data
.
if not self.links: | ||
self.collect_links() | ||
return len(self.links) | ||
return 30 |
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 not fixed postgres will have more advisory here in future, right?
Closes: #1878