Skip to content

Commit baf2654

Browse files
authored
Add csv2cve entrypoint, update docs for 0.3.0 (#205)
1 parent 2cd662b commit baf2654

File tree

4 files changed

+30
-9
lines changed

4 files changed

+30
-9
lines changed

CSV2CVE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ At the moment, you must use the exact vendor and package strings used in the Nat
1010

1111
Running the tool:
1212
----------------
13-
`python -m cve_bin_tool.csv2cve <csv_file>`
13+
`csv2cve <csv_file>`
14+
15+
If you are trying to run a local copy from source, you can also use `python -m cve_bin_tool.csv2cve <csv_file>`
1416

1517
Example .csv file:
1618
------------------
@@ -60,4 +62,4 @@ CVE-2019-5436
6062
CVES for wontwork no, version 7.7
6163
No CVEs found. Is the vendor/package info correct?
6264

63-
```
65+
```

MANUAL.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ without CVE descriptions or information while the scan is progressing. It
174174
outputs a CSV with the results to stdout. In the form of `package name, version,
175175
CVE number, CVE severity`. Below is an example of it being run on our expat test file:
176176

177-
```
177+
```console
178178
(venv3.6) terri@sandia:~/Code/cve-bin-tool$ python -m cve_bin_tool.cli test/binaries/test-expat-2.0.1.out
179179
Updating CVE data. This will take a few minutes.
180180
Last Update: 2019-08-09
@@ -202,8 +202,7 @@ The verbose mode is another human-friendly mode. Unlike default mode, it
202202
prints results per file as they're found, as well as printing the final
203203
summary, so you can see its progress as it traverses directories.
204204

205-
Sample output on a directory containing vulnerable curl and sqlite rpms:
206-
```
205+
```console
207206
(venv3.6) terri@sandia:~/Code/cve-bin-tool$ python -m cve_bin_tool.cli -v -x ~/output_test_verbose/
208207
Updating CVE data. This will take a few minutes.
209208
Last Update: 2019-08-09
@@ -253,12 +252,15 @@ As the name implies, quiet mode has no console output, and one must check the
253252
return code to see if any issues were found. The return value will be the number of files that have been found to have CVEs
254253

255254
Below is what it returns on bash when one file is found to have CVEs:
256-
```
255+
256+
```console
257257
terri@sandia:~/Code/cve-bin-tool$ cve-bin-tool -q ~/output_test_quiet/openssl
258258
terri@sandia:~/Code/cve-bin-tool$ echo $?
259259
1
260260
```
261261

262+
Note that errors are returned as negative numbers.
263+
262264
### Logging modes
263265

264266
The logging modes provide additional fine-grained control for debug information.

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ if a given directory or binary file includes common libraries with known
1313
vulnerabilities.
1414

1515
Usage:
16-
`python -m cve_bin_tool.cli <flags> <path to directory>`
16+
`cve-bin-tool <flags> <path to directory>`
17+
18+
You can also do `python -m cve_bin_tool.cli <flags> <path to directory>` which is useful if you're trying the latest code from [the cve-bin-tool github](https://github.com/intel/cve-bin-tool/compare).
19+
1720

1821
```
1922
-h, --help show help message and exit
@@ -102,6 +105,16 @@ On windows systems, you may need:
102105

103106
Windows has `ar` and `Expand` installed in default, but `7z` in particular might need to be installed. (7z is used only for rpm extraction, which is used heavily in our test suite, but if you're not scanning rpm files on windows you may be able to do without.)
104107

108+
CSV2CVE
109+
-------
110+
111+
The CVE Binary Tool package also includes a tool called `csv2cve` which is a helper tool that allows you to search the local database for a list of known packages. This can be useful if the list of packages is known.
112+
113+
Usage:
114+
`csv2cve <csv_file>`
115+
116+
The CSV file must contain the following columns: `vendor,package,version` where the vendor and package names are exact matches to the strings in the National Vulnerability Database. You can read more about how to find the correct string in [the checker documentation](https://github.com/intel/cve-bin-tool/blob/master/cve_bin_tool/checkers/README.md), and the [csv2cve manual](https://github.com/intel/cve-bin-tool/blob/master/CSV2CVE.md) has more information on using this tool.
117+
105118
Feedback & Contributions
106119
------------------------
107120

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99

1010
setup_kwargs = dict(
1111
name="cve-bin-tool",
12-
version="0.2.0",
12+
version="0.3.0",
1313
description="CVE Binary Checker Tool",
1414
long_description=readme,
15+
long_description_content_type="test/markdown",
1516
author="Terri Oda",
1617
author_email="[email protected]",
1718
maintainer="Terri Oda",
@@ -37,7 +38,10 @@
3738
install_requires=["jsonschema>=3.0.2"],
3839
packages=find_packages(),
3940
entry_points={
40-
"console_scripts": ["cve-bin-tool = cve_bin_tool.cli:main"],
41+
"console_scripts": [
42+
"cve-bin-tool = cve_bin_tool.cli:main",
43+
"csv2cve = cve_bin_tool.csv2cve:main",
44+
],
4145
"cve_bin_tool.checker": [
4246
"%s = cve_bin_tool.checkers.%s:get_version"
4347
% tuple((2 * [filename.replace(".py", "")]))

0 commit comments

Comments
 (0)