Skip to content

Commit

Permalink
Added git osv source
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <[email protected]>
  • Loading branch information
prabhu committed Mar 19, 2024
1 parent 3b040e7 commit 8d5c5f1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion vdb/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions vdb/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions vdb/lib/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 8d5c5f1

Please sign in to comment.