-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
I'm looking for a solution to automatically scan the packages in my selected interpreter for a workspace and raise warning/log messages on the UI when there are security vulnerabilities.
pip-audit is a tool for scanning Python environments for packages
with known vulnerabilities. It uses the Python Packaging Advisory Database
(https://github.com/pypa/advisory-db) via the
PyPI JSON API as a source
of vulnerability reports.
So far, the best I can come up with is a task to run pip-audit on project, but this has to be configured per-project, there is no way I can find to have this for all projects with a configured interpreter.
{
"version": "2.0.0",
"tasks": [
{
"label": "Pip Audit",
"type": "shell",
"command": "${command:python.interpreterPath}",
"args": ["-m", "pip_audit"],
"isBackground": true,
"group": "none",
"runOptions": {
"runOn": "folderOpen",
},
},
]
}This required a module-entry point for pip-audit, which is implemented but unreleased.
This feature doesn't really fit into the linters integrations, as its not specific to the current file.
Expectations:
- I can run an audit task on demand via the command pallette
- Task is run on project open
- The audit task uses the currently-installed packages in the selected interpreter and reports against the vulnerability database
- Use of
pip-auditnot required, if other solutions are available