From 8d5c5f166af8f64731429e5b96f22de989bb2824 Mon Sep 17 00:00:00 2001 From: Prabhu Subramanian Date: Tue, 19 Mar 2024 17:39:44 +0000 Subject: [PATCH] Added git osv source Signed-off-by: Prabhu Subramanian --- vdb/cli.py | 2 +- vdb/lib/config.py | 1 + vdb/lib/search.py | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vdb/cli.py b/vdb/cli.py index 4533bc8..21195ae 100644 --- a/vdb/cli.py +++ b/vdb/cli.py @@ -126,7 +126,7 @@ def main(): db_lib.optimize_and_close_all() if args.search: if args.search.startswith("pkg:"): - results = search.search_by_purl(args.search, with_data=True) + results = search.search_by_purl_like(args.search, with_data=True) elif args.search.startswith("CVE-") or args.search.startswith("GHSA-") or args.search.startswith("MAL-"): results = search.search_by_cve(args.search, with_data=True) else: diff --git a/vdb/lib/config.py b/vdb/lib/config.py index 250231c..e456897 100644 --- a/vdb/lib/config.py +++ b/vdb/lib/config.py @@ -62,6 +62,7 @@ "almalinux": "https://osv-vulnerabilities.storage.googleapis.com/AlmaLinux/all.zip", "rockylinux": "https://osv-vulnerabilities.storage.googleapis.com/Rocky%20Linux/all.zip", "swift": "https://osv-vulnerabilities.storage.googleapis.com/SwiftURL/all.zip", + "git": "https://osv-vulnerabilities.storage.googleapis.com/GIT/all.zip", } # These feeds introduce too much false positives diff --git a/vdb/lib/search.py b/vdb/lib/search.py index 2b3ad78..73f79f0 100644 --- a/vdb/lib/search.py +++ b/vdb/lib/search.py @@ -76,8 +76,8 @@ def search_by_cpe_like(cpe: str, with_data=False) -> list | None: return filtered_list -def search_by_purl(purl: str, with_data=False) -> list | None: - """Search by purl""" +def search_by_purl_like(purl: str, with_data=False) -> list | None: + """Search by purl like string""" db_conn, index_conn = db6.get(read_only=True) purl_obj = utils.parse_purl(purl) if purl_obj: