-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 1228-fixed-affected-version-matching
- Loading branch information
Showing
52 changed files
with
2,084 additions
and
1,018 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# | ||
# Copyright (c) nexB Inc. and others. All rights reserved. | ||
# VulnerableCode is a trademark of nexB Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text. | ||
# See https://github.com/nexB/vulnerablecode for support or download. | ||
# See https://aboutcode.org for more information about nexB OSS projects. | ||
# | ||
import logging | ||
from pathlib import Path | ||
from typing import Iterable | ||
|
||
import saneyaml | ||
|
||
from vulnerabilities.importer import AdvisoryData | ||
from vulnerabilities.importer import Importer | ||
from vulnerabilities.importers.osv import parse_advisory_data | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
class OSSFuzzImporter(Importer): | ||
license_url = "https://github.com/google/oss-fuzz-vulns/blob/main/LICENSE" | ||
spdx_license_expression = "CC-BY-4.0" | ||
url = "git+https://github.com/google/oss-fuzz-vulns" | ||
|
||
def advisory_data(self) -> Iterable[AdvisoryData]: | ||
try: | ||
self.clone(repo_url=self.url) | ||
path = Path(self.vcs_response.dest_dir) / "vulns" | ||
for file in path.glob("**/*.yaml"): | ||
with open(file) as f: | ||
yaml_data = saneyaml.load(f.read()) | ||
yield parse_advisory_data(yaml_data, supported_ecosystem="oss-fuzz") | ||
finally: | ||
if self.vcs_response: | ||
self.vcs_response.delete() |
Oops, something went wrong.