Skip to content

Commit 226e325

Browse files
authored
Adds environment variable to exclude osv malware feeds (#192)
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
1 parent 2eba1de commit 226e325

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "appthreat-vulnerability-db"
3-
version = "5.7.5"
3+
version = "5.7.6"
44
description = "AppThreat's vulnerability database and package search library with a built-in file based storage. OSV, CVE, GitHub, npm are the primary sources of vulnerabilities."
55
authors = [
66
{name = "Team AppThreat", email = "cloud@appthreat.com"},

vdb/lib/osv.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
This module fetches the vulnerability data from osv.dev and stores them in NVD CVE 1.1 json format.
55
"""
6+
import os
67
from zipfile import ZipFile
78

89
import httpx
@@ -121,6 +122,9 @@ def to_vuln(self, cve_data):
121122
references = json_lib.dumps(references)
122123
if isinstance(references, bytes):
123124
references = references.decode("utf-8", "ignore")
125+
# Offer an option to ignore malware data to keep the db size small
126+
if os.getenv("OSV_EXCLUDE_MALWARE") and cve_id.startswith("MAL"):
127+
return ret_data
124128
# Quality of PYSEC data is quite low missing both severity and score
125129
# Where a PYSEC feed also reference a github id, let's ignore it since G comes before P
126130
# so it would have gotten processed

0 commit comments

Comments
 (0)