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: select advisories #396

Closed MaineK00n closed 4 months ago

MaineK00n commented 4 months ago

If this Pull Request is work in progress, Add a prefix of “[WIP]” in the title.

What did you implement:

select advisories and related cve ids

Type of change

How Has This Been Tested?

$ go-cve-dictionary fetch jvn 2024
$ go-cve-dictionary search advisories jvn
{
  "JVNDB-2024-000001": [
    "CVE-2024-22027"
  ],
  "JVNDB-2024-000002": [
    "CVE-2024-22028"
  ],
  "JVNDB-2024-000003": [
    "CVE-2024-21584"
  ],
...

$ docker run --rm --name redis -d -p 127.0.0.1:6379:6379 redis
$ go-cve-dictionary fetch jvn 2024 --dbtype redis --dbpath "redis://127.0.0.1:6379/1"
$ go-cve-dictionary search advisories jvn --dbtype redis --dbpath "redis://127.0.0.1:6379/1"
{
  "JVNDB-2024-000001": [
    "CVE-2024-22027"
  ],
  "JVNDB-2024-000002": [
    "CVE-2024-22028"
  ],
  "JVNDB-2024-000003": [
    "CVE-2024-21584"
  ],
...

Checklist:

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

Is this ready for review?: YES

Reference