vulsio / go-cve-dictionary

Build a local copy of CVE (NVD and Japanese JVN). Server mode for easy querying.
Apache License 2.0
368 stars 109 forks source link

feat(commands): Add `cve` command to print a CVE record #376

Closed titpetric closed 7 months ago

titpetric commented 7 months ago

What did you implement:

The PR implements a cli API for retrieving CVE details:

# ./go-cve-dictionary cve CVE-2004-0230
{
  "CveID": "CVE-2004-0230",
  "Nvds": [
    {
      "CveID": "CVE-2004-0230",
      "Descriptions": [

It supports a list of CVEs as arguments (prints individual objects):

# ./go-cve-dictionary cve CVE-2004-0230 CVE-2005-1119 | jq -s | jq .[].CveID
"CVE-2004-0230"
"CVE-2005-1119"

It's reasonably easy to fetch the NVD (or any other DB), but hard to use in scripting jobs as it needs a running server.

Type of change

Please delete options that are not relevant.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Checklist:

You don't have to satisfy all of the following.

Is this ready for review?: YES