Skip to main content

Poetry plugin for checking security vulnerabilities in dependencies

Project description

Poetry Audit Plugin

Poetry plugin for checking security vulnerabilities in dependencies based on safety.

$ poetry audit
Scanning 19 packages...

  • ansible-runner     installed 1.1.2  affected <1.3.1   CVE PVE-2021-36995
  • ansible-tower-cli  installed 3.1.8  affected <3.2.0   CVE CVE-2020-1733 
  • jinja2             installed 2.0    affected <2.11.3  CVE CVE-2020-28493

3 vulnerabilities found

Installation

The easiest way to install the audit plugin is via the self add command of Poetry.

poetry self add poetry-audit-plugin

If you used pipx to install Poetry you can add the plugin via the pipx inject command.

pipx inject poetry poetry-audit-plugin

Otherwise, if you used pip to install Poetry you can add the plugin packages via the pip install command.

pip install poetry-audit-plugin

Available options

  • --json: Export the result in JSON format.

  • --ignore-code: Ignore some vulnerabilities IDs. Receive a list of IDs. For example:

poetry audit --ignore-code=CVE-2022-42969,CVE-2020-10684
  • --ignore-package: Ignore some packages. Receive a list of packages. For example:
poetry audit --json --ignore-package=py,ansible-tower-cli
  • --proxy-protocol, --proxy-host, --proxy-port: Proxy to access Safety DB. For example:
poetry audit --proxy-protocol=http --proxy-host=localhost --proxy-port=3128
  • --cache-sec: How long Safety DB can be cached locally. For example:
poetry audit --cache-sec=60

Exit codes

poetry audit will exit with a code indicating its status.

  • 0: Vulnerabilities were not found.
  • 1: One or more vulnerabilities were found.
  • Others: Something wrong happened.

Develop poetry-audit-plugin

You can read this document to setup an environment to develop poetry-audit-plugin.

First step is to install Poetry. Please read official document and install Poetry in your machine.

Then, you can install dependencies of poetry-audit-plugin with the following command.

poetry install

Once you've done it, you can start developing poetry-audit-plugin. You can use test assets for the testing.

cd tests/assets/no_vulnerabilities
poetry shell
poetry audit

Please lint, format, and test your changes before creating pull request to keep the quality.

./scripts/lint.sh
./scripts/format.sh
./scripts/test.sh

Contribution

Help is always appreciated. Please feel free to create issue and pull request!

License

This project is licensed under the terms of the MIT license.

Download files

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

Source Distribution

poetry_audit_plugin-0.4.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

poetry_audit_plugin-0.4.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file poetry_audit_plugin-0.4.0.tar.gz.

File metadata

  • Download URL: poetry_audit_plugin-0.4.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.8.18 Linux/6.5.0-1015-azure

File hashes

Hashes for poetry_audit_plugin-0.4.0.tar.gz
Algorithm Hash digest
SHA256 5f266c8ac2eedcc891f889a4f8636f5d37213fcd6c43d60a61765d1cdcd4b455
MD5 e72a0e3875936dd0f33b3c082b76e500
BLAKE2b-256 8a3bc4721c1d7cd642a407ba4a09d3aee57a5975b0fa8e73fb1804470764f637

See more details on using hashes here.

File details

Details for the file poetry_audit_plugin-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for poetry_audit_plugin-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ffaacdd5d29af8c3dbaa198e49f3b49bb578f2af5ec8b7dda7817b89abb8a8a4
MD5 dce8eaf35d6da023254dc8a0ecec69ad
BLAKE2b-256 4c16bc592dcf87c73d73fb532f476765fc8df4adc1f9b54a382954109e4de27f

See more details on using hashes here.

Supported by

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