Skip to main content

A library and command line interface for the CVE Project services.

Project description

cvelib

A library and command line interface for the CVE Project services.

Installation

pip install --user cvelib

Python version 3.6 or greater is required.

CLI Setup and Configuration

Currently, the only supported CVE Project service is the CVE ID Reservation (IDR) service. Each command executed against IDR requires the user to authenticate. You can provide the authentication details with the command (using options -u/--username, -o/--org, and -a/--api-key) or set them in the following environment variables:

export CVE_USER=margo
export CVE_ORG=acme
export CVE_API_KEY=<api_key>

Additionial options that have an accompanying environment variable include:

  • -e/--environment or CVE_ENVIRONMENT: allows you to configure the deployment environment (that is, the URL at which the service is available) to interface with. Allowed values: prod, dev.

  • --idr-url or CVE_IDR_URL: allows you to override the URL for the IDR service that would otherwise be determined by the deployment environment you selected. This is useful for local testing to point to an IDR instance running on localhost.

  • -i/--interactive or CVE_INTERACTIVE: every create/update action against the IDR service will require confirmation before a request is sent.

CLI Usage

Available options and commands can be displayed by running cve --help. The following are examples of some commonly used operations.

Reserve one CVE ID in the current year (you will be prompted to confirm your action):

cve --interactive reserve

Reserve three non-sequential CVE IDs for a specific year:

cve reserve 3 --year 2021 --random

List all rejected CVEs for year 2018:

cve list --year 2018 --state reject

Development Setup

git clone https://github.com/RedHatProductSecurity/cvelib.git
cd cvelib
python3 -m venv venv  # Must be Python 3.6 or later
source venv/bin/activate
pip install --upgrade pip
pip install -e .
pip install tox

This project uses the Black code formatter. To reformat the entire code base after you make any changes, run:

# Reformat code base with Black
pip install black
black .

Running tests:

# Run all tests and format check (also run as a Github action)
tox
# Run format check only
tox -e black
# Run tests against Python 3.6 only
tox -e py36
# Run a single test against Python 3.6 only
tox -e py36 -- tests/test_cli.py::test_cve_show

CVE is a trademark of The MITRE Corporation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cvelib-0.3.0.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cvelib-0.3.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file cvelib-0.3.0.tar.gz.

File metadata

  • Download URL: cvelib-0.3.0.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for cvelib-0.3.0.tar.gz
Algorithm Hash digest
SHA256 7f56faee2cb0a6c0ed2c7ae6cb90ef13169894e270256245e9ac2a38a881fabc
MD5 b0e228725abbe22fede9265c084a0bb1
BLAKE2b-256 1ba1337aa4e72566aad8b66ab3b822fb9b012c7cc3eb6a3f8efe330dc16c9526

See more details on using hashes here.

File details

Details for the file cvelib-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cvelib-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.0

File hashes

Hashes for cvelib-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 83a18a8702b4a37feb362e169cef7f664c2470ba01c55c0a9310f7ac95b1caa2
MD5 164741bfeb2ea20bb1c61765f3d007c2
BLAKE2b-256 e9421d63d3196573fb78c19baf9ebe7be4c447d4f4a83379ee8669237619da21

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page