Skip to content

Commit 0b529bc

Browse files
author
Prabhu Subramanian
committed
Bug fixes. Closes #12
1 parent 7545ff0 commit 0b529bc

File tree

6 files changed

+49
-5
lines changed

6 files changed

+49
-5
lines changed

.github/workflows/pythonapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
os: [ubuntu-latest, macos-latest, windows-latest]
12-
python-version: [3.6, 3.7, 3.8]
12+
python-version: [3.8]
1313
steps:
1414
- uses: actions/checkout@v2
1515
- name: Set up Python 3.7

.github/workflows/pythonpublish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Upload depscan Python Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
9+
jobs:
10+
deploy:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Set up Python
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: '3.x'
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install setuptools wheel twine
24+
- name: Create Release
25+
id: create_release
26+
uses: actions/create-release@v1
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
with:
30+
tag_name: ${{ github.ref }}
31+
release_name: Release ${{ github.ref }}
32+
draft: false
33+
prerelease: false
34+
- name: Build and publish
35+
env:
36+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
37+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
38+
run: |
39+
python setup.py sdist bdist_wheel
40+
twine upload dist/*

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@
2121
"Intended Audience :: System Administrators",
2222
"Topic :: Utilities",
2323
"Topic :: Security",
24-
"Programming Language :: Python :: 3.6",
25-
"Programming Language :: Python :: 3.7",
2624
"Programming Language :: Python :: 3.8",
2725
"License :: OSI Approved :: MIT License",
2826
"Operating System :: OS Independent",
2927
],
30-
python_requires=">=3.6",
28+
python_requires=">=3.8",
3129
)

test/test_source.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def test_cve_json():
1919
def test_convert(test_cve_json):
2020
nvdlatest = NvdSource()
2121
data = nvdlatest.convert(test_cve_json)
22-
assert len(data) == 385
22+
assert len(data) == 384
2323
for v in data:
2424
details = v.details
2525
for detail in details:

vdb/lib/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,9 @@ def from_values(
342342
version_right = "<=" + max_affected_version_including
343343
if version_left and not version_right:
344344
version = version_left
345+
# Convert >0.0.0 to *
346+
if version == ">0.0.0":
347+
version = "*"
345348
elif not version_left and version_right:
346349
version = version_right
347350
elif version_left and version_right:

vdb/lib/nvd.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ def convert_vuln(vuln):
123123
severity = None
124124
base_score = None
125125
description = vuln["cve"]["description"]["description_data"][0]["value"]
126+
# Issue 12 - Ignore disputed vulnerabilities
127+
if "** DISPUTED **" in description:
128+
return None
126129
rdata = vuln["cve"]["references"]["reference_data"]
127130
related_urls = [r["url"] for r in rdata]
128131
if "baseMetricV3" in vuln["impact"]:

0 commit comments

Comments
 (0)