Skip to content

Commit

Permalink
Added hookspec for third party plugin to update databases.
Browse files Browse the repository at this point in the history
  • Loading branch information
willis89pr committed Nov 19, 2024
1 parent 6707d3a commit 1920fe3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions plugins/cvebin2vex/surfactantplugin_cvebintool2vex.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,16 @@ def cvebintool2vex(sbom: SBOM, software: Software, filename: str, filetype: str)

# Clean up extra files
delete_extra_files(cdxvex_file_path, vex_file_path, json_file_path)

from pluggy import HookimplMarker

hookimpl = HookimplMarker("surfactant")

@hookimpl
def update_db():
# Example update logic
try:
subprocess.check_call(["cve-bin-tool", "--update", "now", "."])
return "Database updated successfully."
except subprocess.CalledProcessError as e:
return f"Failed to update database: {e}"

0 comments on commit 1920fe3

Please sign in to comment.