Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions cve_bin_tool/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,25 +859,21 @@ def main(argv=None):
return ERROR_CODES[MirrorError]

# import database from JSON chopped by years
if args["import_json"] and cvedb_orig.check_db_exists():
return_code = cvedb_orig.json_to_db_wrapper(
if args["import_json"]:
cvedb_orig.json_to_db_wrapper(
path=args["import_json"],
pubkey=args["verify"],
ignore_signature=args["ignore_sig"],
log_signature_error=args["log_signature_error"],
)
# And terminate operation
return return_code

# Export database as JSON chopped by years
if args["export_json"] and cvedb_orig.check_db_exists():
return_code = cvedb_orig.db_to_json(
cvedb_orig.db_to_json(
path=args["export_json"],
private_key=args["pgp_sign"],
passphrase=args["passphrase"],
)
# And terminate operation
return return_code

# Import database if file exists
if args["import"] and Path(args["import"]).exists():
Expand Down
9 changes: 9 additions & 0 deletions doc/how_to_guides/offline.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ Run the tool to export the latest version of the vulnerability database.
```
$ cve-bin-tool --export <filename>
```
or

```
$ cve-bin-tool --export-json <directory>
```

## Transfer the vulnerability database file into a directory in the offline environment

Expand All @@ -28,6 +33,10 @@ Run the tool to import the transferred copy of the vulnerability database.
```
$ cve-bin-tool --import <filename>
```
or
```
$ cve-bin-tool --import-json <directory>
```

The cve-bin-tool will fail to operate in offline mode if a vulnerability database is not present on the system.

Expand Down
Loading