Default template for PDM package
Project description
pdm-audit
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
- PyPI vulnerability database via the PyPI JSON API
- OSV database 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_cachein 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pdm_audit_plugin-0.1.0.tar.gz.
File metadata
- Download URL: pdm_audit_plugin-0.1.0.tar.gz
- Upload date:
- Size: 4.3 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c268867cabe13d28c4aef85d4d802d5f134977d1eeab3d4c9d9280c83e0d69fa
|
|
| MD5 |
23cea3b3bdadf903482aac7e6e9dba16
|
|
| BLAKE2b-256 |
c0f005bbb6a732172f6a16c64b0e5fd210862525bee2abab524e11dfa447e360
|
File details
Details for the file pdm_audit_plugin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pdm_audit_plugin-0.1.0-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
096de0cfc8725a32e225c5000478161b1910f6964f3afb35fdc0963bf41c2ed0
|
|
| MD5 |
6e3db1fcfddaa7d7e4ddcc35c4d05d92
|
|
| BLAKE2b-256 |
962049989f0c27eec87785973680fe4ecd697c48dfb10261c228270312bfeed3
|