Skip to main content

Default template for PDM package

Project description

pdm-audit

PyPI version

A PDM plugin that scans your Python project dependencies for known vulnerabilities. It leverages pip-audit to provide security auditing capabilities within your PDM workflow.

Features

  • Multiple vulnerability data sources support
  • Multiple output formats:
    • Columnar (default)
    • JSON
    • Markdown
  • Caching support with configurable time-to-live (TTL)
  • Seamless integration with PDM's dependency management

Installation

pdm self add pdm-audit-plugin

Usage

Run pdm audit in your project directory:

pdm audit --help

Command Options

Options:
  -s, --service           The audit source. Default is PyPI, can be pypi, osv.
  -f, --format           The format to emit audit results in (choices: columns, json, markdown)
  --desc                 Include vulnerability descriptions (auto, on, off)
  --enable-cache         Enable the vulnerability query result cache
  --cache-ttl           The cache time-to-live in seconds (default: 1800)

Examples

Basic audit of project dependencies:

pdm audit

Using OSV as the vulnerability database:

pdm audit -s osv

Output in JSON format:

pdm audit -f json

Output in Markdown format:

pdm audit -f markdown

Disable caching:

pdm audit --enable-cache false

Customize cache TTL to 1 hour:

pdm audit --cache-ttl 3600

Security Model

This plugin inherits its security model from pip-audit. Please note:

  • It identifies known vulnerabilities in your dependencies based on data from vulnerability databases
  • It cannot detect undisclosed vulnerabilities or perform static code analysis
  • The audit is only as accurate as the vulnerability data available in the chosen service (PyPI or OSV)

Cache Management

The plugin maintains a cache of vulnerability data to improve performance:

  • Default cache location: .audit_cache in your project directory
  • Default TTL: 1800 seconds (30 minutes)
  • Cache can be disabled or customized via command options

Troubleshooting

Slow Audit Performance

  • First-time audits may be slower due to cache population
  • Subsequent audits will be faster if caching is enabled
  • Consider adjusting cache TTL if needed

Connection Issues

If you encounter connection errors:

  • Verify your internet connection
  • Check if you're behind a corporate proxy
  • Try switching between PyPI and OSV services

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License.

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

pdm_audit_plugin-0.1.2.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

pdm_audit_plugin-0.1.2-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file pdm_audit_plugin-0.1.2.tar.gz.

File metadata

  • Download URL: pdm_audit_plugin-0.1.2.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.21.0 CPython/3.13.0 Linux/6.12.1-manjusakav4-xanmod2-2-manjusaka

File hashes

Hashes for pdm_audit_plugin-0.1.2.tar.gz
Algorithm Hash digest
SHA256 2fa4fee2a4c95d10c69d243f076e3cc002992a9d977abd47ad1c34021b0a3b8f
MD5 ef4f034b99ec50e3e67ca30fe34ffddc
BLAKE2b-256 005f2521c65e30134bf9a772566b7c21fac3e3cffba8c635dd2fcd9854f775c9

See more details on using hashes here.

File details

Details for the file pdm_audit_plugin-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: pdm_audit_plugin-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.21.0 CPython/3.13.0 Linux/6.12.1-manjusakav4-xanmod2-2-manjusaka

File hashes

Hashes for pdm_audit_plugin-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1369c376e4c6c1ee44ae5e1e3a6f80766f7e5aadd5975fa09b929e053eefcb03
MD5 718896bafd6a37412d0d3ab12ef1c431
BLAKE2b-256 0ff5e70d9af07d9b30efbb2d0f566a73a72d24f38e93258a55a7a4eab793f65f

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