Skip to content

Commit 57554a1

Browse files
docs: Add json2 output format (fixes #4333) (#4397)
* fixes #4333
1 parent 3d2bf7f commit 57554a1

File tree

3 files changed

+173
-4
lines changed

3 files changed

+173
-4
lines changed

.github/actions/spelling/allow.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ bash
3838
bashrc
3939
bazel
4040
bcca
41+
bcrypt
4142
bdbd
4243
bdist
4344
bestpractices
@@ -129,6 +130,7 @@ cybersecurity
129130
cygwin
130131
d
131132
darkhttpd
133+
datasource
132134
dav
133135
davfs
134136
dbus

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ We also provide an example [GitHub action](https://github.com/intel/cve-bin-tool
163163

164164
## Output Options
165165

166-
The CVE Binary Tool provides console-based output by default. If you wish to provide another format, you can specify this and a filename on the command line using `--format`. The valid formats are CSV, JSON, console, HTML and PDF. The output filename can be specified using the `--output-file` flag.
166+
The CVE Binary Tool provides console-based output by default. If you wish to provide another format, you can specify this and a filename on the command line using `--format`. The valid formats are CSV, JSON, JSON2, console, HTML and PDF. The output filename can be specified using the `--output-file` flag.
167167

168168
You can also specify multiple output formats by using comma (',') as separator:
169169

170170
```bash
171-
cve-bin-tool file -f csv,json,html -o report
171+
cve-bin-tool file -f csv,json,json2,html -o report
172172
```
173173

174174
Note: You must not use spaces between the commas (',') and the output formats.
@@ -473,7 +473,7 @@ Output:
473473
provide output filename (default: output to stdout)
474474
<a href="https://github.com/intel/cve-bin-tool/blob/main/doc/MANUAL.md#--html-theme-html_theme">--html-theme HTML_THEME</a>
475475
provide custom theme directory for HTML Report
476-
<a href="https://github.com/intel/cve-bin-tool/blob/main/doc/MANUAL.md#-f-csvjsonconsolehtml---format-csvjsonconsolehtml">-f {csv,json,console,html,pdf}, --format {csv,json,console,html,pdf}</a>
476+
<a href="https://github.com/intel/cve-bin-tool/blob/main/doc/MANUAL.md#-f-csvjsonconsolehtml---format-csvjsonconsolehtml">-f {csv,json,json2,console,html,pdf}, --format {csv,json,json2,console,html,pdf}</a>
477477
update output format (default: console)
478478
specify multiple output formats by using comma (',') as a separator
479479
note: don't use spaces between comma (',') and the output formats.

doc/MANUAL.md

Lines changed: 168 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ which is useful if you're trying the latest code from
153153
provide output filename (default: output to stdout)
154154
--html-theme HTML_THEME
155155
provide custom theme directory for HTML Report
156-
-f {csv,json,console,html,pdf}, --format {csv,json,console,html,pdf}
156+
-f {csv,json,json2,console,html,pdf}, --format {csv,json,json2,console,html,pdf}
157157
update output format (default: console)
158158
specify multiple output formats by using comma (',') as a separator
159159
note: don't use spaces between comma (',') and the output formats.
@@ -573,6 +573,173 @@ EPSS bridges this gap by incorporating up-to-date threat information from CVE an
573573

574574
![JSON metric table](images/metric/JSON.png)
575575

576+
- JSON2
577+
578+
```json
579+
{
580+
"$schema": "",
581+
"metadata": {
582+
"tool": {
583+
"name": "cve-bin-tool",
584+
"version": "3.4rc0"
585+
},
586+
"generation_date": "2024-08-28 18:56:24",
587+
"parameter": {
588+
"options": {
589+
"help": null,
590+
"exclude": [],
591+
"version": null,
592+
"disable-version-check": false,
593+
"disable-validation-check": false,
594+
"offline": false,
595+
"detailed": false
596+
},
597+
"cve_data_download": {
598+
"nvd": "json-mirror",
599+
"update": "daily",
600+
"nvd-api-key": "",
601+
"disable-data-source": [],
602+
"use-mirror": ""
603+
},
604+
"input": {
605+
"directory": "test/language_data/Gemfile.lock",
606+
"input-file": "",
607+
"config": "",
608+
"package-list": "",
609+
"sbom": "",
610+
"sbom-file": "",
611+
"vex-file": ""
612+
},
613+
"output": {
614+
"quiet": false,
615+
"log-level": "info",
616+
"output-file": "/tmp/gem.json",
617+
"html-theme": "",
618+
"format": "json2",
619+
"generate-config": "",
620+
"cvss": 0,
621+
"severity": "low",
622+
"metrics": false,
623+
"epss-percentile": null,
624+
"epss-probability": null,
625+
"no-0-cve-report": false,
626+
"available-fix": "",
627+
"backport-fix": "",
628+
"affected-versions": 0,
629+
"sbom-output": "",
630+
"sbom-type": "spdx",
631+
"sbom-format": "tag"
632+
},
633+
"vex_output": {
634+
"vex-output": "",
635+
"vex-type": "",
636+
"product": "",
637+
"release": "",
638+
"vendor": "",
639+
"revision-reason": "",
640+
"filter-triage": false
641+
},
642+
"merge_report": {
643+
"append": false,
644+
"tag": "",
645+
"merge": null,
646+
"filter": []
647+
},
648+
"checkers": {
649+
"skips": "",
650+
"runs": ""
651+
},
652+
"database_management": {
653+
"import-json": "",
654+
"ignore-sig": false,
655+
"log-signature-error": false,
656+
"verify": "",
657+
"export-json": "",
658+
"pgp-sign": "",
659+
"passphrase": "",
660+
"export": "",
661+
"import": ""
662+
},
663+
"exploits": {
664+
"exploits": false
665+
},
666+
"deprecated": {
667+
"extract": true,
668+
"report": false
669+
}
670+
}
671+
},
672+
"database_info": {
673+
"last_updated": "2024-08-28 18:29:40",
674+
"total_entries": {
675+
"NVD": 251104,
676+
"OSV": 172654,
677+
"GAD": 20792,
678+
"REDHAT": 18002
679+
}
680+
},
681+
"vulnerabilities": {
682+
"summary": {
683+
"CRITICAL": 14,
684+
"HIGH": 57,
685+
"MEDIUM": 39,
686+
"LOW": 8,
687+
"UNKNOWN": 19
688+
},
689+
"report": [
690+
{
691+
"datasource": "OSV",
692+
"entries": [
693+
{
694+
"vendor": "microsoft",
695+
"product": "azure-storage-blob",
696+
"version": "2.0.3",
697+
"location": "test/language_data/Gemfile.lock",
698+
"cve_number": "CVE-2022-30187",
699+
"severity": "MEDIUM",
700+
"score": "4.7",
701+
"source": "OSV",
702+
"cvss_version": "3",
703+
"cvss_vector": "CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N",
704+
"paths": "test/language_data/Gemfile.lock",
705+
"remarks": "NewFound",
706+
"comments": ""
707+
},
708+
{
709+
...
710+
}
711+
]
712+
},
713+
{
714+
"datasource": "NVD",
715+
"entries": [
716+
{
717+
"vendor": "unknown",
718+
"product": "bcrypt",
719+
"version": "3.1.16",
720+
"location": "test/language_data/Gemfile.lock",
721+
"cve_number": "CVE-2020-7689",
722+
"severity": "HIGH",
723+
"score": "7.5",
724+
"source": "NVD",
725+
"cvss_version": "3",
726+
"cvss_vector": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N",
727+
"paths": "test/language_data/Gemfile.lock",
728+
"remarks": "NewFound",
729+
"comments": ""
730+
},
731+
{
732+
...
733+
}
734+
]
735+
}
736+
]
737+
}
738+
}
739+
```
740+
741+
742+
576743
## Optional Arguments
577744

578745
### -e EXCLUDE, --exclude EXCLUDE

0 commit comments

Comments
 (0)