Skip to content

Commit 84fcee0

Browse files
authored
Merge pull request #347 from sbs2001/fix-alpine-schema-regex
Fix regex in schema validator in alpine importer
2 parents 34d9a36 + 57481fc commit 84fcee0

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ptyprocess==0.6.0
3333
py==1.8.0
3434
pycodestyle==2.5.0
3535
pycparser==2.20
36-
pygit2==1.2.0
36+
pygit2==1.5.0
3737
Pygments==2.6.1
3838
pyparsing==2.4.5
3939
pytest==5.3.2
@@ -43,7 +43,7 @@ pytest-django==3.7.0
4343
pytest-mock==1.13.0
4444
python-dateutil==2.8.1
4545
pytz==2019.3
46-
schema==0.7.1
46+
schema==0.7.4
4747
six==1.13.0
4848
soupsieve==1.9.5
4949
sqlparse==0.3.0

vulnerabilities/importers/alpine_linux.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# for any legal advice.
2121
# VulnerableCode is a free software code scanning tool from nexB Inc. and others.
2222
# Visit https://github.com/nexB/vulnerablecode/ for support and download.
23+
from re import IGNORECASE
2324
from typing import Any
2425
from typing import Iterable
2526
from typing import List
@@ -54,7 +55,7 @@ def validate_schema(advisory_dict):
5455
str: Or(
5556
[
5657
Or(
57-
Regex(r"CVE.\d+-\d+"),
58+
Regex(r"CVE.\d+-\d+", flags=IGNORECASE),
5859
Regex(r"XSA-\d{3}"),
5960
Regex(r"ZBX-\d{4}"),
6061
Regex(r"wnpa-sec-\d{4}-\d{2}"),
@@ -187,7 +188,7 @@ def _load_advisories(
187188
impacted_package_urls=[],
188189
resolved_package_urls=resolved_purls,
189190
vuln_references=references,
190-
cve_id=vuln_ids[0] if vuln_ids[0] != "CVE-????-?????" else None,
191+
cve_id=vuln_ids[0].upper() if vuln_ids[0] != "CVE-????-?????" else None,
191192
)
192193
)
193194

0 commit comments

Comments
 (0)