Skip to content

Commit

Permalink
feat: added ci script that updates mismatch database (#4236)
Browse files Browse the repository at this point in the history
* feat: added script to populate deduplication database

Signed-off-by: Meet Soni <[email protected]>

* refactor: improved naming in the populator script

Signed-off-by: Meet Soni <[email protected]>

* fix: bypassing diff

* feat: added ci script that updates mismatch database

Signed-off-by: Meet Soni <[email protected]>

* fix: improved logic

Signed-off-by: Meet Soni <[email protected]>

* fix: retrying tests

* feat: required changes

Signed-off-by: Meet Soni <[email protected]>

---------

Signed-off-by: Meet Soni <[email protected]>
Co-authored-by: Terri Oda <[email protected]>
  • Loading branch information
inosmeet and terriko authored Jul 18, 2024
1 parent 1d09c74 commit d815e3a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .github/workflows/update-cache.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Update cached database

on:
push:
branches:
- main
paths:
- 'data/**'
schedule:
# Runs at 00:20 UTC everyday
- cron: '20 0 * * *'
Expand Down Expand Up @@ -49,6 +54,7 @@ jobs:
run: |
[[ -e cache ]] && mkdir -p .cache && mv cache ~/.cache/cve-bin-tool
python -m cve_bin_tool.cli test/assets/test-kerberos-5-1.15.1.out -u now
python -m cve_bin_tool.mismatch_loader
cp -r ~/.cache/cve-bin-tool cache
# Windows cache is currently disabled.
4 changes: 3 additions & 1 deletion cve_bin_tool/cvedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,6 @@ def populate_db(self) -> None:
self.populate_metrics()
# EPSS uses metrics table to get the EPSS metric id.
# It can't be run before creation of metrics table.
self.populate_purl2cpe()

for idx, data in enumerate(self.data):
_, source_name = data
Expand All @@ -539,6 +538,9 @@ def populate_db(self) -> None:
# if source_name != "NVD" and cve_data[0] is not None:
# cve_data = self.update_vendors(cve_data)

if source_name == "PURL2CPE":
self.populate_purl2cpe()

if source_name == "EPSS":
if cve_data is not None:
self.store_epss_data(cve_data)
Expand Down

0 comments on commit d815e3a

Please sign in to comment.